How does $\int \frac{1}{e^x +1} dx$ become $\ln{\big( \frac{1+e^x}{2} \big)} +1 -x $? I'm solving the equation $(1+e^x)yy'=e^{y}$ with the constraint $y(0)=0$. I've got pretty far but I'm struggling in the last part. I got stuck solving this integral: $$\int \frac{1}{e^x +1} dx $$ which is $x-\ln{|1+e^x|}$ but in order to satisfy the constraint I need to make it $\ln{\big( \frac{1+e^x}{2} \big)} +1 -x $.
How does $\int \frac{1}{e^x +1} dx$ become $\ln{\big( \frac{1+e^x}{2} \big)} +1 -x $?
 A: Let $u=e^x+1$ then $du=e^x dx$ or $du/(u-1)=dx$ so the integral becomes
$$\int \frac{1}{u(u-1)}du=\int \frac1u-\frac{1}{u-1}du.$$
Can you finish?
A: We have the differential equation:

$$(1+e^x)yy'=e^y\quad;\ y(0)=0$$

Separating the variables (and integrating):
$$\begin{align}
\int ye^{-y}\;\mathrm{d}y&=\int \frac{\mathrm{d}x}{(1+e^x)}\\[2ex]
-e^{-y}(y+1)&=\underbrace{\int \frac{\mathrm{d}x}{(1+e^x)}}_{\text{I}_2}\tag{integrating LHS by-parts}\label{1} \\[2ex]
\text{I}_{2}&=\int \frac{\mathrm{d}x}{(1+e^x)}\\[2ex]\\[2ex]
&=\int \frac{e^x\; \mathrm{d}x}{(e^x+e^{2x})}\\[2ex]
\text{Take $t= e^x$}\\[2ex]
\text{I}_2&=\int \frac{\mathrm{d}t}{t+t^2}\\[2ex]
&=\int \frac{\mathrm{d}t}{t(t+1)}\\[2ex]
&=\int \frac 1t -\frac{1}{t+1} \mathrm{d}t \\[2ex]
&=\ln\left(\frac{t}{t+1}\right)+C\\[2ex]
\implies\text{I}_2&=\ln\left(\frac{e^x}{e^x+1}\right)+C\\[2ex]
\implies -e^{-y}(y+1)&=\ln\left(\frac{e^x}{e^x+1}\right)+C\\[2ex]
y(0)=0\implies C&=\ln 2-1\\[2ex]
\implies e^{-y}(y+1)&=\ln\left(\frac{e^x+1}{2}\right)+1-x
\end{align}$$
