Evaluating integral using contour integration
The semicircle contour is the real axis from –R to R plus the upper half-plane arc of radius R. The integrand has a double pole at z = i, whose residue is –i/4 using the derivative formula for second-order poles. The arc integral vanishes as R → ∞ since the integrand behaves like 1/R² while the arc length grows like R, making their product tend to zero. Applying the residue theorem, the integral from –∞ to ∞ equals 2πi times the residue, giving the final result π/2.
Step 1 (Choose the contour).
Take the closed contour (C_R) consisting of the line segment from (-R) to (R) on the real axis plus the semicircular arc (\Gamma_R) of radius (R) in the upper half-plane, traversed counterclockwise. We will later let (R \to \infty).
Step 2 (Identify poles and residues).
The integrand is
[
f(z) ;=; \frac{z^2}{(z^2+1)^2},.
]
Its poles are at (z = \pm i). Only (z = i) lies inside the upper half-plane. It is a double pole there. We compute the residue at (z=i) using the formula for a second-order pole:
[
\text{Res}\bigl(f,,i\bigr)
;=; \lim_{z\to i},\frac{d}{dz}\Bigl[(z-i)^2,f(z)\Bigr].
]
Because
[
(z^2+1)^2 = (z-i)^2,(z+i)^2,\quad
(z-i)^2,f(z) ;=; \frac{z^2}{(z+i)^2},
]
we differentiate (\frac{z^2}{(z+i)^2}) and then set (z=i):
[
\frac{d}{dz}\left(\frac{z^2}{(z+i)^2}\right)
= \frac{2z,(z+i)^2 - z^2,2(z+i)}{(z+i)^4}.
]
At (z=i), ((z+i) = 2i), so ((z+i)^2 = (2i)^2 = -4) and ((z+i)^4 = 16). The numerator becomes
[
2i \cdot (-4) ;-; i^2 \cdot 2(2i)
= -8i ;-; (-1)\cdot 4i
= -8i + 4i
= -4i.
]
Hence
[
\text{Res}\bigl(f, i\bigr)
= \frac{-4i}{16}
= -\frac{i}{4}.
]
Step 3 (Apply the Residue Theorem).
By the Residue Theorem,
[
\oint_{C_R} f(z),dz ;=; 2\pi i \cdot \left(\text{Res at } z=i\right)
= 2\pi i \left(-\frac{i}{4}\right)
= \frac{\pi}{2}.
]
But (\oint_{C_R} f(z),dz = \int_{-R}^R \frac{x^2}{(x^2+1)^2},dx + \int_{\Gamma_R} f(z),dz).
Step 4 (Show the arc integral vanishes).
On (\Gamma_R), (|z|=R). For large (R), (\bigl|z^2/(z^2+1)^2\bigr|\sim 1/R^2). The arc length is (\pi R), so
[
\left|\int_{\Gamma_R} f(z),dz\right|
;\le; \left(\max_{\Gamma_R} |f(z)|\right),\bigl(\text{arc length}\bigr)
;\sim; \frac{1}{R^2} \cdot \pi R
;=; \frac{\pi}{R} ;\to; 0,
]
as (R\to\infty). Thus (\lim_{R\to\infty} \int_{\Gamma_R} f(z),dz = 0).
Step 5 (Take the limit (R\to\infty)).
Letting (R \to \infty), the total contour integral equals (\pi/2), and the arc contribution goes to zero. Hence,
[
\int_{-\infty}^{+\infty} \frac{x^2}{(x^2+1)^2},dx
= \frac{\pi}{2}.
]
So the improper integral evaluates to (\boxed{\frac{\pi}{2}}).