# Evaluating an improper integral using the Residue Theorem

I have:

$$$$\int_{-\infty}^{\infty}\frac{x^2}{(x^2+1)(x^2+9)}dx$$$$

and I want to solve it using a complex closed contour on C. I do the following:

$$$$\int_{-\infty}^{\infty}\frac{z^2}{(z^2+1)(z^2+9)}dz$$$$

which clearly has 4 poles, $$\pm i,\pm3i$$. The greatest radius of the clontour is thus $$\rho=3$$, therefore I get the following integral form:

$$$$\int_{\gamma_3}\frac{z^2}{(z^2+1)(z^2+9)}dz=2\pi i Res(f;i,+3i)$$$$

which gives for i:

$$$$Res(i)=\lim_{z\longrightarrow i}(z-i)\frac{z^2}{(z-i)(z+i)(z+3i)(z-3i)}dz=i/16$$$$

and for 3i:

$$$$Res(3i)=\lim_{z\longrightarrow 3i}(z-3i)\frac{z^2}{(z-i)(z+i)(z+3i)(z-3i)}dz=-i/48$$$$

Plugging into the formula given above, I get:

$$$$\int_{\gamma_3}\frac{z^2}{(z^2+1)(z^2+9)}dz=2\pi i (i/16-i/48)=-\frac{\pi}{12}$$$$

But this is not correct, as the integral is negative. Where is the error?

Thanks!

• Recheck the residue at $z = 3i$. Dec 14, 2021 at 15:37
• It was a minus sign error there indeed. This gives (-i/48) instead of (i/48), but the integral is still negative. Dec 14, 2021 at 15:55
• Not a sign error, the value of that residue is wrong. It should be $-\frac{3i}{16}$. Dec 14, 2021 at 16:21

As pointed out in the comments, the residue you found was incorrect:

$$\operatorname{Res}(f(z),3i) = \lim_{z\to3i}(z-3i)f(z) = \lim_{z\to3i}\frac{z^2}{(z^2+1)(z+3i)} = \frac{-9}{(-9+1)(3i+3i)} = \frac9{48i} = -\frac{3i}{16}$$

But what your solution is really missing is an indication of the contour you're using, and showing that the contribution of the integral over the part of the contour not containing the real line is zero. (Maybe you've already done this but omitted the details from your post, but I'll just add the details here for posterity as well as personal practice.)

Presumably, you take $$\gamma$$ to be the upper half of a circle with its diameter on the real interval $$[-R,R]$$. Then

$$\oint_\gamma f(z) \, dz = \int_{\gamma_R} f(z) \, dz + \int_{-R}^R f(z) \, dz$$

where $$\gamma_R$$ refers to the arc $$|z|=R \land \operatorname{Im}(z)\ge0$$.

As $$R\to\infty$$, we recover the integral you want to compute from the second integral above. Meanwhile, the first integral is bounded by

\begin{align} \left|\int_{\gamma_R}f(z) \, dz\right| &= \left|\int_0^\pi f\left(Re^{it}\right) \, iRe^{it} \, dt\right| \\[1ex] &\le \frac{\pi R^3}{\left|R^2e^{2it}+1\right|\left|R^2e^{2it}+9\right|} \end{align}

and this vanishes as $$R$$ gets arbitrarily large.

• So when $\rho=3$, you disregard from the residue of i? Dec 14, 2021 at 17:31
• No, you still have to count the residue at $i$ because that pole falls inside $\gamma$. I'm merely pointing out the error in the residue at $3i$, and filling in the rest of the details (estimating the integral along the arc, then taking $R\to\infty$). Dec 14, 2021 at 19:02
• Well noted! I will go through your reasoning deeply tomorrow. Thanks a lot. Dec 14, 2021 at 19:37
• Thanks for this, I have checked it and I see the error I did now. However, I think there is an error in your calculation, $\frac{9}{72i}=\frac{1}{8i}$, not $\frac{3}{16i}$. So the total integral is still negative, $2\pi i\big(\frac{i}{16}-\frac{i}{8}\big)=-\frac{\pi i}{8}$? Dec 15, 2021 at 9:20
• @ViolaPlayer $$\frac{{ - 9}}{{( - 9 + 1)(3i + 3i)}} = \frac{{ - 9}}{{ - 48i}} = \frac{3}{{16i}}.$$ The mistake is the $\frac{9}{72i}$.
– Gary
Dec 15, 2021 at 10:40

Also, using Calculus $$\frac{x^2}{(x^2+1)(x^2+9)}=\frac{1}{8}\left(\frac{9}{x^2+9}-\frac{1}{x^2+1}\right)$$ and $$\int_{-\infty}^\infty\frac{dx}{x^2+1}=\tan^{-1}(x)\Big|_{x=-\infty}^{x=\infty}=\pi, \qquad \int_{-\infty}^\infty\frac{dx}{x^2+9}=\frac{1}{3}\tan^{-1}(x/3)\Big|_{x=-\infty}^{x=\infty}=\frac{\pi}{3},$$ and hence $$\int_{-\infty}^\infty\frac{x^2}{(x^2+1)(x^2+9)}=\frac{\pi}{4}.$$