# Definite Integral: $\int_0^1\frac{\ln^4(x)}{x^2+1}\,dx$

I'm trying to derive a closed-form expression for

$$I=\int_0^1\frac{\ln^4(x)}{x^2+1}\,dx$$

Letting $u=-\ln(x), x=e^{-u}, dx=-e^{-u}\,du$ yields

$$I=\int_0^{\infty}\frac{u^4e^{-u}}{e^{-2u}+1}\,du$$

Setting $u\to-u$ and manipulating the integrands yield

$$I=-\int_0^{-\infty}\frac{u^4e^{u}}{e^{2u}+1}\,du$$ $$=\int_{-\infty}^0\frac{u^4e^{-u}}{e^{-2u}+1}\,du$$

And adding the two equivalent forms of $I$ yields

$$2I=\int_{-\infty}^{\infty}\frac{u^4e^{-u}}{e^{-2u}+1}\,du$$

I've tried to differentiate under the integral sign, but I could not find any parameterization that worked for me. (Perhaps someone could tell me how to solve such integrals by differentiation under the integral sign?)

My best attempt so far was using complex analysis:

I used a counterclockwise semicircle that grows to infinity over the lower half of the complex plane as my contour, and by Jordan's lemma (as I understand it) the integral over the arc vanishes and so I should be left with

$$\require{cancel} \lim_{R\to\infty} \int_R^{-R} \frac{x^4e^{-x}}{e^{-2x}+1}\,dx + \cancel{\int_{arc} \frac{z^4e^{-z}}{e^{-2z}+1}\,dz} = 2\pi i\sum_j \operatorname{Res}(j)$$

$$-2I=\int_{\infty}^{-\infty}\frac{x^4e^{-x}}{e^{-2x}+1}\,dx= 2\pi i\sum_j \operatorname{Res}(j)$$

Since my integrand only blows up when $e^{-2u}+1=0 \Rightarrow u=-i\pi/2$,

$$\frac{-2}{2\pi i}I=\operatorname{Res}(-i\pi/2)$$

$$\frac{i}{\pi} I = \lim_{z\to -i\pi/2}(z+i\pi/2)\frac{z^4e^{-z}}{e^{-2z}+1}$$

Evaluating the limit (via L'Hopital's Rule and a few substitutions) yields

$$\frac{i}{\pi}I = \frac{i\pi^4}{32}$$

$$I=\frac{\pi^5}{32}$$

However, WolframAlpha evaluates the integral at $$I=\frac{5\pi^5}{64}$$

Where did I make a mistake and how do I evaluate this integral correctly?

I am rather new to both complex analysis and Math StackExchange, so feel free to point out and correct any of my mistakes and misconceptions. Any help is greatly appreciated!

• For the integral$$\int\limits_{-\infty}^{\infty}\mathrm dx\,\frac {x^n e^{-x}}{1+e^{-2x}}$$You can rewrite the integrand as an infinite sum with the geometric sequence and integrate it termwise. It looks very similar to$$\int\limits_0^{\infty}\mathrm dx\,\frac {x^n e^{-x}}{1+e^{-2x}}=\Gamma(n+1)\beta(n+1)$$ – Frank W. Aug 24 '18 at 13:35
• Are you sure the integral over the arc vanishes? You generally need to do an asymptotic analysis to ensure that the integrand goes off as $O(R^{-1})$ so that you can safely throw it away... – Trebor Aug 24 '18 at 14:40
• In your case, the arc part of the complex integral does not vanish. Therefore you cannot apply that method here. – Trebor Aug 24 '18 at 14:46

An approach relying on Feynman's trick

