What I am doing wrong in contour integration

complex-analysiscontour-integration

Note: I have edited this post after reading the comments.

I am learning to integrate using contours. I tried testing this technique on following integral: $$\int_{-\infty}^{\infty} \frac{\sin^{2}x}{x^2(1+x^2)} \, dx$$
I also know that above integral evaluates to $\frac{\pi}{2}+\frac{\pi}{2e^2}$

Let $$f(z)=\frac{1-e^{2zi}}{2z^2(1+z^2)}$$
We will recover the target integral by taking Real part of the result later.
I made following semicircular contour to tackle the problem:

Contour diagram

According to Residue theorem Integrating along this contour should equal to sum of all residues . Since there is only 1 pole in this contour at $z=i$
Therefore:
\begin{align*}
I&=2\pi i \lim_{z \to i} [(z-i) \times f(z)]\\
&=2\pi i \lim_{z \to i} \frac{1-e^{2zi}}{(2z^2)(z+i)}\\
&=2\pi i \times \frac{1-e^{-2}}{(-2)(2i)}\\
&=\frac{\pi(1-e^2)}{2e^2}
\end{align*}

Let the required Integral $I_1$.

From the diagram we can say:
$$I=I_1+C_R+c_r$$
Let's evaluate $C_R$:
$$
C_R=\lim_{R \to \infty} \int_{0}^{\pi} \frac{1-e^{2Rie^{i\phi}}}{2R^2e^{2i\phi}(1+R^2e^{2i\phi})} \, iRe^{i\phi}d\phi$$

Since we have $-e^R$ in the numerator , when $R \to \infty$ then $C_R \to -\infty$.

Let's evaluate $c_r$:
\begin{align*}
c_r&=-\lim_{r \to 0} \int_{0}^{\pi} \frac{1-e^{2rie^{i\phi}}}{2r^2e^{2i\phi}(1+r^2e^{2i\phi})} \, ire^{i\phi}d\phi\\
&=-\frac{i}{2}\lim_{r \to 0} \int_{0}^{\pi} \frac{1-e^{2rie^{i\phi}}}{re^{i\phi}(1+r^2e^{2i\phi})} \, d\phi\\
&=-\frac{i}{2}\lim_{r \to 0} \int_{0}^{\pi} \frac{1-e^{2rie^{i\phi}}}{re^{i\phi}(1)} \, d\phi\\ \end{align*}
Applying L'Hospitals Rule
\begin{align*}
&=-\frac{i}{2} \lim_{r \to 0} \int_{0}^{\pi} \frac{-2ie^{i\phi}e^{2rie^{i\phi}}}{e^{i\phi}} \, d\phi\\
&= -\int_{0}^{\pi} 1 \, d\phi\\
&=-\pi
\end{align*}

\begin{align*}
I&=I_1+(-\infty)-\pi
\implies I_1=\infty
\end{align*}

This result is clearly wrong. So where did I make a mistake?

Best Answer

In your estimate of $C_R$, you used $|\sin(Re^{i\theta})| \le 1$, which is false in general. The sine goes rapidly to $\infty$ in the vertical direction!


The conventional thing to do is to take something like, $$ f(z)=\frac{\exp(iz)}{z^2(1+z^2)} $$ and take the imaginary part in the end.

Related Question