# How to evaluate the integral $\int_0^t\frac{xe^x}{1+e^x}\,dx$?

$$I=\int_0^t\frac{xe^x}{1+e^x}\,dx$$

I tried this method to solve this integral by using an operator y, so the integral could be formed as : $$I(y)=\int_0^t\frac{\partial}{\partial y}\ln{(1+e^{y x})}\,dx$$ Then we can write it as : $$I(y)=\frac{\partial}{\partial y}\int_0^t\ln{(1+e^{y x})}\,dx$$ We calculate the integral of $$\int_0^t\ln(1+e^{yx})\,dx$$ It would give us as we substitute $$u=e^{yx}$$ then we have $$du=ye^{yx}dx$$ so $$dx=\frac{du}{yu}$$ $$\frac{1}{y}\int_1^{e^{yt}}\frac{\ln(1+u)}{u}\,du$$ We substitute $$v=-u$$ $$dv=-du$$ $$-\frac{1}{y}\int_1^{e^{yt}}\frac{\ln(1-v)}{v}\,dv=-\frac{1}{y}\int_0^{e^{yt}}\frac{\ln(1-v)}{v}\,dv-\frac{1}{y}\pi^2\frac{1}{6}$$ Then we get $$\frac{1}{y}\operatorname{Li}_2(-e^{yt})-\frac{1}{y}\pi^2\frac{1}{6}$$ Intering the partial derivative $$I(y)=\frac{\partial}{\partial y}(\frac{1}{y}\operatorname{Li}_2(-e^{yt})-\frac{1}{y}\pi^2\frac{1}{6})$$

• What’s the context for this problem/where did you find it? These kind of integrals typically result in “polylogarithm” functions appearing in the answer. To avoid worrying about that, I would recommend trying to write the integrand in terms of a Taylor series, then integrating term-wise. Sep 18 at 22:12
• wolframalpha.com/input?i=integral+ln%281%2Be%5Ex%29dx Sep 18 at 22:16
• Using integration by parts with $f=\ln(1+e^x)$, we have $I=\int xf'=xf-\int f$. To find $\int f=\int\ln(1+e^x)\,dx$, substituting $u=-e^x$ gives $\int f=\int\frac{\ln(1-u)}u\,du=-\text{Li}_2(u)$, where Li$_2$ is the dilogarithm function. Sep 18 at 22:17

\begin{aligned} I & =\int \frac{x e^x}{1+e^x} d x \quad \textrm{ via IBP} \\ & =\int x d\left[\ln \left(1+e^x\right)\right] \\ & =x \ln \left(1+e^x\right)-\int \ln \left(1+e^x\right) d x\\& =x \ln \left(1+e^x\right)+\operatorname{Li}_2\left(-e^x\right) +C\quad \textrm{ via } y=e^{-x} \end{aligned}

Hence we have \begin{aligned} \int_0^t \frac{x e^x}{1+e^x} d x= & t \ln \left(1+e^t\right)+ \operatorname{Li}_2\left(-e^t\right)-\operatorname{Li}_2(-1) \\ = & t \ln \left(1+e^t\right)+ \operatorname{Li}_2\left(-e^t\right)+\frac{\pi^2}{12} \end{aligned}

\begin{align} \int_0^t\frac{xe^x}{1+e^x}dx&=\int_0^t\frac{x}{1+e^{-x}}dx\\ &=\int_0^t\sum_{n=0}^\infty (-1)^nxe^{-nx} dx\\ &=\int_0^t\left(x+\sum_{n=1}^\infty (-1)^nxe^{-nx}\right)dx\\ &=\frac{t^2}2+\sum_{n=1}^\infty(-1)^n\int_0^t xe^{-nx}dx\\ &=\frac{t^2}2+\sum_{n=1}^\infty(-1)^n\left(\left.-\frac1nxe^{-nx}\right\vert_0^t+\frac1n\int_0^t e^{-nx}dx\right)\\ &\stackrel{\large\color{red}{IBP}}{=}\frac{t^2}2+\sum_{n=1}^\infty(-1)^{n}\left(-\frac1n te^{-nt}-\left[\frac1{n^2}e^{-nx}\right]_0^t\right)\\ &=\frac{t^2}2+\sum_{n=1}^\infty(-1)^{n+1}\left(\frac1n te^{-nt}+\frac1{n^2}e^{-nt}-\frac1{n^2}\right)\\ &=\frac{t^2}2+t\sum_{n=1}^\infty\frac{(-1)^{n+1}}{n}(e^{-t})^n-\sum_{n=1}^\infty\frac{(-e^{-t})^n}{n^2}+\sum_{n=1}^\infty\frac{(-1)^{n}}{n^2}\\ &=\frac{t^2}2+t\ln(1+e^{-t})-\text{Li}_2(-e^{-t})+\text{Li}_2(-1)\\ &=-\frac{t^2}2+t\ln(1+e^{t})-\text{Li}_2(-e^{-t})-\frac{\pi^2}{12}\\ &\stackrel{\large*}{=}t\ln(1+e^{t})+\text{Li}_2(-e^{t})+\frac{\pi^2}{12} \end{align}

