## General formula for an integral involving powers of logarithms

$$\int\limits_0^1 \dfrac{\log^{m} (1+x)\log^n x}{x}\; dx = (-1)^{n+1}(n!) (m)! \sum_{\{m-1\}} \sum_{k=1}^\infty \frac{(-1)^k}{k^{n+2}} \prod^{l’}_{j=1}\frac{(-1)^{i_j}}{(i_j)!} \left( \frac{H_{k-1}^{(r_j)}}{r_j}\right)^{i_j}$$

$$\textit{solution}$$

Stirling numbers of the first kind might be useful here, Consider

$$m! \sum_{k=m}^\infty (-1)^{k-m} \left[k\atop m\right] \frac{x^k}{k!} = \log^m(1+x)$$

$$\int\limits_0^1 \dfrac{\log^m (1+x)\log^n x}{x}\; dx = m! \sum_{k=m}^\infty (-1)^{k-m} \left[k\atop m\right] \frac{1}{k!} \int^1_0 x^{k-1} \log^n(x)\,dx$$

Now it is easy to see that

$$\int^1_0 x^{k-1} \,dx = \frac{1}{k}$$

By differentiation $n$ times with respect to $k$

$$\int^1_0 x^{k-1} \log^n(x)\,dx = (-1)^n\frac{n!}{k^{n+1}}$$

Substituting back we have

$$\int\limits_0^1 \dfrac{\log^m (1+x)\log^n x}{x}\; dx =(m!)(n!) \sum_{k=m}^\infty (-1)^{k-m+n} \left[k\atop m\right] \frac{1}{k!\, k^{n+1}}$$

Now the Striling numbers could related to Euler sums through equations like

$$\frac{\left[k\atop 3\right]}{k!} =\frac{ (H_{k-1})^2-H^{(2)}_{k-1}}{2k}$$

and

$$\frac{\left[k\atop 4\right]}{k!} =\frac{ (H_{k-1})^3-3H^{(2)}_{k-1}H_{k-1}+2H^{(3)}_{k-1}}{6k}$$

Case $m=2 , n=2$

$$\int\limits_0^1 \dfrac{\log^2 (1+x)\log^2 x}{x}\; dx =4 \sum_{k=2}^\infty (-1)^{k} \left[k\atop 2\right] \frac{1}{k!\, k^{3}}$$

Note that

$$\frac{\left[k\atop 2\right]}{k!} = \frac{H_{k-1}}{k}$$

Hence we deduce that

$$\int\limits_0^1 \dfrac{\log^2 (1+x)\log^2 x}{x}\; dx =4 \sum_{k=2}^\infty (-1)^{k} \frac{H_{k-1}}{\, k^{4}}$$

Note that

\begin{align} \sum_{k=2}^\infty (-1)^{k} \frac{H_{k-1}}{\, k^{4}} &=\sum_{k=2}^\infty (-1)^{k} \frac{H_{k}}{ k^{4}} -\sum_{k=2}^\infty (-1)^{k} \frac{1}{ k^{5}} \\ &=\sum_{k=1}^\infty (-1)^{k} \frac{H_{k}}{ k^{4}} -\sum_{k=1}^\infty (-1)^{k} \frac{1}{ k^{5}}\\ &= \frac{\zeta(2) \zeta(3)}{2} – \frac{ 29\zeta(5)}{32} \end{align}

We deduce that

$$\boxed{\int\limits_0^1 \dfrac{\log^2 (1+x)\log^2 x}{x}\; dx = 2\zeta(2) \zeta(3)- \frac{ 29}{8}\zeta(5)}$$

This implies we can represent the special case $m=2$

$$\int\limits_0^1 \dfrac{\log^2 (1+x)\log^n x}{x}\; dx =2 (-1)^n(n!) \left[ \sum_{k=1}^\infty (-1)^{k} \frac{H_k}{ k^{n+2}} + \left(1-2^{-n-2} \right) \zeta(n+3) \right]$$

General formula in terms of nonlinear Euler sums

Define $\{ m\}$ as the $l$ partitions of $m$ where $m = i_1r_1+\cdots i_l r_l$

$$\frac{1}{(m+1)!} \log^{m+1}(1+x) =\sum_{\{m\}} \sum_{k=1}^\infty \prod^l_{j=1}\frac{(-1)^{i_j+1}}{(i_j)!} \left( \frac{H_{k-1}^{(r_j)}}{r_j}\right)^{i_j} \frac{(-x)^k}{k}$$

