# Integral two solutions

at school, we solved this integral and the solution we got was

Wolfram Alpha gave a different solution

Are these two solutions equal?

-

Yes, they are. You can work out this through very simple algebraic means. One has

$$\tanh x=\frac{e^x-e^{-x}}{e^{x}+e^{-x}}.$$

Now $z=\tanh x$, put $y=x$ and you will get the following

$$z=\frac{y^2-1}{y^2+1}$$

and solve for $y$. You will get

$$(z-1)y^2+(z+1)=0$$

and so

$$y=e^x=\pm\sqrt{\frac{1-z}{1+z}}$$

and $\tanh^{-1}$ in this case is obtained taking the logarithm and keeping just the positive solution, that is,

$$\tanh^{-1}z=\frac{1}{2}\ln\left|\frac{1-z}{1+z}\right|.$$

So, if you put $z=\sqrt{1+e^{2x}}$ you will get the identity.

-