# Evaluating real integral using residue calculus: why different results?

I have to evaluate the real integral $$I = \int_0^{\infty} \frac{\log^2 x}{x^2+1}.$$ using residue calculus. Its value is $\frac{\pi^3}{8}$, as you can verify (for example) introducing the function $$\frac{(\log z-i(\pi/2))^2}{z^2+1}.$$ and considering the branch cut for the logarithm function on the negative semiaxis of the immaginary numbers and an upper half-circle indented at 0 as integration contour. I tried a different method, but unfortunately I obtained a different result and I don't know why. I consider the branching axis of the logarithm function as the positive real semiaxis. I tried as integration contour this closed curve. I used the complex function $$f(z)=\frac{\log^3z}{z^2+1}$$ obtaining $$\int_r^{R} \frac{\log^3 x}{x^2+1}\;dx + \int_\Gamma \frac{\log^3 z}{z^2+1}\;dz - \int_r^{R} \frac{(\log x+2\pi i)^3}{x^2+1}\;dx - \int_\gamma \frac{\log^3 z}{z^2+1}\;dz.$$ It is easy to see that integrals over circular paths $\gamma$ and $\Gamma$ tend to zero when $R\to \infty,r\to 0$. So we have to evaluate $$\int_r^{R} \frac{\log^3 x}{x^2+1}\;dx - \int_r^{R} \frac{(\log x+2\pi i)^3}{x^2+1}\;dx,$$ which immaginary part is (EDIT: changed $8\pi i$ to $8\pi^3 i$ ) $$-6\pi i \int_r^{R} \frac{\log^2 x}{x^2+1}\;dx + 8\pi^3 i \int_r^{R} \frac{1}{x^2+1}\;dx,$$ that has to be equal to the immaginary part of $$2\pi i\;\left( \mathrm{Res} \left[f,i \right] + \mathrm{Res}\left[f,-i \right]\right) = -i \frac{\pi^4}{4}.$$ So, doing the rest of the work, finally I found that the result is $\frac{17\pi^3}{24}$, that is clearly different from $\frac{\pi^3}{8}$... but where is the flaw in my argument? Please help

-
isn't the value of this integral 0 ? –  Santosh Linkha Jan 19 '13 at 16:05
@experimentX: of course, you are right. I changed the function to integrate at the top of the page, now logarithm is squared. Sorry for the enormous typo. –  Flast9 Jan 19 '13 at 16:28
still, i can't solve it, here is an example of it. I would like to see it's solution, and the reason why the multiple of $\log x$ is taken. –  Santosh Linkha Jan 19 '13 at 16:29
It should be $12\pi^2 i\int_r^R$, not $8\pi i\int_r^R$. –  mrf Jan 19 '13 at 17:11
@mrf: why? However, I turned the value $8\pi i$ into the correct $8\pi^3 i$ –  Flast9 Jan 19 '13 at 17:34

The error is where you get $$2\pi i\;\left( \mathrm{Res} \left[f,i \right] + \mathrm{Res}\left[f,-i \right]\right) = -i \frac{\pi^4}{4}.$$ If you use $\arg{i}=\frac{\pi}{2}$ then you must have $\arg(-i)=\frac{3\pi}{2}$ instead of $\arg(-i)=-\frac{\pi}{2}$, since you must use the same branch of the logarithm all through.

Taking this into account, we instead get $$2\pi i\;\left( \mathrm{Res} \left[f,i \right] + \mathrm{Res}\left[f,-i \right]\right) = \frac{13i\pi^4}{4}.$$

-


Let $\quad\ds{\ln\pars{z} = \ln\pars{\verts{z}} + \ic{\rm Arg}\pars{z}.\quad 0 < {\rm Arg}\pars{z} < 2\pi.\quad}$

According to the $\ds{\large\ln}$-branch cut, the integrand has poles at $\quad\ds{\expo{\pi\ic/2}}\quad$ and $\quad\ds{\expo{3\pi\ic/2}}$:

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

\begin{align} 0&=6\pi\ic\int_{0}^{\infty}{\ln^{2}\pars{x} \over x^{2} + 1}\,\dd x +\pars{-\,{1 \over 8} + {27 \over 8} - 4}\,\pi^{4}\,\ic =6\pi\ic\int_{0}^{\infty}{\ln^{2}\pars{x} \over x^{2} + 1}\,\dd x - {3 \over 4}\,\pi^{4}\,\ic \end{align}

$$\color{#66f}{\large\int_{0}^{\infty}{\ln^{2}\pars{x} \over x^{2} + 1}\,\dd x} ={3\pi^{4}\ic\,/4 \over 6\pi\ic} =\color{#66f}{\Large{\pi^{3} \over 8}}$$

-