Substitute back in the integral

$$\int\limits_0^1 \dfrac{\log^{m} (1+x)\log^n x}{x}\; dx = (-1)^{n+1}(n!) (m)! \sum_{\{m-1\}} \sum_{k=1}^\infty \frac{(-1)^k}{k^{n+2}} \prod^{l’}_{j=1}\frac{(-1)^{i_j}}{(i_j)!} \left( \frac{H_{k-1}^{(r_j)}}{r_j}\right)^{i_j}$$

Reference

https://arxiv.org/pdf/math/0607514.pdf

## Multiple integral related to Euler sums

Posted by Cornel Ioan Valean on Facebook

Show that
$$\small \int^1_0 \cdots \int^1_0 \frac{\mathrm{d}\varphi_1\cdots \mathrm{d}\varphi_5}{(\varphi_1+\varphi_2+\varphi_3+\varphi_4+\varphi_5+1)(\varphi_1+\varphi_2+\varphi_3+\varphi_4+\varphi_5+1)} = \frac{59}{32}\zeta(5)-\frac{1}{2}\zeta(2)\zeta(3)$$

$$\textit{proof}$$

Consider the integral
$$I = \int^1_0 \cdots \int^1_0 \frac{\mathrm{d}\varphi_1\cdots \mathrm{d}\varphi_5}{(\varphi_1+\varphi_2+\varphi_3+\varphi_4+\varphi_5+1)(\varphi_1+\varphi_2+\varphi_3+\varphi_4+\varphi_5+1)}$$

Use the series expansion
$$I = \sum_{n=0}^\infty \sum_{k=0}^\infty \frac{(-1)^{n+k}}{n+1} \int^1_0\cdots \int^1_0 (\varphi_1\cdots \varphi_4)^{n+k}\,\mathrm{d}\varphi_1\cdots \mathrm{d}\varphi_5$$

Which reduces to
$$I = \sum_{n=0}^\infty \sum_{k=0}^\infty \frac{(-1)^{n+k}}{n+1} \left( \int^1_0 \varphi^{n+k}\,\mathrm{d}\varphi\right)^4$$

Hence we have the sum
\begin{align}I= \sum_{n=0}^\infty \frac{(-1)^n}{n+1} \sum_{i=n}^\infty \frac{(-1)^{i-n}}{(i+1)^4} &=\sum_{n=0}^\infty \frac{1}{(n+1)} \sum_{i=n}^\infty \frac{(-1)^{i}}{(i+1)^4} \\ &= \sum_{i=0}^\infty \frac{(-1)^i}{(i+1)^4}+\sum_{n=1}^\infty \frac{1}{(n+1)} \sum_{i=n}^\infty \frac{(-1)^{i}}{(i+1)^4} \\ &= \sum_{i=0}^\infty \frac{(-1)^{i}}{(i+1)^4} \sum_{n=0}^i\frac{1}{(n+1)}\\ &= \sum_{i=0}^\infty \frac{(-1)^{i}H_{i+1}}{(i+1)^4}\\&= \sum_{k=1}^\infty\frac{(-1)^{k+1} H_k}{k^4} \\&=\frac{59}{32}\zeta(5)-\frac{1}{2}\zeta(2)\zeta(3) \end{align}

## Contour method for shifted logarithm branch

Prove  $a,b,c,d >0$

$$\int^\infty_0 \frac{\log(a^2+b^2x^2)}{c^2+d^2x^2}\,dx = \frac{\pi}{cd} \log \frac{ad+bc}{d}$$

Consider the function

$$f(z) = \frac{\log(a-ibz)}{c^2+d^2z^2}$$

We need the logarithm with the branch cut $y<-\frac{a}{b} , x =0$ . Note that this corresponds to

$$\log(a+ibz) = \log\sqrt{(a+y)^2+b^2x^2}+i\theta \,\,\,\, , \, \theta \in [-\frac{\pi}{2},\frac{3\pi}{2})$$

Consider the contour that avoids the branch-cut on the negative imaginary part

$$\int_{C_{\rho}}f(z)\,dz+\int^\rho_0\frac{\log(a-ibx)}{c^2+dx^2}\,dx+\int_{-\rho}^0\frac{\log(a-ibx)}{c^2+dx^2}\,dx =2\pi i\, \mathrm{Res}\left(f,\frac{c}{d}i \right)$$

