Contour method to solve $\int^\infty_0\frac{\ln(1+x)}{1+x^2}\,dx$
Prove the following using complex analysis
$$\tag{1}\int^\infty_0\frac{\ln(1+x)}{1+x^2}\,dx=\frac{\pi}{2}\ln(2)$$
I found this problem in Schaum's outlines of complex variables.
I thought that we could solve the problem using a similar method to evaluating
$$\int^\infty_0\frac{\ln(1+x^2)}{1+x^2}\,dx$$
Where we integrate the function
$$f=\frac{\log(1-iz)}{z^2+1}$$
around half a circle in the upper half plane and chosing an analytic branch of the logarithm in the region.
I spent so much time on (1) without success.
Solution 1:
$\newcommand{\+}{^{\dagger}} \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\down}{\downarrow} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\isdiv}{\,\left.\right\vert\,} \newcommand{\ket}[1]{\left\vert #1\right\rangle} \newcommand{\ol}[1]{\overline{#1}} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert} \newcommand{\wt}[1]{\widetilde{#1}}$ $\ds{\int_{0}^{\infty}{\ln\pars{1 + x} \over 1 + x^{2}}\,\dd x ={\rm G} + {1 \over 4}\,\pi\,\ln\pars{2}\quad\mbox{where}\quad {\rm G} \equiv \sum_{n = 0}^{\infty}{\pars{-1}^{n} \over \pars{2n + 1}^{2}} = 0.9159\ldots}$ is the Catalan Constant.
Let's consider the integral $$ {\cal I} \equiv \int_{\rm C}{\ln^{2}\pars{z} \over z^{2} + 2z + 2}\,\dd z \quad\mbox{where}\quad \left\vert% \begin{array}{l} {\rm C}\ \mbox{is a 'key-hole' contour which takes care of the}\ \\ {\large \ln}-\mbox{branch cut}. \end{array}\right. $$ Zeros of $\ds{z^{2} + 2z + 2=0}$ are given by $\ds{z_{\pm} = -1 \pm \ic = \root{2}\expo{\pm 3\ic\pi/4}}$.
\begin{align} {\cal I}&=2\pi\ic\,\bracks{{\ln^{2}\pars{z_{+}} \over z_{+} - z_{-}} + {\ln^{2}\pars{z_{-}} \over z_{-} - z_{+}}} =2\pi\ic\,{% \bracks{\ln\pars{2}/2 + 3\ic\pi/4}^{2} -\bracks{\ln\pars{2}/2 - 3\ic\pi/4}^{2}\over 2\ic} \\[3mm]&=\pi\bracks{\ic\,{3\pi \over 2}\,\ln\pars{2}} ={3 \over 2}\,\pi^{2}\ln\pars{2}\,\ic\tag{1} \end{align}
\begin{align} {\cal I}&= \int_{-\infty}^{0}{\bracks{\ln^{2}\pars{-x} + \ic\pi} \over x^{2} + 2x + 2}\,\dd x + \int_{0}^{-\infty}{\bracks{\ln^{2}\pars{-x} - \ic\pi} \over x^{2} + 2x + 2}\,\dd x =-4\pi\ic\int_{0}^{-\infty}{\ln\pars{-x} \over x^{2} + 2x + 2}\,\dd x \\[3mm]&=4\pi\ic\int_{0}^{\infty}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x =4\pi\ic\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x + 4\pi\ic\int_{1}^{\infty}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x \\[3mm]&=4\pi\ic\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x + 4\pi\ic\int_{0}^{\infty}{\ln\pars{1 + x} \over 1 + x^{2}}\,\dd x \end{align}
$$ \!\!\!\!\!\!\!\!\!\!\int_{0}^{\infty}{\ln\pars{1 + x} \over x^{2} + 1}\,\dd x ={{\cal I} \over 4\pi\ic} - \int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x ={3 \over 8}\,\pi\ln\pars{2} -\color{#c00000}{\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x}\tag{2} $$ where we used result $\pars{1}$.
$\ds{z_{\pm} = 1 \pm \ic}$ are the zeros of $\ds{z^{2} - 2z + 2 = 0}$. $\ds{\color{#c00000}{\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x}}$ is evaluated as follows: \begin{align} &\color{#c00000}{\int_{0}^{1}{\ln\pars{x} \over x^{2} - 2x + 2}\,\dd x}= \int_{0}^{1}\ln\pars{x}\pars{{1 \over x - z_{+}} - {1 \over x - z_{-}}} \,{1 \over z_{+} - z_{-}}\,\dd x =\Im\int_{0}^{1}{\ln\pars{x} \over x - z_{+}}\,\dd x \\[3mm]&=-\Im\int_{0}^{1/z_{+}}{\ln\pars{z_{+}x} \over 1 - x}\,\dd x =-\Im\pars{\ln\pars{z_{+}}\int_{0}^{1/z_{+}}{\dd x \over 1 - x} +\int_{0}^{1/z_{+}}{\ln\pars{x} \over 1 - x}\,\dd x} \\[3mm]&=-\Im\pars{-\ln\pars{z_{+}}\ln\pars{1 - {1 \over z_{+}}} -\ln\pars{1 \over z_{+}}\ln\pars{1 - {1 \over z_{+}}} +\int_{0}^{1/z_{+}}{\ln\pars{1 - x} \over x}\,\dd x} \\[3mm]&=\Im\int_{0}^{1/z_{+}}{{\rm Li}_{1}\pars{x} \over x}\,\dd x =\Im{\rm Li}_{2}\pars{1 \over z_{+}} = \Im{\rm Li}_{2}\pars{\half - \half\,\ic} =\color{#00f}{-{\rm G} + {1 \over 8}\,\pi\ln\pars{2}}\qquad\pars{3} \end{align} where $\ds{{\rm Li}_{s}\pars{z}}$ is the Polylogarithm Function and $\ds{{\rm Li}_{1}\pars{z} = -\ln\pars{1 - z}}$. We used the recursive relation $\ds{{\rm Li}_{s + 1}\pars{z} = \int_{0}^{z}{{\rm Li}_{s}\pars{x} \over x}\,\dd x}$. The $\ds{\color{#00f}{\mbox{last result}}}$ is found with the series representation of $\ds{{\rm Li}_{s}\pars{z}}$.
By replacing $\pars{3}$ in $\pars{2}$, we found: $$\color{#00f}{\large% \int_{0}^{\infty}{\ln\pars{1 + x} \over x^{2} + 1}\,\dd x =G + {1 \over 4}\,\pi\ln\pars{2}} $$