$$\color{red}{IBP}$$: Integration by parts

$$\text{Li}_2(s):$$ Dilogarithm

$$*: \text{Li}_2(z)+\text{Li}_2(z^{-1})=-\frac{\pi^2}{6}-\frac{\ln^2(-z)}{2}$$

$$I=\int_0^t\frac{xe^x}{1+e^x}\,dx$$

I tried this method to solve this integral by using an operator $$y$$, so the integral could be formed as : $$I(y)=\int_0^t\frac{\partial}{\partial y}\ln{(1+e^{y x})}\,dx$$ Then we can write it as : $$I(y)=\frac{\partial}{\partial y}\int_0^t\ln{(1+e^{y x})}\,dx$$ We calculate the integral of $$\int_0^t\ln(1+e^{yx})\,dx$$ Using integration by parts we get $$\int_0^t\ln(1+e^{yx})\,dx=x\ln(1+e^{yx})\rvert_0^t-y\int_0^t\frac{xe^{yx}}{1+e^{yx}}\,dx$$ $$y\int_0^t\frac{xe^{yx}}{1+e^{yx}}dx=x\ln(1+e^{yx})\rvert_0^t-\int_0^t\ln(1+e^{yx})\,dx$$ We put $$y=1$$ Then we have: $$\int_0^t\frac{xe^{x}}{1+e^{x}}dx=x\ln(1+e^{x})\rvert_0^t-\int_0^t\ln(1+e^{x})\,dx$$ $$\int_0^t\frac{xe^{x}}{1+e^{x}}dx=t\ln(1+e^{t})-\int_0^t\ln(1+e^{x})\,dx$$ The series expansion of $$ln(1-u)=-\sum_{n=1}^\infty\frac{u^n}{n}$$ $$\int_0^t\ln(1-(-e^{x}))\,dx=-\int_0^t\sum_{n=1}^\infty\frac{(-1)^n{e^x}^n}{n}\,dx=-\sum_{n=1}^\infty\frac{(-1)^n}{n}\int_0^t e^{xn}dx$$ We get $$-\sum_{n=1}^\infty\frac{(-1)^n}{n}\int_0^t e^{xn}dx=-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}e^{xn}\rvert_0^t$$ $$-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}e^{xn}\rvert_0^t=-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}(e^{nt}-1)$$ $$-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}(e^{nt}-1)=-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}e^{nt}+\sum_{n=1}^\infty\frac{(-1)^n}{n^2}$$ $$\int_0^t\ln(1-(-e^{x}))\,dx=-\sum_{n=1}^\infty\frac{(-1)^n}{n^2}e^{nt}+\sum_{n=1}^\infty\frac{(-1)^n}{n^2}$$ $$\int_0^t\ln(1-(-e^{x}))\,dx=-Li_2(-e^{t})-\frac{\pi^2}{12}$$ $$\int_0^t\frac{xe^{x}}{1+e^{x}}dx=t\ln(1+e^{t})-(-Li_2(-e^{t})-\frac{\pi^2}{12})$$ The solution is: $$\int_0^t\frac{xe^{x}}{1+e^{x}}dx=t\ln(1+e^{t})+Li_2(-e^{t})+\frac{\pi^2}{12}$$

• Is $+Li_2(-1)$ missing? Sep 20 at 14:43