The second integral $x \to -x$

$$\int_{C_{\rho}}f(z)\,dz+\int^\rho_0\frac{\log(a-ibx)}{c^2+dx^2}\,dx+\int_{0}^{\rho}\frac{\log(a+ibx)}{c^2+dx^2}\,dx =2\pi i\, \mathrm{Res}\left(f,\frac{c}{d}i \right)$$

Note that in the x-axis we have

$$\log(a \pm bix)= \log(\sqrt{a^2+b^2x^2})\pm i\arctan\left(\frac{bx}{a} \right)$$

Using that we deduce

$$\log(a – bix)+\log(a+ibx)= \log(a^2+b^2x^2)$$

This implies to

$$\int_{C_{\rho}}f(z)\,dz+\int^\rho_0\frac{\log(a^2+b^2x^2)}{c^2+dx^2}\,dx =2\pi i\, \mathrm{Res}\left(f,\frac{c}{d}i \right)$$

For the circular part

$$\left|\int_{C_{\rho}} \frac{\log(a-ibz)}{c^2+d^2z^2} \,dz\right|\leq \pi \rho \, \frac{\log( a+ b \rho) + 2\pi }{|c^2-d^2 \rho^2|} \sim_{\infty} 0$$

Let us look at the residue

$$2\pi i\mathrm{Res}\left(f,\frac{c}{d}i \right) = 2\pi i\lim_{z \to \frac{c}{d}i} \frac{\log(a-ibz)}{2d^2 z} = \frac{\pi}{cd} \log \frac{ad+bc}{d}$$

Hence this simplifies to

$$\boxed{\int^\infty_0 \frac{\log(a^2+b^2x^2)}{c^2+dx^2}\,dx =\frac{\pi}{cd} \log \frac{ad+bc}{d}}$$

## Solving Euler sums using Contour integration

Prove that

$$\sum_{n=1}^\infty \frac{H_n}{n^2} = 2\zeta(3)$$

$$\textit{proof}$$

Consider the function

$$f(z) = \frac{(\psi(-z)+\gamma)^2}{z^2}$$

Note that $f$ has poles at non-negative integers

By integration around a large circle $|z| = \rho$

Note that

$$\oint f(z)\,dz = 2\pi i(\mathrm{Res}(f,0)+\sum_{n=1}^\infty \mathrm{Res}(f,n))$$

The integration around the circle

$$\left|\int_{|z|=\rho}\frac{(\psi(-z)+\gamma)^2}{z^2}\,dz \right| \leq 2\pi\frac{(|\psi(-z)|+|\gamma|)^2}{\rho}$$

As $|z| \to \infty$ we have $\psi(-z) \sim \log(-z)$ and the principle logarithm

$$\left|\int_{|z|=\rho}\frac{(\psi(-z)+\gamma)^2}{z^2}\,dz \right| \leq 2\pi\frac{(|\log(-z)|+|\gamma|)^2}{\rho}\leq 2\pi\frac{(|\log(\rho)|+2\pi +|\gamma|)^2}{\rho} \sim_{\infty} 0$$

We deduce that

$$2\pi i(\mathrm{Res}(f,0)+\sum_{n=1}^\infty \mathrm{Res}(f,n)) = 0$$

By expansion near $z=0$

$$\frac{(\psi(-z)+\gamma)^2}{z^2} \approx \frac{1}{z^2}-2\frac{\zeta(2)}{z^2}-2\frac{\zeta(3)}{z}$$

Which implies that

$$\mathrm{Res}(f,0) = -2\zeta(3)$$

For the residues at non-negative integers, the expansions

$$\frac{1}{z^2} = \sum_{j=0}^\infty (-1)^j{j+1 \choose 1} \frac{(z-n)^j}{n^{2+j}}$$

$$\psi(-z)+\gamma = \frac{1}{z-n}+H_n+\sum_{k=1}^\infty ((-1)^kH^{(k+1)}_n-\zeta(k+1))(z-n)^k$$

This implies that

$$(\psi(-z)+\gamma )^2 \approx \frac{1}{(z-n)^2}+2 \frac{H_n}{(z-n)}$$

This implies the residue

$$\mathrm{Res}(f,n) = 2\frac{H_n}{n^2}-\frac{2}{n^3}$$

That implies

