I have:

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

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

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

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:

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

which gives for i:

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

and for 3i:

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

Plugging into the formula given above, I get:

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

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


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

2 Answers 2


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.

  • $\begingroup$ So when $\rho=3$, you disregard from the residue of i? $\endgroup$ Dec 14, 2021 at 17:31
  • 1
    $\begingroup$ 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$). $\endgroup$
    – user170231
    Dec 14, 2021 at 19:02
  • $\begingroup$ Well noted! I will go through your reasoning deeply tomorrow. Thanks a lot. $\endgroup$ Dec 14, 2021 at 19:37
  • $\begingroup$ 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}$? $\endgroup$ Dec 15, 2021 at 9:20
  • 1
    $\begingroup$ @ViolaPlayer $$ \frac{{ - 9}}{{( - 9 + 1)(3i + 3i)}} = \frac{{ - 9}}{{ - 48i}} = \frac{3}{{16i}}. $$ The mistake is the $\frac{9}{72i}$. $\endgroup$
    – 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}. $$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .