TITLE: What is wrong with this integral reasoning?
QUESTION [14 upvotes]: $$\int\frac{x^{2}+1}{x\sqrt{x^{4}+1}}dx$$
We start by multiplying by $1=\frac{x}{x}$.
$$\int\frac{x^{2}+1}{x^{2}\sqrt{x^{4}+1}}xdx$$
Next, we use the substitution $u=x^{2}$;$\frac{du}{2}=xdx$.
$$\frac{1}{2}\int\frac{u+1}{u\sqrt{u^{2}+1}}du=\frac{1}{2}\int\frac{1}{\sqrt{u^{2}+1}}du+\frac{1}{2}\int\frac{1}{u\sqrt{u^{2}+1}}du=$$
$$=\frac{1}{2}\ln\left(u+\sqrt{u^{2}+1}\right)+\frac{1}{2}\int\frac{1}{u\sqrt{u^{2}+1}}du$$
The problem is now reduced to computing the integral $\frac{1}{2}\int\frac{1}{u\sqrt{u^{2}+1}}du$.
$$\frac{1}{2}\int\frac{1}{u\sqrt{u^{2}+1}}du=\frac{1}{2}\int\frac{1}{u^2\sqrt{1+\frac{1}{u^{2}}}}du$$
We use substitution again $v=\frac{1}{u}$;$-dv=\frac{1}{u^{2}}du$, then we have the next integral.
$$-\frac{1}{2}\int\frac{1}{\sqrt{1+v^{2}}}dv=-\frac{1}{2}\ln\left(v+\sqrt{1+v^{2}}\right)=-\frac{1}{2}\ln\left(\frac{1}{u}+\sqrt{1+\frac{1}{u^{2}}}\right)=$$
$$=-\frac{1}{2}\ln\left(\frac{1+\sqrt{u^{2}+1}}{u}\right)$$
Finally the solution is:
$$\int\frac{x^{2}+1}{x\sqrt{x^{4}+1}}dx=\frac{1}{2}\ln\left(u+\sqrt{1+u^{2}}\right)-\frac{1}{2}\ln\left(\frac{1+\sqrt{u^{2}+1}}{u}\right)=\frac{1}{2}\ln\left(\frac{x^{4}+x^{2}\sqrt{x^{4}+1}}{1+\sqrt{x^{4}+1}}\right).$$
But the problem is, the book has the following solution:
$$\int\frac{x^{2}+1}{x\sqrt{x^{4}+1}}dx=\ln\left(\frac{x^{2}-1+\sqrt{x^{4}+1}}{x}\right)$$
which is obviously different.

REPLY [8 votes]: The two expressions are equal up to a constant.
Take from your answer $$\frac{x^2(x^2+\sqrt{x^4+1})}{1+\sqrt{x^4+1}}$$
 and multiply top and bottom by $\sqrt{x^4+1}-1$
you get
$$\frac{x^4-x^2+1+(x^2-1)\sqrt{x^4+1}}{x^2}=\frac{1}{2}\frac{(x^2-1+\sqrt{x^4-1})^2}{x^2}$$
So $$\frac{1}{2} \ln \frac{x^2(x^2+\sqrt{x^4+1})}{1+\sqrt{x^4+1}}=
\frac{1}{2} \ln \frac{1}{2}\frac{(x^2-1+\sqrt{x^4-1})^2}{x^2}=\frac{1}{2}\ln \frac{1}{2}+\frac{1}{2} \ln \frac{(x^2-1+\sqrt{x^4-1})^2}{x^2}=
\frac{1}{2}\ln \frac{1}{2}+\ln \frac{x^2-1+\sqrt{x^4-1}}{x}$$