Partial integration of $e^x\ln(1+e^x)$ I am trying to solve
$$\int_0^1e^x\ln(1+e^x)dx.$$
I tried to do a partial integration $\displaystyle\left.e^x \ln(1+e^x)\right|_0^1- \int_0^1\frac{e^{2x}}{1+e^x}dx$ but this leaves me quite a bit from the correct answer which is $\displaystyle(1+e)\ln(1+e)-2\ln2-e+1$. Could anyone here help me, please? Thank you.
 A: HINT:
We can avoid Integration by Parts as follows:
Substitute $\displaystyle e^x+1=u\implies e^x dx=du$ and $x=0\iff u=2,x=1\implies u=\cdots$
A: Notice $$ \mathrm{d}(e^x + 1 ) = e^x dx $$ . Hence your integral become
$$ \int \ln(1 + e^x) \mathrm{d} (e^x  + 1 )  = (e^x+1)(\ln(1+e^x)) - \int ( e^x + 1) \frac{1}{e^x+1} e^xdx =(e^x+1)(\ln(1+e^x)) -e^x + K$$
A: Let $u=\ln(1+e^x)$, $du=\dfrac{e^x}{1+e^x}dx$, $dv=e^x\ dx$, and $v=e^x$, then
$$
\begin{align}
\int_0^1 e^x\ln(1+e^x)\ dx&=\left.e^x\ln(1+e^x)\right|_0^1-\int_0^1\dfrac{e^{2x}}{1+e^x}dx\\
&=e\ln(1+e)-\ln2-\int_0^1\dfrac{e^{2x}}{1+e^x}dx.
\end{align}
$$
To solve the RHS integral, let $u=e^x$ and $du=e^x\ dx$, then
$$
\begin{align}
\int_0^1\dfrac{e^{2x}}{1+e^x}dx&=\int_0^1\dfrac{e^{x}e^{x}}{1+e^x}dx\\
&=\int_{x=0}^1\dfrac{u}{1+u}du\\
&=\int_{x=0}^1\dfrac{1+u-1}{1+u}du\\
&=\int_{x=0}^1\ du-\int_{x=0}^1\dfrac{1}{1+u}du\\
&=u|_{x=0}^1-\ln(1+u)|_{x=0}^1\\
&=e^x|_{0}^1-\ln(1+e^x)|_{0}^1\\
&=e-1-\ln(1+e)+\ln 2.
\end{align}
$$
Thus
$$
\begin{align}
\int_0^1 e^x\ln(1+e^x)\ dx&=e\ln(1+e)-\ln 2-(e-1-\ln(1+e)+\ln 2)\\
&=e\ln(1+e)-\ln 2-e+1+\ln(1+e)-\ln 2\\
&=\ln(1+e)+e\ln(1+e)-\ln 2-\ln 2-e+1\\
&=\Large\color{blue}{(1+e)\ln(1+e)-2\ln 2-e+1}.
\end{align}
$$

$$\Large\color{blue}{\text{# }\mathbb{Q.E.D.}\text{ #}}$$
