I have to find the indefinite integral: $\int \frac{1}{\sqrt{1+e^x}}\cdot dx$. I tried substituting $u=e^x$ and then $v=1+u$, and I find that $\int \frac{1}{\sqrt{v}}=2\sqrt{v}+c=2\sqrt{u+1}+c=2\sqrt{1+e^x}+c$. However, when I take the derivative of this, I get $\frac{e^x}{\sqrt{1+e^x}}$, so I know I must have made a mistake somewhere. What have I done wrong?
Thanks for your time.
You need to apply the substitution to $dx$ too:
We let $u=e^x$. Then ${du \over dx} = e^x$, so $dx = du \,e^{-x}$, i.e. $dx = {du \over u}$.