Evaluate $\int_0^\infty \frac{\ln^2(z)}{1+z^2}$dz by contour integration Background: This is part b of problem 12.4.3 from Arfken, Weber, Harris Math Methods for Physicists to show that $\int_0^\infty \frac{\ln^2(z)}{1+z^2}$dz$=4(1-\frac{1}{3^3}+\frac{1}{5^3}-\frac{1}{7^3}+\dots)$. 
Part b of the question asks to show that this series evaluates to $\frac{\pi^3}{8}$ by contour integration. Where is my mistake: $\lim_{z \to 0}zf(z)=0$ and $\lim_{z \to \infty}zf(z)=0$ so the big and little circle equal 0.$

Drawing a branch cut along the positive x axis and integrating counterclockwise along the positive x-axis around a big circle the negative x-axis from infinity and the little circle:
Assume $I=\int_0^\infty \frac{\ln^2(x)}{1+x^2}\text{dx}$
We can add the components of along the contour and set that equal to the value of $2\pi i \text{Res}[f(z),i]$ evaluated at the poles $\pm i$
$$\int_0^\infty \frac{\ln^2(z)}{1+z^2}\text{dz}+\int_{\infty}^0 \frac{\ln^2(z)}{1+z^2}\text{dz}=2\pi i \text{Res}[f(z),\pm i]\tag{1}$$
$$\int_0^\infty \frac{(\ln^2 \mid x\mid}{1+x^2}\text{dx}-\int_0^{\infty} \frac{(\ln\mid x\mid+2i\pi)^2}{1+x^2}\text{dx}=2\pi i \left (\lim_{z \to i}\frac{\ln^2(z)}{2z}+\lim_{z \to -i}\frac{\ln^2(z)}{2z}\right )\tag{2}$$
$$\int_0^\infty \frac{(\ln^2\mid x\mid}{1+x^2}\text{dx}-\int_0^{\infty} \frac{(\ln^2\mid x\mid+\color{red}{4\ln|x|i\pi}-4\pi^2)}{1+x^2}\text{dx}=2\pi i \left (\lim_{z \to i}\frac{\ln^2(z)}{2z}+\lim_{z \to -i}\frac{\ln^2(z)}{2z}\right )\tag{3}$$
$$0I+\color{red}{0}-\left[\tan^{-1}(x)\right]\mid^{\infty}_0(4\pi^2)\text{dx}=(2\pi i)  \left (\frac{-\pi^2/4+9\pi^2/4}{2i}\right )\tag{4}$$
$$0I+2\pi^3=\frac{8\pi^3}{4}\tag{5}$$
For explanation of the red integral see here, here or here. 
I found my error. It was a negative sign, and the two sides cancel to zero so you can't evaluate it this way, but I found an answer which evaluates it from negative to positive infinity so I'm marking the question as a duplicate. See dustin's answer at the link for the contour integration.  
 A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
The contour is a key-hole $\ds{\,\mc{C}}$ which takes into acount the $\ds{\ln}$-branch cut
$$\ln\pars{z} = \ln\pars{\verts{z}} + \,\mrm{arg}\pars{z}\ic\,;\qquad z \not= 0\,,\quad
0 < \,\mrm{arg}\pars{z} < 2\pi
$$
when an integration of $\ds{I \equiv \oint_{\mc{C}}{\ln^{3}\pars{z} \over 1 + z^{2}}\,\dd z}$ is performed. The integrand has single poles at, according to the above branch cut, $\ds{\expo{\pi\ic/2}}$ and $\ds{\expo{3\pi\ic/2}}$.

\begin{align}
I & = 2\pi\ic\,\bracks{{\pars{3\pi\ic/2}^{3} \over -\ic - \ic} + {\pars{\pi\ic/2}^{3} \over \ic + \ic}} =
{13 \over 4}\,\pi^{4}\ic\label{1}\tag{1}
\end{align}

\begin{align}
I & = 
\int_{0}^{\infty}{\ln^{3}\pars{x} \over 1 + x^{2}}\,\dd x +
\int_{\infty}^{0}{\bracks{\ln\pars{x} + 2\pi\ic}^{\,3} \over 1 + x^{2}}\,\dd x
\\[5mm] & =
\int_{0}^{\infty}{\ln^{3}\pars{x} \over 1 + x^{2}}\,\dd x -
\int_{0}^{\infty}{\ln^{3}\pars{x} + 3\ln^{2}\pars{x}\pars{2\pi\ic} + 3\ln\pars{x}\pars{2\pi\ic}^{2} + \pars{2\pi\ic}^{3} \over 1 + x^{2}}\,\dd x
\\[5mm] & =
-6\pi\ic\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x +
{1 \over 12}\,\pi^{2}\
\underbrace{\int_{0}^{\infty}{\ln\pars{x} \over 1 + x^{2}}\,\dd x}_{\ds{=\ 0}}\ +\
8\pi^{3}\ic\ \underbrace{\int_{0}^{\infty}{\dd x \over 1 + x^{2}}}
_{\ds{=\ {\pi \over 2}}}
\\[5mm] & =
-6\pi\ic\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x + 4\pi^{4}\ic
\label{2}\tag{2}
\end{align}

With \eqref{1} and \eqref{2}:
\begin{align}
{13 \over 4}\,\pi^{4}\ic & =
-6\pi\ic\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x + 4\pi^{4}\ic
\\[5mm]
\implies &
\bbx{\int_{0}^{\infty}{\ln^{2}\pars{x} \over 1 + x^{2}}\,\dd x =
{\phantom{^{3}}\pi^{3} \over 8}}
\end{align}
