How to evaluate Integral : $$\int\;\frac {1}{\sqrt {1-e^{2x}}}dx $$
My attempt:
I know that my answer is wrong, but I don't know exactly where the error is. I need help finding out?
$$I = \int\;\frac {1}{\sqrt {1-e^{2x}}}dx$$ let : $$t=e^{x}\;\implies\;dt=e^{x}dx\;\implies\;dt=tdx\implies\;dx=\textstyle\frac {dt}{t}$$ And therefore : $$\implies\;I=\int\;\frac {1}{\sqrt {1-t^2}}×\frac {1}{t}dt=\int\frac {1}{t\sqrt {1-t^2}}dt$$ let : $$t=\cos\theta\;\implies\;dt=\sin\theta\;d\theta$$ And therefore : $$\implies\;I=\int\;\frac {\sin\theta d\theta}{\cos\theta\sqrt {1-\cos^2(\theta)}}=\int\;\frac {-d\theta}{\cos\theta}\\~\\=-\ln\frac {1+\sin\theta}{\cos\theta}=\ln\frac {\cos\theta}{1+\sin\theta}+c$$
$$using : \sin(\cos^{-1}(t))=\sqrt {1-t^2}$$
$$\implies\;I=\ln\frac {\cos(\cos^{-1}(t))}{1+\sin(\cos^{-1}(t))}=\ln\frac t{1+\sqrt {1-t^2}}\\~\\I=\ln\frac {e^x}{1+\sqrt {1-e^{2x}}}+C$$
First note that your integrand is defined only for $x<0.$
Your final result is correct: $$\begin{align}\left(\ln\frac {e^x}{1+\sqrt {1-e^{2x}}}\right)'&=\frac{1+\sqrt {1-e^{2x}}}{e^x}\left(\frac {e^x}{1+\sqrt {1-e^{2x}}}\right)' \\&=\frac{1+\sqrt {1-e^{2x}}}{e^x}~~~\frac {e^x(1+\sqrt {1-e^{2x}})-e^x\frac{-2e^{2x}}{2\sqrt {1-e^{2x}}}}{(1+\sqrt {1-e^{2x}})^2}\\ &=\frac {1+\sqrt {1-e^{2x}}+\frac{e^{2x}}{\sqrt {1-e^{2x}}}}{1+\sqrt {1-e^{2x}}} \\ &=\frac {\sqrt {1-e^{2x}}+1-e^{2x}+e^{2x}}{\sqrt {1-e^{2x}}(1+\sqrt {1-e^{2x}})} \\ &=\frac1{\sqrt {1-e^{2x}}} \end{align}$$ All your calculations (including $\sin\theta=\sqrt{1-\cos^2\theta}$ and your logarithms, which are taken on positive expressions) are also correct, since your two intermediate changes of variable $$t=e^x,\theta=\cos^{-1}(t),$$ force $\theta$ to be in $(0,\pi/2)$ when $x<0.$