<s>[INST] Error in solving $\int \sqrt{1 + e^x} dx$ . I want to solve this integral for $1 + e^x \ge 0$
$$\int \sqrt{1 + e^x} dx$$ 
I start by parts $$\int \sqrt{1 + e^x} dx = x\sqrt{1 + e^x} - \int x \frac{e^x}{2\sqrt{1 + e^x}} dx $$
Substitute $\sqrt{1 + e^x} = t \implies dt = \frac{e^x}{2\sqrt{1 + e^x}} dx$
So I remain with $$x\sqrt{1 + e^x} - \int \ln((t-1)(t+1)) dt =  x\sqrt{1 + e^x}  + 2t +(-t+1)\ln(t-1)+ (-t+1)\ln(t+1) $$
that is
$$(x+2)\sqrt{1 + e^x} + (-\sqrt{1 + e^x} + 1) \ln(+\sqrt{1 + e^x} - 1) + (-\sqrt{1 + e^x} + 1) \ln(+\sqrt{1 + e^x} + 1) + C  $$
But the solution should be $$2\sqrt{1 + e^x} + \ln(+\sqrt{1 + e^x} - 1) - \ln(+\sqrt{1 + e^x} + 1) $$
Where is the mistake hidden?
 [/INST] with $$t=\sqrt{1+e^x}$$ we get $$x=\ln(t^2-1)$$ and from here $$dx=\frac{2t}{t^2-1}dt$$ and our integral will be $$\int\frac{2t^2}{t^2-1}dt$$
</s>