8.2 Practice Problems

Problem 8.1. Evaluate the integral \[\int ^{\infty }_{0}\frac {1}{x^{4} + 1}\,dx .\]

Show solution

Solution. The integrand is even, so \(\displaystyle \int ^{\infty }_{0} = \tfrac 12\int ^{\infty }_{-\infty }\), and we may use the semicircular contour \(\Gamma _R\): the segment \([-R,R]\) closed by the arc \(\left |z\right | = R\) in the upper half plane.

The poles of \(\frac {1}{z^4+1}\) are the fourth roots of \(-1\), of which two lie in the upper half plane: \[z_1 = e^{i\pi /4},\qquad z_2 = e^{3i\pi /4}.\] Each is simple, and for a simple pole of \(1/q(z)\) the residue is \(1/q'(z_0)\): \[\operatorname {Res}_{z_0}\frac {1}{z^4+1} = \frac {1}{4z_0^{3}} = \frac {z_0}{4z_0^{4}} = \frac {z_0}{4(-1)} = -\frac {z_0}{4},\] using \(z_0^4 = -1\). Since \(e^{i\pi /4} = \frac {1+i}{\sqrt 2}\) and \(e^{3i\pi /4} = \frac {-1+i}{\sqrt 2}\), \[\sum \operatorname {Res} = -\frac {1}{4}\left (\frac {1+i}{\sqrt 2} + \frac {-1+i}{\sqrt 2}\right ) = -\frac {1}{4}\cdot \frac {2i}{\sqrt 2} = -\frac {i}{2\sqrt 2}.\] On the arc, \(\left |z^4+1\right | \geq R^4 - 1\), so the arc contributes at most \(\frac {\pi R}{R^4-1} \rightarrow 0\). Hence \[\int ^{\infty }_{-\infty }\frac {dx}{x^4+1} = 2\pi i\left (-\frac {i}{2\sqrt 2}\right ) = \frac {\pi }{\sqrt 2}, \qquad \text {and}\qquad \boxed {\int ^{\infty }_{0}\frac {dx}{x^4+1} = \frac {\pi }{2\sqrt 2} = \frac {\pi \sqrt 2}{4} \approx 1.1107 .}\]

Problem 8.2. Using contour integration, find the value of \[\int ^{2\pi }_{0}\frac {dt}{2 - \cos t} .\]

Show solution

Solution. An integral of a rational function of \(\cos t\) and \(\sin t\) over a full period becomes a contour integral on the unit circle under \(z = e^{it}\): \[\cos t = \frac {1}{2}\left (z + \frac {1}{z}\right ),\qquad dt = \frac {dz}{iz},\qquad \left |z\right | = 1 .\] Then \[2 - \cos t = 2 - \frac {z^2+1}{2z} = \frac {4z - z^2 - 1}{2z},\] so \[\frac {dt}{2-\cos t} = \frac {dz}{iz}\cdot \frac {2z}{4z-z^2-1} = \frac {2\,dz}{i\left (4z - z^2 - 1\right )} = \frac {2i\,dz}{z^2 - 4z + 1}.\] The denominator vanishes at \(z = 2 \pm \sqrt 3\). Only \(z_0 = 2-\sqrt 3 \approx 0.268\) lies inside the unit circle, and \[\operatorname {Res}_{z_0}\frac {2i}{z^2-4z+1} = \frac {2i}{2z_0-4} = \frac {2i}{-2\sqrt 3} = -\frac {i}{\sqrt 3}.\] Therefore \[\int ^{2\pi }_{0}\frac {dt}{2-\cos t} = 2\pi i\left (-\frac {i}{\sqrt 3}\right ) = \boxed {\frac {2\pi }{\sqrt 3} = \frac {2\sqrt 3\,\pi }{3} \approx 3.6276 .}\]

Note the roots multiply to \(1\), so one is always inside and one outside — which is what guarantees exactly one residue to collect.

Problem 8.3. Evaluate the integral \[\int ^{\infty }_{0}\frac {x \sin x}{x^{2} + a^{2}}\,dx,\] where \(a\) is a real number.

Show solution

Solution. Since \(x\sin x\) is even and \(x^2+a^2\) is even, the integrand is even and \(\int ^{\infty }_{0} = \tfrac 12\int ^{\infty }_{-\infty }\).

Do not integrate \(\frac {z\sin z}{z^2+a^2}\): \(\sin z\) grows like \(e^{\left |y\right |}\) and the arc will not vanish. Use \[g(z) = \frac {z e^{iz}}{z^2+a^2},\] whose imaginary part on the real axis is the integrand, and whose factor \(e^{iz}\) decays in the upper half plane.

The poles are \(z = \pm i\left |a\right |\), of which \(i\left |a\right |\) is in the upper half plane, with \[\operatorname {Res}_{i\left |a\right |} g = \frac {i\left |a\right | e^{i(i\left |a\right |)}}{2i\left |a\right |} = \frac {e^{-\left |a\right |}}{2}.\] Jordan’s lemma applies — the rational factor \(\frac {z}{z^2+a^2} \rightarrow 0\) uniformly as \(\left |z\right | \rightarrow \infty \) — so the arc contributes nothing and \[\int ^{\infty }_{-\infty }\frac {x e^{ix}}{x^2+a^2}\,dx = 2\pi i \cdot \frac {e^{-\left |a\right |}}{2} = \pi i\, e^{-\left |a\right |}.\] Taking imaginary parts and halving, \[\boxed {\int ^{\infty }_{0}\frac {x\sin x}{x^2+a^2}\,dx = \frac {\pi }{2}e^{-\left |a\right |}.}\]

The modulus signs matter: the question says only that \(a\) is real, and the answer depends on \(\left |a\right |\), since \(a\) and \(-a\) give the same pair of poles.

Problem 8.4. Prove that \(\displaystyle \int ^{\infty }_{0}\frac {\sin ^{2}x}{x^{2}}\,dx = \frac {\pi }{2}\).

Show solution

Solution. The cleanest route reduces this to Dirichlet’s integral. Integrate by parts with \(u = \sin ^2 x\) and \(dv = x^{-2}dx\): \[\int ^{\infty }_{0}\frac {\sin ^2 x}{x^2}\,dx = \left [-\frac {\sin ^2 x}{x}\right ]^{\infty }_{0} + \int ^{\infty }_{0}\frac {2\sin x\cos x}{x}\,dx .\] The bracket vanishes at both ends: as \(x \rightarrow \infty \) because \(\sin ^2 x \leq 1\), and as \(x \rightarrow 0\) because \(\sin ^2 x \sim x^2\). Since \(2\sin x\cos x = \sin 2x\), substituting \(u = 2x\) gives \[\int ^{\infty }_{0}\frac {\sin 2x}{x}\,dx = \int ^{\infty }_{0}\frac {\sin u}{u}\,du .\]

Dirichlet’s integral by contour. Consider \(\frac {e^{iz}}{z}\) on the contour made of \([-R,-\varepsilon ]\), the small semicircle \(\left |z\right | = \varepsilon \) above the origin, \([\varepsilon , R]\), and the large arc \(\left |z\right | = R\) in the upper half plane. The function is analytic inside, so the total is \(0\). The large arc vanishes by Jordan’s lemma. The small semicircle, traversed clockwise past a simple pole of residue \(1\), contributes \(-i\pi \). Hence \[\int ^{\infty }_{-\infty }\frac {e^{ix}}{x}\,dx = i\pi \quad \text {(principal value)},\] and taking imaginary parts, \(\displaystyle \int ^{\infty }_{-\infty }\frac {\sin x}{x}dx = \pi \), so \(\displaystyle \int ^{\infty }_{0}\frac {\sin u}{u}du = \frac {\pi }{2}\).

Therefore \[\boxed {\int ^{\infty }_{0}\frac {\sin ^2 x}{x^2}\,dx = \frac {\pi }{2}.}\]

Both integrals equal \(\pi /2\), which is a coincidence of this pair and not a general phenomenon.

Problem 8.5. Show that \(\displaystyle \int ^{\infty }_{0}\frac {\cos x}{1 + x^{2}}\,dx = \frac {1}{2}\cdot \frac {\pi }{e}\).

Show solution

Solution. The integrand is even, so \(\int ^{\infty }_{0} = \tfrac 12\int ^{\infty }_{-\infty }\). Replace \(\cos x\) by \(e^{ix}\), which decays upwards, and take real parts at the end: \[\int ^{\infty }_{-\infty }\frac {\cos x}{1+x^2}\,dx = \operatorname {Re}\int ^{\infty }_{-\infty }\frac {e^{ix}}{1+x^2}\,dx .\] On the upper semicircle the only pole of \(\frac {e^{iz}}{1+z^2}\) is the simple pole at \(z = i\), with \[\operatorname {Res}_{i}\frac {e^{iz}}{1+z^2} = \frac {e^{i(i)}}{2i} = \frac {e^{-1}}{2i} = -\frac {i}{2e}.\] The arc vanishes by Jordan’s lemma, so \[\int ^{\infty }_{-\infty }\frac {e^{ix}}{1+x^2}\,dx = 2\pi i\left (-\frac {i}{2e}\right ) = \frac {\pi }{e},\] which is already real. Halving, \[\boxed {\int ^{\infty }_{0}\frac {\cos x}{1+x^2}\,dx = \frac {1}{2}\cdot \frac {\pi }{e} \approx 0.5779 .}\]

Using \(e^{iz}\) rather than \(\cos z\) is not a convenience but a necessity: \(\cos z = \frac {e^{iz}+e^{-iz}}{2}\) contains \(e^{-iz}\), which blows up in the upper half plane and destroys the estimate on the arc.

Problem 8.6. Evaluate the integral \[\int ^{\infty }_{0}\frac {dx}{(x^{2} + 1)^{2}} .\]

Show solution

Solution. Even integrand again, so \(\int ^{\infty }_{0} = \tfrac 12\int ^{\infty }_{-\infty }\), and we close in the upper half plane.

Here \(\frac {1}{(z^2+1)^2} = \frac {1}{(z-i)^2(z+i)^2}\) has a double pole at \(z = i\), so the residue needs a derivative: \[\operatorname {Res}_{i} = \lim _{z \rightarrow i}\frac {d}{dz} \left [(z-i)^2 \cdot \frac {1}{(z-i)^2(z+i)^2}\right ] = \lim _{z \rightarrow i}\frac {d}{dz}\frac {1}{(z+i)^2} = \lim _{z \rightarrow i}\frac {-2}{(z+i)^3}.\] With \(z + i = 2i\) and \((2i)^3 = -8i\), \[\operatorname {Res}_{i} = \frac {-2}{-8i} = \frac {1}{4i} = -\frac {i}{4}.\] The arc contributes at most \(\frac {\pi R}{(R^2-1)^2} \rightarrow 0\), so \[\int ^{\infty }_{-\infty }\frac {dx}{(x^2+1)^2} = 2\pi i\left (-\frac {i}{4}\right ) = \frac {\pi }{2}, \qquad \boxed {\int ^{\infty }_{0}\frac {dx}{(x^2+1)^2} = \frac {\pi }{4} \approx 0.7854 .}\]

Compare \(\int ^{\infty }_{0}\frac {dx}{x^2+1} = \frac {\pi }{2}\): squaring the denominator halves the answer here, but that is arithmetic coincidence, not a rule.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.