$$2\sum_{n=1}^\infty \frac{H_n}{n^2}-\frac{1}{n^3} – 2\zeta(3) =0$$

Hence

$$2\sum_{n=1}^\infty \frac{H_n}{n^2} = 4\zeta(3)$$

Hence we reach the result

$$\boxed{\sum_{n=1}^\infty \frac{H_n}{n^2} = 2\zeta(3)}$$

Euler Sums and Contour Integral Representations

## Integral of rational function with cosine hyperbolic function using rectangle contour

$$\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2) }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy=\frac{2}{\pi^3}\left(\pi \cosh\left(\frac{\pi}{4} \right)-4\sinh\left( \frac{\pi}{4}\right) \right)$$

$$\textit{proof}$$

Consider
$$f(z) = \frac{\sinh(z)}{z \sinh^3(z-\pi/4)}$$

If we integrate around a contour of height $\pi$ and stretch it to infinity we get

By taking $T \to \infty$

$$\color{red}{\int^{i\pi/2+\infty}_{-i\pi/2+\infty}f(x)\,dx}+\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}f(x)\,dx}+\\\color{red}{\int^{-i\pi/2-\infty}_{i\pi/2-\infty}f(x)\,dx}+ \color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}f(x)\,dx} = 2\pi i \mathrm{Res}(f,\frac{\pi}{4})$$

Consider

$$\color{blue}{\int^{-i\pi/2+\infty}_{-i\pi/2-\infty}\frac{\sinh(x)}{x \sinh^3(x-\pi/4)}\,dx}$$

Let $x = -\pi/2i+\pi/4+y$

$$-\int^{\infty}_{-\infty}\frac{1}{-i\pi/2+\pi/4+y}\frac{\cosh(\pi/4+y)}{ \cosh^3(y)}\,dy$$
———-
Similarly we have for

$$\color{blue}{\int^{i\pi/2-\infty}_{i\pi/2+\infty}\frac{\sinh(x)}{x \sinh^3(x-\pi/4)}\,dx}$$

By letting $x =i\pi/2+\pi/4+ y$

$$\int^{\infty}_{-\infty}\frac{1}{i\pi/2+\pi/4+y}\frac{\cosh(\pi/4+y)}{ \cosh^3(y)}\,dy$$
———-
The other integrals go to 0 hence

$$-16 \pi i\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2) }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy =2\pi i \mathrm{Res}(f,\frac{\pi}{4})$$

Calculating the residue we have

