Solving indefinite integral $\int \frac{1+\sqrt{1+x^2}}{x^2+\sqrt{1+x^2}}dx$ How can we solve this integration?
$$\int \frac{1+\sqrt{1+x^2}}{x^2+\sqrt{1+x^2}}dx$$
I tried to make the following substitution
$$1+x^2=w^2$$
but this substitution complicated the integral.

Like the answer of @AmerYR, taking $1+x^2=u^2$
$$I=\int \frac{1+\sqrt{1+x^2}}{x^2+\sqrt{1+x^2}} dx= \int \sec u ~du + \int \frac{sec u}{\tan^2 u+ sec u} du$$ $$ \implies I =\log (\tan u+ sec~ u)+J(u)$$
Next, using $\sin u=\frac{2 \tan(u/2)}{1+\tan^(u/2)},~~ \cos u= \frac{1-\tan^(u/2)}{1+\tan^2(u/2)}$ and $t=\tan(u/2), dt= sec^2 (u/2) du/2$, we get
$$J=\int \frac{\cos u ~du} {\sin^2 u + \cos u}= \frac{(1-t^2)/(1+t^2)}{4t^2/(1+t^2)^2+(1-t^2)/(1+t^2)} \frac{2dt}{(1+t^2)}$$
$$\implies J= 2 \int \frac{t^2-1}{t^4-4t^2-1} dt= 2 \int \frac{t^2-1}{(t^2+a^2)(t^2-b^2)}  dt = 2 \int \left(\frac{A}{t^2-a^2} + \frac{B}{t^2+b^2} \right) dt$$
$$\implies 2 \left(\frac{A}{2a} \log \frac{t-a}{t+a} + \frac{B}{b} \tan^{-1} \frac{t}{b} \right) +C$$
Here $a=\sqrt{2+\sqrt{5}}, b=\sqrt{\sqrt{5}-2}$, $A=\frac{\sqrt{5}+1}{2\sqrt{5}}$, $B=\frac{\sqrt{5}-1}{2\sqrt{5}}.$
