# Help with integrating $\displaystyle \int_0^{\infty} \dfrac{(\log x)^2}{x^2 + 1} \operatorname d\!x$ - contour integration?

George Arfken's book: Mathematical Methods for Physicists has the following problem in a chapter on contour integration:

$\displaystyle \int_0^{\infty} \dfrac{(\log x)^2}{x^2 + 1} \operatorname d\!x$.

Their suggestion is to make the substitution $x \rightarrow z=e^t$. I'm not sure what they meant by this, but I tried making the substitution $x = e^t$, which turns the integral into:

$\displaystyle\int_{-\infty}^{\infty} \dfrac{t^2 e^t}{1+e^{2t}} \operatorname d\!t$.

The hint is then to take the contour from -R to R, to R+$\pi i$, to -R + $\pi i$, to -R. Since this has a pole at $t = \pi i/2$, a Laurent series expansion about this point gives the residue as $i \pi^2/8$, so the contour integral equals $-\pi^3/4$.

I've been able to show that the integral along R to R + $\pi i$ and along -R + $\pi i$ to -R goes to zero by the ML inequality - the denominator grows exponentially but the numerator quadratically.

But at this point, I'm a bit lost as to what to do with the integral over Im $t = \pi$. Any help? The book gives the answer as $\pi^3 /8$.

-
@Arjang Please, could you have a look at this post on meta, which seems to be related to your edits. –  Martin Sleziak Oct 23 at 7:31

Fleshing out Ragib's idea: we have the substitution $\,t\to -u+\pi i\Longrightarrow dt=-du,$ , so we put

$$f(t):=\frac{t^2e^t}{1+e^{2t}}\Longrightarrow$$

$$\Longrightarrow\int_{R+\pi i}^{-R+\pi i}f(t)\,dt=-\int_{-R}^R\frac{(u^2-2\pi iu-\pi^2)e^{-u+\pi i}}{1+e^{-2u+2\pi i}}\,du=$$

$$=\int_{-R}^R\frac{u^2e^{-u}}{1+e^{-2u}}du-2\pi i\int_{-R}^R\frac{ue^{-u}}{1+e^{-2u}}\,du-\pi^2\int_{-R}^R\frac{e^{-u}}{1+e^{-2u}}\,du$$

The first integral above is just like the one on the real axis (BTW, note the signs in front of the two last integrals, which come from the factor $\,e^{\pi i}=-1\,$).

The last integral is

$$\pi^2\int_{-R}^R\frac{d(e^{-u})}{1+e^{-2u}}=\left.\pi^2\arctan e^{-u}\right|_{-R}^R=$$

$$=\pi^2\left(\arctan e^{-R}-\arctan e^R\right)\xrightarrow [R\to\infty]{}\pi^2\left(0-\frac{\pi}{2}\right)=-\frac{\pi^3}{2}$$

The second integral above is zero as the integrand is just $\,\frac{1}{2\cosh u}\,$ , which is an odd function...

Denoting our integral by $\,I\,$, we thus have that

$$2I-\frac{\pi ^3}{2}=-\frac{\pi^3}{4}\Longrightarrow I=\frac{\pi^3}{8}$$

-

If you simply write out the contour integral over Im $t=\pi$ as a real integral using the parametrization $t:[-R,R] \to \mathbb{C}: t\mapsto -t+i\pi$ then you see that the integral is something of the form $$I + C_1 \int^{\infty}_{-\infty} \frac{t e^t}{1+e^{2t} } dt + C_2 \int^{\infty}_{-\infty} \frac{e^t}{1+e^{2t} } dt$$ where $I$ is the integral you want to find and $C_1, C_2$ are some known constants. The last integral is easily solved using an elementary substitution.

The middle one is solved by exactly the same procedure we've just applied in finding the original one: Set up the same contour, the sides go to 0, the part along Im $t=\pi$ is expressible in terms of the part along the real axis, and you can solve for it.

-
But then dividing both sides by two, we get that the integral we're looking for is equal to $-\pi^3/8$, which is just the opposite of the answer given in the book. –  Michael Zhao Sep 6 '12 at 3:42
@maz906 Sorry, I realized there were some additional complications (Replacing $t$ with $t+\pi$ into $\frac{e^t}{1+e^{2t} }$ simply changes sign like I described, but $t^2$ becomes $t^2 + 2\pi i t - \pi^2$ which adds a few extra terms to account for than just $t^2.$ I've described it above, see my edit. –  Ragib Zaman Sep 6 '12 at 3:59