Solving $\int\frac{\ln(1+e^x)}{e^x} \space dx$ I'm trying to solve this integral.
$$\int\frac{\ln(1+e^x)}{e^x} \space dx$$
I try to solve it using partial integration twice, but then I get to this point (where $t = e^x$ and $dx = \frac{1}{t} dt$):
$$\int\frac{\ln(1+t)}{t^2} \space dt = \frac{1}{t} \cdot \ln(1+t) - \frac{1}{t} \cdot \ln(1+t) + \int\frac{\ln(1+t)}{t^2} \space dt$$
$$\cdots$$
$$0 = 0$$
What am I doing wrong?

$$
\int\frac{\ln(1+e^x)}{e^x} \; dx = \overbrace{\int u\;dv = uv - \int v\;du}^\text{This is integration by parts.}
$$
where
$$
\begin{align}
u & = \ln(1+e^x), \qquad dv =\frac{dx}{e^x}  \\  \\  \\
du &= \frac{e^x}{1+e^x}\;dx, \qquad  v = \frac{-1}{e^x}
\end{align}
$$
So
$$
\begin{align}
& {} \qquad uv - \int v\;du
= \frac{\ln(1+e^x)}{e^x} - \int \frac{-dx}{1+e^x} = \frac{\ln(1+e^x)}{e^x} - \int \frac{-e^{-x}\;dx}{e^{-x}+1} \\  \\  \\
& = \frac{\ln(1+e^x)}{e^x} + \int \frac{e^{-x}\;dx}{e^{-x}+1}
= \frac{\ln(1+e^x)}{e^x} + \int \frac{dw}{w+1} \\  \\  \\
& = \frac{\ln(1+e^x)}{e^x} + \ln(w+1) + C = \frac{\ln(1+e^x)}{e^x} + \ln(e^{-x}+1) + C.
\end{align}
$$
Notice that
$$
\ln(e^{-x} + 1) = \ln\Big( e^{-x}(1+e^x) \Big) = \ln(e^{-x}) + \ln(1+e^x) = -x + \ln(1+e^x),
$$
so the bottom line can be expressed in that form as well.
