TITLE: Evaluate $\int \ln(1 + e^x)\ \mathrm dx$
QUESTION [5 upvotes]: Evaluate the following indefinite integral.
$$\int\ln(1 + e^x) \mathrm dx$$
My attempt ::
Using integration by-parts,
\begin{align}
\int\ln(1 + e^x)\cdot 1\ \mathrm dx &= x\ln(1 + e^x) - \int \frac{x\cdot e^x\ \mathrm dx}{1 + e^x}\\
&= x\ln(1+e^x) - \frac{x^2\cdot e^x}{2(1+e^x)} + \int \frac{x^2\cdot e^x\ \mathrm dx}{2(1 + e^x)^2}\\
&= x\ln(1 + e^x) - \frac{x^2\cdot e^x}{2(1 + e^x)} + \frac{x^3\cdot e^x\ \mathrm dx}{6(1 + e^x)^2} - \int \frac{x^3 \cdot e^x(e^x-1)\ \mathrm dx}{6 (1+ e^x) ^3}\\
&= x\ln(1 + e^x) - \frac{x^2\cdot e^x}{2(1 + e^x)} + \frac{x^3\cdot e^x\ \mathrm dx}{6(1 + e^x)^2} - \frac{x^4\cdot e^x(e^x - 1)}{24(1 +  e^x)^3}\\ &+ \int \frac{x^4 \cdot e^x(e^{2x} + e^x+1)\ \mathrm dx}{24 (1+ e^x) ^3}\\
&= \lim_{N \to \infty} \sum_{n=1}^N\left( \frac{x^n}{n!}\frac{\mathrm d^n}{\mathrm dx^n}\Big(\ln(1 + e^x)\Big)\right)
\end{align}
Obviously, this is a dead end (applicable for all n-differentiable functions) and I'm just not capable of finding the actual answer. Please educate me on how to properly do this integral.

REPLY [7 votes]: Let $$\mathcal{ I}=\int \ln(1 + e^x)\ \mathrm dx$$
By substituting $e^x=-t\iff e^x\,\mathrm dx=\dfrac{\mathrm dt}{t}$
$$\begin{align}
\mathcal{ I}
&=\int \frac{\ln(1 -t)}{t}\ \mathrm dt
=-\int \frac{1}{t}\sum_{n=1}^{\infty}\frac{t^n}{n}\ \mathrm dt
=-\int \sum_{n=1}^{\infty}\frac{t^{n-1}}{n}\ \mathrm dt\\
&=-\sum_{n=1}^{\infty}\int \frac{t^{n-1}}{n}\ \mathrm dt
=-\sum_{n=1}^{\infty}\frac{t^{n}}{n^2}
=-\text{Li}_2\left(t\right)
=-\text{Li}_2\left(-e^x\right)\\
\end{align}$$

$\text{Explanations}$
$$\ln(1-t)=-\sum_{n=1}^{\infty}\frac{t^n}{n}$$
$$
\operatorname{Li}_s(z) = \sum_{k=1}^\infty {z^k \over k^s} = z + {z^2 \over 2^s} + {z^3 \over 3^s} + \cdots \
$$