Notice that one has: \begin{align} I:=\int^1_0 \frac{\ln^4(x)}{x^2+1}\,dx \stackrel{x\mapsto 1/x}{=} \int^\infty_1 \frac{\ln^4(x)}{x^2+1}\,dx \end{align} which means that: \begin{align} I = \frac 1 2 \int^\infty_0 \frac{\ln^4(x)}{x^2+1}\,dx \end{align} Define: \begin{align} G(z):=\int^\infty_0 \frac{x^{-z}}{x^2+1}\,dx \end{align} Notice by Feynman's trick one has: \begin{align} \frac 1 2 G^{(4)}(0) =I \end{align} So we only need to find $G(z)$ which is not very hard. You can see for example this post for a variety of solutions. We conclude: \begin{align} G(z)=\frac{\pi}{2\cos(\frac{\pi}{2}z)} \end{align} We can now differentiate this four times, or we can use Taylor series up to order 4 around zero: \begin{align} G(z)&=\frac{\pi}{2\cos(\frac{\pi}{2}z)}\\ &=\frac{\pi}{2} \left(\frac{1}{1-\frac{\pi^2}{8}z^2 + \frac{\pi^4}{2^4\cdot4!}z^4+O(z^5)}\right)\\ &=\frac{\pi}{2}\left[ 1+\left(\frac{\pi^2}{8}z^2 - \frac{\pi^4}{2^4\cdot 4!}z^4+O(z^5) \right) + \left(\frac{\pi^2}{8}z^2 - \frac{\pi^4}{2^4\cdot 4!}z^4+O(z^5) \right)^2+O(z^5)\right]\\ &=\frac{\pi}{2}+\frac{\pi^3}{16}z^2+\frac{5\pi^5}{32\cdot 4! }z^4+O(z^5)\\ \end{align} The coefficient of $z^4$ gives $4!G^{(4)}(0)$ hence: \begin{align} G^{(4)}(0) = \frac{\pi^55}{32 } \end{align} We conclude: \begin{align} I=\frac{5\pi^5 }{64} \end{align}

• Why don’t you just directly utilize the taylor series of secant around zero? – Szeto Aug 24 '18 at 15:40
• @Szeto to be honest, I don't know them. Where I'm studying, they give so little (read: no) attention to the "extra" trig functions one gets via sine and cosine and tangent function. I don't even know their names, let alone their Taylor series... – Shashi Aug 24 '18 at 15:49
• Anyway, still a splendid answer. I have upvoted. Great job! – Szeto Aug 24 '18 at 15:51
• @Szeto Thanks for the compliment. Have a nice day! – Shashi Aug 24 '18 at 15:52

I believe that the most simple approach is just to exploit Maclaurin series. Since $\int_{0}^{1}x^{2n}\log^4(x)\,dx=\frac{24}{(2n+1)^5}$ we have

$$\int_{0}^{1}\frac{\log^4(x)}{x^2+1}\,dx = 24\sum_{n\geq 0}\frac{(-1)^n}{(2n+1)^5}\color{red}{=}24\cdot\frac{5\pi^5}{1536} = \frac{5\pi^5}{64}.$$ It is well-known that the series $\sum_{n\geq 0}\frac{(-1)^n}{(2n+1)^{2m+1}}$ are related to Euler numbers.

• Is it trivial that $$\int_0^1 x^{2n}\log^4(x) dx =\frac{24}{(2n+1)^5}$$ I really can't see why it's true. – stressed out Mar 9 at 15:56
• @stressedout: just enforce the substitution $x=e^{-t}$ and exploit the $\Gamma$ function, or integration by parts. – Jack D'Aurizio Mar 9 at 16:58
• Thank you. Now I understand. – stressed out Mar 11 at 11:10

Let, for $n\geq 0$ integer,

