Evaluating $\int \:\sqrt{1+e^x}dx$ , why I got different answers? I've got 2 steps to evaluating $\int \:\sqrt{1+e^x}dx$ which lead to different values

first step :

$\int \:\sqrt{1+e^x}dx$
let $u\:=\:\sqrt{1+e^x}$ , $du\:=\:\frac{e^x}{2\sqrt{1+e^x}}dx$ , but $e^x\:=\:u^2-1$ and substitute $u$ into $du$, i get $dx\:=\:\frac{2u}{u^2-1}du$
thus, $\int \:\sqrt{1+e^x}dx$ $=2\int \frac{u^2}{u^2-1}du\:$
apply the following algebraic property $\frac{a}{1+a}=-\frac{1}{1+a}+1$ , then the integrand becomes
$\frac{u^2}{u^2-1}=\frac{1}{\:u^2-1}+1$ ,thus
$=2\int \:\:\left(\frac{1}{u^2-1}+1\right)du\:=\:-2arctanh\left(u\right)\:+\:2u\:+C$
substitute back $u$, thus
$\int \:\sqrt{1+e^x}dx=2\sqrt{1+e^x}-2arctanh\left(\sqrt{1+e^x}\right)+C$

2nd step :

using the same substitution for $u$ , $du$, and $dx$
$\int \:\sqrt{1+e^x}dx$ $=\int \frac{2u^2}{u^2-1}du\:$ $=\int \:\left(2\:+\:\frac{1}{u-1}-\frac{1}{u+1}\right)du$
evaluating the integrand one by one, then i get
$=2u\:+ln\left(u-1\right)-ln\left(u+1\right)\:+C\:=\:2u\:+\:ln\left(\frac{u-1}{u+1}\right)\:+\:C$
substitute back $u$, thus the answer becomes
$\int \:\sqrt{1+e^x}dx=2\sqrt{1+e^x}+ln\left(\frac{\sqrt{1+e^x}-1}{\sqrt{1+e^x}+1}\right)+C$

when i do derivative to both answers, i got the same answer which is $\sqrt{1+e^x}$ , it makes me confused which step is the right one? thanks for you answer. :)

EDIT :

Thank you for the answers, now i get it that both answers are correct. :)


It is perfectly normal. It seems just that you forgot that we can rewrite $$\tanh ^{-1}(z)=\frac{1}{2}\log\frac{1+z}{1-z}$$ Have a look at http://en.wikipedia.org/wiki/Inverse_hyperbolic_function where you will find other very useful identities for inverse hyperbolic functions.