$$-16 \pi i\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2) }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy = 2\pi i\frac{-(16 (π \cosh(π/4) – 4 \sinh(π/4))}{π^3}$$

Which reduces to our result

$$\int^{\infty}_{-\infty} \frac{1}{(5 \pi^2 + 8 \pi y + 16y^2) }\frac{\cosh\left(y+\frac{\pi}{4} \right)}{\cosh^3(y)}dy=\frac{2}{\pi^3}\left(\pi \cosh\left(\frac{\pi}{4} \right)-4\sinh\left( \frac{\pi}{4}\right) \right)$$

## Euler reflection formula proof using contour integration

$$\int_{0}^{\infty}\frac{x^{\alpha}}{x+1}\,dx=- \pi \csc(\pi \alpha)$$

$$\textit{proof}$$

Consider the following function

$$f(z) = \frac{z^{\alpha}}{1+z} = \frac{e^{\alpha \log(z)}}{1+z}$$

As we know the function $\log(z)$ is multi-valued defined as

$$\log(z) = \ln|z|+i\theta +2k\pi i$$

This maps the complex plain more than once in order to restrict it and make use of the integration path we set

$$\log(z) = \ln|z|+i\theta \,,\, \theta \in[0,2\pi)$$

This function is single-valued and on the integration path we have

$$e^{\alpha \log(z)} =x^{\alpha} e^{i\theta \alpha}= \begin{cases} x^{\alpha} & \theta \to 0\\ x^{\alpha} e^{2 \pi \alpha i} & \theta \to 2\pi \end{cases}$$

Integrating around the following contour

By the residue theorem we have

$$\oint f(z) \,dz = 2\pi i\, \mathrm{Res}(f,-1)$$

Which becomes

$$\int_{C_{\rho}}f(z)\,dz + \int_{C_{\epsilon}}f(z)\,dz+\int_{\epsilon}^{\rho}f(z)dz-\int_{\epsilon}^{\rho}f(z)dz =2\pi i\, \mathrm{Res}(f,-1)$$

By the chosen branch of the algorithm we have

$$\int_{C_{\rho}}f(z)\,dz + \int_{C_{\epsilon}}f(z)\,dz+\int_{\epsilon}^{\rho}\frac{x^{\alpha}}{x+1}\,dx-e^{2\pi i \alpha}\int_{\epsilon}^{\rho}\frac{x^{\alpha}}{x+1}\,dx =2\pi i\, \mathrm{Res}(f,-1)$$

Note for the circle $|z| = \rho$ we have

$$\left| \oint_{|z|=\rho}f(z) \,dz \right| \leq 2\pi \rho\, \mathrm{max}\left| \frac{ z^{\alpha}}{1+z}\right|\leq 2\pi \rho \frac{|z|^{\alpha}}{||z|-1|} =2\pi \frac{{\rho}^{\alpha +1}}{|\rho -1|}$$

Note the triangle inequality

$$|\omega +1 | \geq ||\omega |-|1||$$

and the ML inequality

$$\left| \int_{\Gamma}f(z)\,dz\right| \leq M \,l(\Gamma)\,\,, \, M = \mathrm{max}(|f|)$$

Note that if $-1 <\alpha < 0$  we get

$$\left| \lim_{\rho \to \infty}\oint_{|z|=\rho}f(z) \,dz \right| \leq 2\pi \frac{{\rho}^{\alpha +1}}{|\rho -1|} \to 0$$

Similarly we have

$$\left| \lim_{\epsilon\to 0}\oint_{|z|=\epsilon}f(z) \,dz \right| \leq 2\pi \frac{{\epsilon}^{\alpha +1}}{|\epsilon -1|} \to 0$$

We deduce that as $\epsilon \to 0$ and $\rho \to \infty$

$$(1-e^{2\pi i \alpha})\int_{0}^{\infty}\frac{x^{\alpha}}{x+1}\,dx =2\pi i\, \mathrm{Res}(f,-1) \,\,\, , \, -1 < \alpha < 0$$

Notice that

$$\mathrm{Res}(f,-1) = \lim_{z \to -1} e^{\alpha \log(z)} = e^{\alpha (\ln|-1|+ \pi i )} = e^{\alpha \pi i}$$

Hence we have

$$\int_{0}^{\infty}\frac{x^{\alpha}}{x+1}\,dx =2\pi i\,\frac{ e^{\alpha \pi i}}{1-e^{2\alpha \pi i}} = \frac{2\pi i}{e^{-\pi i \alpha }-e^{\pi i \alpha }} =- \pi \csc(\pi \alpha)$$

Note we can deduce the Euler reflection formula

$$\Gamma(\alpha)\Gamma(1-\alpha) = \pi \csc(\pi \alpha)$$

## Solving an integral using Dogbone contour

Prove that

$$\int^{1}_{0} \sqrt{x}\sqrt{1-x}\,dx = \frac{\pi}{8}$$

$$\textit{proof}$$

Consider the function

$$f(z) = \sqrt{z-z^2} = e^{\frac{1}{2}\log(z-z^2)}$$

Consider the branch cut on the x-axis
$$x(1-x)\geq 0\,\, \implies \, 0\leq x \leq 1$$

Consider $w= z-z^2$ then

$$\log(w) = \log|w|+i\theta,\,\, \theta\in[0,2\pi)$$

Consider the contour

Consider the integral

$$\int_{c_0}f(z)\,dz+\int_{c_1}f(z)\,dz+\int^{1-\epsilon}_{\epsilon} e^{\frac{1}{2}\log|x-x^2|}\,dx-\int^{1-\epsilon}_{\epsilon} e^{\frac{1}{2}\log|x-x^2| +\pi i}\,dx = 2\pi i \mathrm{Res}(f,\infty)$$

Consider the Laurent expansion of

$$\sqrt{z-z^2} =i \sqrt{z^2} \sqrt{1-\frac{1}{z}}= iz\sum_{k=0}^\infty{\frac{1}{2} \choose k} \left(-\frac{1}{z} \right)^k$$

Hence we deuce that

$$\mathrm{Res}(f,\infty) = -\frac{i}{8}$$

That implies

$$\int_{c_0}f(z)\,dz+\int_{c_1}f(z)\,dz+2\int^{1-\epsilon}_{\epsilon} \sqrt{x}\sqrt{1-x}\,dx = \frac{\pi}{4}$$

Consider the indented circle around $z=0$

$$\left| \int^{2\pi-\epsilon}_{\epsilon} e^{\frac{1}{2}\log(re^{i\theta}-r^2e^{2i\theta})} ir e^{i\theta}\,d\theta \right| \leq r \int^{2\pi-\epsilon}_{\epsilon} e^{\frac{1}{2}\log|re^{i\theta}-r^2e^{2i\theta}|} \,d\theta = r^{\frac{3}{2}} \int^{2\pi-\epsilon}_{\epsilon} e^{\frac{1}{2}\log|1-re^{i\theta}|} \,d\theta \to 0$$

Similarly for the contour around 1. Finally we get

$$\int^{1}_{0} \sqrt{x}\sqrt{1-x}\,dx = \frac{\pi}{8}$$

## Contour integraion of a rational function of logarithm and exponential

$$\int_{0}^\infty \frac{\log(x)\cos(x)}{(x^2+1)^2}\,dx = – \frac{\pi \mathrm{Ei}(1)}{4e}-\frac{\pi}{4e}$$

$$\textit{proof}$$

Consider the following function

$$f(z) = \frac{\log(z) }{(z^2+1)^2}e^{iz}$$

Now consider the principle logarithm where

$$\log(z) = \log|r|+i \theta \,\,\, , \theta \,\in (-\pi , \pi]$$

Consider the following contour

Then by the residue theorem
$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+\int_{r}^R \frac{\log(x) }{(x^2+1)^2}e^{ix}\,dx+\int_{-R}^{-r} \frac{(\log|x|+\pi i) }{(x^2+1)^2}e^{ix}\,dx\\ = 2\pi \,i\mathrm{Res}_{ i} f(z)$$

Which simplifies to

$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+\int_{r}^R \frac{\log(x) }{(x^2+1)^2}e^{ix}\,dx+\int_{r}^{R} \frac{(\log(x)+\pi i) }{(x^2+1)^2}e^{-ix}\,dx\\ = 2\pi i\mathrm{Res}_{ i} f(z)$$

Or

$$\small \int_{C_R}f(z)\,dz+\int_{c_r}f(z)\,dz+2\int_{r}^R \frac{\cos(x) \log(x)}{(x^2+1)^2}\,dx+\pi i \int_{r}^{R} \frac{e^{-ix}}{(x^2+1)^2}\,dx \\= 2\pi i\mathrm{Res}_{ i} f(z)$$
Note that for the semi-circle

$$M_R= \mathrm{max}_{\theta \in [0,\pi]}\left| \frac{\log(R)+i\theta }{(R^2e^{2 i\theta}+1)^2}\right|\leq \frac{\log R+ \pi}{|R^2 e^{2 i\theta}+1|} \to 0$$

It follows by the Jordan’s lemma that

$$\lim_{R\to \infty} \int_{C_R}f(z)\,dz =0$$

For the smaller semi-circle

$$\int_{c_r}f(z)\,dz = ir\int^{\pi}_0 \frac{\log r +i \pi }{(r^2e^{2i\theta}+1)^2}e^{r e^{i \theta}}e^{i\theta}\,d\theta$$

Note that

$$\left| \frac{\log r +i \pi }{(r^2e^{2i\theta}+1)^2}e^{r ie^{i \theta}}\right|\leq \frac{(\log r + \pi)(e^{r}+1) }{|r^2e^{2i\theta}+1|}\leq M_r$$

By the ML inequality we have

$$\lim_{r \to 0}\left| \int_{c_r}f(z)\,dz \right|\leq \lim_{r \to 0} \pi r M_r \to 0$$

It follows then

$$2\int_{0}^\infty \frac{\cos(x) \log(x)}{(x^2+1)^2}\,dx+\pi i \int_{0}^\infty \frac{e^{-ix}}{(x^2+1)^2}\,dx = 2\pi i\mathrm{Res}_{ i} f(z)$$

Evaluating the residue

$$\mathrm{Res}_{i} f(z) = \lim_{z \to i} \frac{d}{dz}\left( (z-i)^2 \frac{\log(z) }{(z^2+1)^2}e^{iz}\right)=\frac{\pi +i}{4e}$$

Note that

$$\int_{0}^\infty \frac{e^{ix}}{(x^2+1)^2}\,dx=\frac{\pi}{2e}-i \frac{\mathrm{Ei}(1)}{2e}$$

Since

$$2\int_{0}^\infty \frac{\cos(x)}{(x^2+1)^2}\,dx = 2\pi i\left( \frac{-i}{2e}\right)$$

By integrating around a semi-circle in the upper half plane

$$\int_{0}^\infty \frac{\cos(x)}{(x^2+1)^2}\,dx = \frac{\pi}{2e}$$

For the other integral, It is easy to see that

$$\int_{0}^\infty \frac{\sin(x)}{x^2+a^2 }\,dx = \frac{1}{2a}[e^{-a} \mathrm{Ei}'(a)-e^{a}\mathrm{Ei}(-a)]$$

By differentiation and letting $a \to 1$ we have
$$\int_{0}^\infty \frac{\sin(x)}{(x^2+1)^2 }\,dx=\frac{\mathrm{Ei}(1)}{2e}$$

We deduce that

$$2\int_{0}^\infty \frac{\log(x) \cos(x)}{(x^2+1)^2}\,dx +\pi i\left( \frac{\pi}{2e}-i \frac{\mathrm{Ei}(1)}{2e}\right) = 2\pi i \left(\frac{π}{4 e}+\frac{i}{4e} \right)$$

This simplifies to

$$\int_{0}^\infty \frac{\log(x)\cos(x)}{(x^2+1)^2}\,dx = – \frac{\pi \mathrm{Ei}(1)}{4e}-\frac{\pi}{4e}$$

## Bromwich contour integration of the gamma function

$$\frac{1}{2\pi i}\int^{c+i\infty}_{c-i\infty}\Gamma(a+t)\Gamma(b-t) s^{-t}\,dt= \frac{\Gamma(a+b)}{(1+s)^{a+b}}s^a$$

$$\textit{proof}$$

Consider the following function
$$f(z) = \Gamma(z+a)\Gamma(b-z) s^{-z}$$

Suppose that $a,b \in \mathbb{R}$ and $a < b$. Note that the Gamma function has a pole of order 1 at each non-positive integer where we have

$$\mathrm{Res}(\Gamma,-n) = \frac{(-1)^n}{n!}$$

The function $f$ has poles at the following points

$$-n-a,-(n-1)-a,\cdots,-a,b,b+1,\cdots,b+n$$

Notice that the function $f$ is analytic on the region $-a<\mathrm{Re}(z)<b$ , hence consider the following Bromwich contour

By the residue theorem

$$\int_{C_R}f(z)\,dz+\int^{c+iT}_{c-iT}f(z)\,dz = 2\pi i \sum_{k=0}^n \operatorname*{Res}_{z=-a-k }f(z)$$

By taking the limit $\to \infty$ we have

$$\lim_{R \to \infty}\int_{C_R}f(z)\,dz+\int^{c+i\infty}_{c-i\infty}f(t)\,dt = 2\pi i \sum_{k=0}^\infty \operatorname*{Res}_{z=-a-k }f(z)$$

Note that

$$\small \operatorname*{Res}_{z=-a-k }\Gamma(z+a)\Gamma(b-z) s^{-z} = \lim_{z \to -a-k} (b+a+k)\Gamma(-k) s^{a+k} = \frac{(-1)^k\Gamma(a+b+k)}{\Gamma(k+1)}s^{a+k}$$

Note that

$$\small s^a\sum_{k=0}^\infty \frac{\Gamma(a+b+k)}{\Gamma(k+1)} (-s)^k= s^a \Gamma(a+b)\sum_{k=0}^\infty (a+b)_k \frac{(-s)^k}{k!} = {}_2F_1(1;1,a+b,-s)$$

By definition of the Hypergeometric funciton

$$\small s^a \Gamma(a+b)\sum_{k=0}^\infty (a+b)_k \frac{(-s)^k}{k!} =s^a \Gamma(a+b) {}_2F_1(a+b,1;1,-s) = \frac{\Gamma(a+b)}{(1+s)^{a+b}}s^a$$

Also notice that

$$\lim_{R \to \infty}\int_{C_R}f(z)\,dz \to 0$$

So we deduce that

$$\frac{1}{2\pi i}\int^{c+i\infty}_{c-i\infty}\Gamma(a+t)\Gamma(b-t) s^{-t}\,dt= \frac{\Gamma(a+b)}{(1+s)^{a+b}}s^a$$

## Triple integral with sines and cosines

Find the integral

\begin{align}\int^\infty_0 \int^\infty_0 \int^\infty_0 \frac{\sin(x)\sin(y)\sin(z)}{xyz(x+y+z)}(\sin(x)\cos(y)\cos(z)\\ + \sin(y)\cos(z)\cos(x) + \sin(z)\cos(x)\cos(y))\,dx\,dy\,dz \end{align}

$$\textit{solution}$$

This can be rewritten as
$$3\small\int^\infty_0 \int^\infty_0 \int^\infty_0 \frac{\sin^2(x)\sin(y)\cos(y)\sin(z)\cos(z)}{xyz(x+y+z)}\,dx\,dy\,dz$$

Now consider

$$\small F(a) = 3\int^\infty_0 \int^\infty_0 \int^\infty_0\frac{\sin^2(x)\sin(y)\cos(y)\sin(z)\cos(z) e^{-a(x+y+z)}}{xyz(x+y+z)}\,dx\,dy\,dz$$

Taking the derivative

$$\small F'(a) = -3\int^\infty_0 \int^\infty_0 \int^\infty_0\frac{\sin^2(x)\sin(y)\cos(y)\sin(z)\cos(z) e^{-a(x+y+z)}}{xyz}\,dx\,dy\,dz$$

By symmetry we have
$$F'(a) = -3\left(\int^\infty_0 \frac{\sin^2(x)e^{-ax}}{x}\,dx \right)\left( \int^\infty_0 \frac{\sin(x)\cos(x)e^{-ax}}{x}\,dx\right)^2$$

We can evaluate the integrals to

$$F'(a) = -\frac{3}{16} \log\left(\frac{4}{a^2}+1 \right)\arctan^2\left(\frac{2}{a}\right)$$

By integration we have

$$F(0) = \frac{3}{16} \int^\infty_0\log\left(\frac{4}{a^2}+1 \right)\arctan^2\left(\frac{2}{a}\right)\,da$$

Let $x = 2/a$

$$I = \frac{3}{8} \int^\infty_0\frac{\log\left(x^2+1 \right)\arctan^2\left(x\right)}{x^2}\,dx$$

First note that

$$\int \frac{\log(1+x^2)}{x^2}\,dx = 2 \arctan(x) – \frac{\log(1 + x^2)}{x}+C$$

Using integration by parts

$$I = \frac{\pi^3}{12}+2\int^\infty_0\frac{\arctan(x)\log(1 + x^2)}{(1+x^2)x}\,dx$$

For the integral let

$$F(a) = \int^\infty_0\frac{\arctan(ax)\log(1 + x^2)}{(1+x^2)x}\,dx$$

By differentiation we have

$$F'(a) = \int^\infty_0 \frac{\log(1+x^2)}{(1 + a^2 x^2)(1+x^2)}\,dx$$

Letting $1/a = b$ we get

\begin{align}\frac{1}{(1 + a^2 x^2)(1+x^2)} &= \frac{1}{a^2} \left\{ \frac{1}{((1/a)^2+x)(1+x^2)}\right\}\\ &=\frac{b^2}{1-b^2}\left\{ \frac{1}{b^2+x^2}-\frac{1}{1+x^2} \right\} \end{align}

We conclude that
$$\small \frac{b^2}{1-b^2}\int^\infty_0 \frac{\log(1+x^2)}{b^2+x^2}-\frac{\log(1+x^2)}{1+x^2} \,dx = \frac{b^2}{1-b^2}\left\{ \frac{\pi}{b}\log (1+b)-\pi\log(2)\right\}$$

Where we used that

$$\int^\infty_0 \frac{\log(a^2+b^2x^2)}{c^2+g^2x^2}\,dx = \frac{\pi}{cg}\log \frac{ag+bc}{g}$$

By integration we deduce that

$$\int^1_0 \frac{\pi}{a^2-1}\left\{ a\log \left(1+\frac{1}{a} \right)-\log(2)\right\}\,da = \frac{\pi}{2}\log^2(2)$$

For the last one I used wolfram alpha, however it shouldn’t be difficult to prove.

Finally we have

$$\int^\infty_0\frac{\log\left(x^2+1 \right)\arctan^2\left(x\right)}{x^2}\,dx = \frac{\pi^3}{12}+\pi \log^2(2)$$

Posted in Uncategorized | Tagged , , , , | 2 Comments