# Find $\int{\frac{e^{2x}}{1+e^x}}dx$

Find $$\int{\frac{e^{2x}}{1+e^x}}dx$$

I did the following substitution: $$u=e^x\Rightarrow du=e^x dx\Rightarrow \int{\frac{u}{1+u}du}=\int1du-\int\frac{1}{u+1}du=u-\ln{u}=e^x-\ln{(e^x+1)}+C$$

I know this is the correct answer, however my initial approach was as follows: $$u=1+e^x\Rightarrow du=e^xdx$$ and $$e^x=u-1\Rightarrow \int\frac{u-1}{u}=\int1du-\int\frac{1}{u}du=u-\ln u=1+e^x-\ln (1+e^x)+C$$. Are these two answers equivalent due to the arbitrariness of the constant? Or is there an error in what I did in my substitution of $$u=1+e^x$$

• Yes, the constant $C$ completely absorbs the $1$... Aug 4, 2021 at 18:12
• How did you go from $e^{2 x}$ to just $u$ in the numerator?? Aug 4, 2021 at 19:28
• @DavidG.Stork since $e^2x = (e^x)^2$ then one of those gets taken care of with the $du = e^x dx$ and the other $e^x$ can be replaced with $u$ Aug 5, 2021 at 19:34

## 1 Answer

They are the same answer, for the reason that you have mentioned:$$1+e^x-\ln(1+e^x)+C=e^x-\ln(1+e^x)+C'$$if we take $$C'=C+1$$.