\begin{align}&A_n=\int_0^1 \frac{\ln^{2n}x}{1+x^2}\,dx\\ &B_n=\int_0^\infty \frac{\ln^{2n}x}{1+x^2}\,dx\\ &K_n=\int_0^\infty\int_0^\infty\frac{\ln^{2n}(xy)}{(1+x^2)(1+y^2}\,dx\,dy \end{align}

Observe that,

\begin{align}A_0&=\int_0^1 \frac{1}{1+x^2}\,dx\\ &=\Big[\arctan x\Big]_0^1\\ &=\frac{\pi}{4}\end{align}

\begin{align}B_n=\int_0^1 \frac{\ln^{2n}x}{1+x^2}\,dx+\int_1^\infty \frac{\ln^{2n}x}{1+x^2}\,dx\\ \end{align}

Perform in the latter integral the change of variable $y=\dfrac{1}{x}$,

\begin{align}B_n=2A_n\end{align}

That is,

\begin{align}A_n=\frac{1}{2}B_n\end{align}

For $n\geq 0$ integer,

\begin{align}\int_0^\infty \frac{\ln^{2n+1}x}{1+x^2}\,dx=0\end{align}

(perform the change of variable $y=\dfrac{1}{x}$, and, $z=-z \iff z=0$ )

\begin{align}K_n&=\int_0^\infty\int_0^\infty\left(\sum_{k=0}^{2n}\binom{2n}{k}\frac{\ln^k x\ln^{2n-k}y}{(1+x^2)(1+y^2)} \right)\,dx\,dy\\ &=\sum_{k=0}^{2n}\binom{2n}{k}\left(\int_0^\infty\frac{\ln^k x}{1+x^2}\,dx\right)\left(\int_0^\infty\frac{\ln^{2n-k}y}{1+y^2} \,dy\right)\\ &=\sum_{k=0}^{n}\binom{2n}{2k}\left(\int_0^\infty\frac{\ln^{2k} x}{1+x^2}\,dx\right)\left(\int_0^\infty\frac{\ln^{2(n-k)}y}{1+y^2} \,dy\right)\\ &=\sum_{k=0}^{n}\binom{2n}{2k}B_kB_{n-k} \end{align}

Perform the change of variable $u=xy$,

\begin{align}K_n&=\int_0^\infty\int_0^\infty\frac{\ln^{2n}(xy)}{(1+x^2)(1+y^2)}\,dx\,dy\\ &=\int_0^\infty\int_0^\infty\frac{y\ln^{2n}(u)}{(y^2+u^2)(1+y^2)}\,du\,dy\\ &=\int_0^\infty\int_0^\infty\frac{\ln^{2n}(u)}{u^2-1}\left(\frac{y}{1+y^2}-\frac{y}{u^2+y^2}\right)\,du\,dy\\ &=\frac{1}{2}\int_0^\infty\int_0^\infty\frac{\ln^{2n}(u)}{u^2-1}\left[\frac{1+y^2}{u^2+y^2}\right]_{y=0}^{y=\infty}\,du\\ &=\int_0^\infty\frac{\ln^{2n+1}(u)}{u^2-1}\,du\\ &=\int_0^1\frac{\ln^{2n+1}(u)}{u^2-1}\,du+\int_1^\infty\frac{\ln^{2n+1}(u)}{u^2-1}\,du \end{align}

In the latter integral perform the change of variable $x=\dfrac{1}{u}$,

\begin{align}K_n&=2\int_0^1\frac{\ln^{2n+1}(x)}{x^2-1}\,dx\\ &=2\int_0^1\frac{\ln^{2n+1}(x)}{x-1}\,dx-2\int_0^1\frac{x\ln^{2n+1}(x)}{x^2-1}\,dx\\ \end{align}

In the latter integral perform the change of variable $u=x^2$,

\begin{align}K_n&=2\int_0^1\frac{\ln^{2n+1}(x)}{x-1}\,dx-\frac{1}{2^{2n+1}}\int_0^1\frac{\ln^{2n}(u)}{u-1}\,du\\ &=\left(2-\frac{1}{2^{2n+1}}\right)\int_0^1\frac{\ln^{2n+1}(x)}{x-1}\,dx\\ &=-\left(2-\frac{1}{2^{2n+1}}\right)\int_0^1 \ln^{2n+1}(x)\left(\sum_{k=0}^\infty x^k\right)\,dx\\ &=-\left(2-\frac{1}{2^{2n+1}}\right)\sum_{k=0}^\infty \left(\int_0^1 x^k \ln^{2n+1}(x)\,dx\right)\\ &=-\left(2-\frac{1}{2^{2n+1}}\right)\sum_{k=0}^\infty \frac{(-1)^{2n+1}(2n+1)!}{(k+1)^{2n+2}}\\ &=\left(2-\frac{1}{2^{2n+1}}\right)(2n+1)!\zeta(2n+2) \end{align}

Therefore,

\begin{align}\sum_{k=0}^{n}\binom{2n}{2k}B_kB_{n-k}&=\left(2-\frac{1}{2^{2n+1}}\right)(2n+1)!\zeta(2n+2)\end{align}

Therefore,

\begin{align}\boxed{\sum_{k=0}^{n}\binom{2n}{2k}A_kA_{n-k}=\frac{(2n+1)!}{2}\left(1-\frac{1}{2^{2n+2}}\right)\zeta(2n+2)}\end{align}

if $n=1$,

\begin{align} \frac{\pi}{2}A_1=\frac{45}{16}\zeta(4)\end{align}

if $n=2$,

\begin{align} \frac{\pi}{2}A_2+6A_1^2=\frac{945}{16}\zeta(6)\end{align}

therefore,

\begin{align} \boxed{A_2=\frac{945\zeta(6)}{8\pi}-\frac{6075\zeta(4)^2}{16\pi^3}}\end{align}

If you know that,

\begin{align}&\zeta(4)=\frac{1}{90}\pi^4\\ &\zeta(6)=\frac{1}{945}\pi^6 \end{align}

then,

\begin{align}\boxed{A_2=\frac{5}{64}\pi^5}\end{align}

A Complex-Analytic Proof

Your problem is that the integral does not vanish on the semicircular arc as the radius goes to infinity, and there are infinitely many poles that your contour will end up enclosing. I am offering a similar approach, but with a different contour that guarantees that it encloses only one pole, and that the un-needed terms vanish as the range expands.

Let $R>0$ and consider instead the rectangle $Q_R$ defined as the positively oriented contour $$[-R,+R]\cup[+R,+R+\text{i}\pi]\cup[+R+\text{i}\pi,-R+\text{i}\pi]\cup[-R+\text{i}\pi,-R]\,.$$ Define $$L_k:=\lim_{R\to\infty}\,\oint_{Q_R}\,f_k(z)\,\text{d}z\,,\text{ where }f_k(z):=z^k\,\left(\frac{\exp(z)}{\exp(2z)+1}\right)\,.$$ We shall attempt to determine the values of $L_k$ for $k=0,2,4$. Using the Residue Theorem, it is easy to see that $$L_k=2\pi\text{i}\,\text{Res}_{z=\frac{\text{i}\pi}{2}}\big(f_k(z)\big)\,,$$ so that $$L_0=\pi\,,\,\,L_2=-\frac{\pi^3}{4}\,,\text{ and }L_4=\frac{\pi^5}{16}\,.$$

Write $$J_k:=\int_{-\infty}^{+\infty}\,f_k(u)\,\text{d}u\,.$$ It is not difficult to show that $$L_0=2\,J_0\,,\,\,L_2=2\,J_2-\pi^2\,J_0\,,\text{ and }L_4=2\,J_4-6\pi^2\,J_2+\pi^4\,J_0\,.$$ Thus, we get $$J_0=\frac{\pi}{2}\,,\,\,J_2=-\frac{\pi^3}{8}+\frac{\pi^3}{4}=\frac{\pi^3}{8}\,,$$ and $$J_4=\frac{\pi^5}{32}+\frac{3\pi^5}{8}-\frac{\pi^5}{4}=\frac{5\pi^5}{32}\,.$$ Thus, $$I=\frac{1}{2}\,J_4=\frac{5\pi^5}{64}\,.$$ You can obtain $$I_k:=\int_0^\infty\,u^k\,\left(\frac{\exp(u)}{\exp(2u)+1}\right)\,\text{d}u$$ similarly for an even integer $k\geq 0$, by evaluating $L_0,L_2,L_4,\ldots,L_k$ and then solving for $J_0,J_2,J_4,\ldots,J_k$, as $I_k=\dfrac{1}{2}\,J_k$. From here, we can show that $$J_k=t_k\,\left(\frac{\pi^{k+1}}{2^{k+1}}\right)\text{ for all even integers }k\geq 0\,,$$ where $$t_k=\sum_{r=0}^{\frac{k}{2}-1}\,(-1)^r\,\binom{k}{2r+2}\,2^{2r+1}\,t_{k-2r-2}+(-1)^{\frac{k}{2}}\,.$$ For example, $t_0=1$, $t_2=1$, $t_4=5$, $t_6=61$, and $t_8=1385$.

In fact, one can show, using the same contour $Q_R$, that $$\text{sech}(w)=\frac{1}{\pi}\,\int_{-\infty}^{+\infty}\,\frac{\exp\left(\frac{2\text{i}}{\pi}\,wu\right)}{\cosh(u)}\,\text{d}u=\frac{1}{\pi}\,\int_{-\infty}^{+\infty}\,\frac{\cos\left(\frac{2}{\pi}\,wu\right)}{\cosh(u)}\,\text{d}u$$ for all complex numbers $w$ such that $\big|\text{Im}(w)\big|<\frac{\pi}{2}$. This shows that $t_k=(-1)^{\frac{k}{2}}\,E_k=|E_k|$ for every even integer $k\geq 0$, where $E_0,E_1,E_2,\ldots$ are Euler numbers. Therefore, $$\sum_{n=0}^\infty\,\frac{(-1)^n\,k!}{(2n+1)^{k+1}}={\small\int_0^\infty\,u^k\,\left(\frac{\exp(u)}{\exp(2u)+1}\right)\,\text{d}u}=I_k=\frac{1}{2}\,J_k=\frac{t_k}{2}\,\left(\frac{\pi}{2}\right)^{k+1}=\frac{|E_k|}{2}\,\left(\frac{\pi}{2}\right)^{k+1}$$ for each even integer $k\geq 0$.

In general, for $p\in\mathbb{C}$ and $q\in\mathbb{R}_{>0}$ such that $0<\text{Re}\left(p\right)<q$, we have \begin{align}\int_{-\infty}^{+\infty}\,\frac{u^k\,\exp(pu)}{\exp(qu)+1}\,\text{d}u&=k!\,\left(\frac{\pi}{q}\right)^{k+1}\,\Biggl(\left[a^k\right]\Bigg(\text{csc}\left(a+\frac{\pi p}{q}\right)\Bigg)\Biggr) \\ &=k!\,\left(\frac{\pi}{q}\right)^{k+1}\,\Biggl(\left[a^k\right]\Bigg(\text{sec}\left(a+\frac{\pi(2p-q)}{2q}\right)\Bigg)\Biggr)\,.\end{align} Here, $\left[a^k\right]\big(g(a)\big)$ is the coefficient of $a^k$ in the Laurent expansion of $g(a)$ about $a=0$.

• Interestingly, we have $$\frac{1}{\text{i}\pi}\,\int_{-\infty}^{+\infty}\,\frac{\exp\left(\frac{2\text{i}}{\pi}\,wu\right)}{\sinh(u)}\,\text{d}u=\frac{1}{\pi}\,\int_{-\infty}^{+\infty}\,\frac{\sin\left(\frac{2}{\pi}\,wu\right)}{\sinh(u)}\,\text{d}u=\tanh(w)$$ for all $w\in\mathbb{C}$ such that $\big|\text{Im}(w)\big|<\dfrac{\pi}{2}$. – Batominovski Sep 2 '18 at 13:09
• This gives \begin{align}\int_{-\infty}^{+\infty}\,\frac{u^k\,\exp(pu)}{\exp(qu)-1}\,\text{d}u&=k!\,\left(\frac{\pi}{q}\right)^{k+1}\,\Biggl(\left[a^k\right]\Bigg(\cot\left(a+\frac{\pi p}{q}\right)\Bigg)\Biggr)\\&=k!\,\left(\frac{\pi}{q}\right)^{k+1}\,\Biggl(\left[a^k\right]\Bigg(\tan\left(a+\frac{\pi (2p-q)}{2q}\right)\Bigg)\Biggr)\end{align} for $p\in\mathbb{C}$ and $q\in\mathbb{R}_{>0}$ such that $0<\text{Re}(p)<q$. – Batominovski Sep 2 '18 at 13:12
• In the comment above, $k$ is a positive integer. – Batominovski Sep 2 '18 at 13:24


\begin{align} I & \equiv \int_{0}^{1}{\ln^{4}\pars{x} \over x^{2} + 1}\,\dd x \\[5mm] & = {1 \over 4}\,\totald[4]{}{\nu}\bracks{\Psi\pars{{\nu \over 4} + {3 \over 4}} - \Psi\pars{{\nu \over 4} + {1 \over 4}}}\qquad \pars{~\Psi:\ Digamma\ Function~} \\[5mm] & = {1 \over 4}\pars{1 \over 4}^{4}\bracks{\Psi^{\pars{\texttt{IV}}}\pars{3 \over 4} - \Psi^{\pars{\texttt{IV}}}\pars{1 \over 4}} \\[5mm] & = {1 \over 1024}\, \left.\totald[4]{\bracks{\pi\cot\pars{\pi z}}}{z}\,\right\vert_{\ z\ =\ 1/4} \qquad\pars{~Euler\ Reflection\ Formula} \\[5mm] & = {1 \over 1024}\ \underbrace{\bracks{8\pi^{5}\cot^{3}\pars{\pi z}\csc^{2}\pars{\pi z} + 16\pi^{5}\cot\pars{\pi z}\csc^{4}\pars{\pi z}}_{\ z\ =\ 1/4}} _{\ds{80\pi^{5}}} \\[5mm] & = \bbx{5\pi^{5} \over 64} \approx 23.9078 \end{align}

You got to

$I=\int_0^\infty u^4e^{-u}(1+e^{-2u})^{-1}du$

which gives you

$I=\int_0^\infty u^4e^{-u}(1-e^{-2u}+e^{-4u}-e^{-6u}+...)du$

or

$I=\int_0^\infty u^4(e^{-u}-e^{-3u}+e^{-5u}-e^{-7u}+...)du$

From standard integration tables or integration by parts you should be able to get your answer ...