<s>[INST] Complex Analysis - Cauchy Principal Value of Improper Integral I am having some difficulty with a P.V. Cauchy Integral problem, and after working on it for hours, I just cannot seem to find what I might be doing wrong.
Here is the problem:
Evaluate the Cauchy principal value of the given improper integral:
$$\int_{-\infty}^{\infty} \frac{1}{(x^2+4)^2} dx$$
My attempt at the problem is below:
Let $$f(z)=\frac{1}{(z^2+4)^2}=\frac{1}{(z+2i)^2(z-2i)^2}$$
Then:
$$\int_{-R}^{R}\frac{dx}{(x^2+4)^2} + \int_{C_R}\frac{dz}{(z^2+4)^2}=2 \pi i \left ( \operatorname*{Res}_{z=2i}\left ( \frac{1}{(z^2+4)^2} \right ) + \operatorname*{Res}_{z=-2i}\left ( \frac{1}{(z^2+4)^2} \right )\right )$$
$$=2 \pi i \left ( \operatorname*{Res}_{z=2i}\left ( \frac{1/(z+2i)^2}{(z-2i)^2} \right ) + \operatorname*{Res}_{z=-2i}\left ( \frac{1/(z-2i)^2}{(z+2i)^2} \right )\right )$$
Now, let $$\frac{p_1(z)}{q_1(z)}=\frac{1/(z+2i)^2}{(z-2i)^2} \text{and let} \frac{p_2(z)}{q_2(z)}=\frac{1/(z-2i)^2}{(z+2i)^2}$$
Then, we see that
$$p_1(2i)=\frac{1}{(4i)^2}\neq 0$$
$$q_1(2i)=(2i-2i)^2=0$$
$$q_1\prime(2i)=2(2i-2i)=0$$
Since $q_1\prime(2i)$ is not nonzero, we know that $\frac{p_1(z)}{q_1(z)}$ is not a simple pole.
So
$$\operatorname*{Res}_{z=2i}\left ( \frac{1/(z+2i)^2}{(z-2i)^2} \right )=\lim_{z\to2i}\left ( \frac{\mathrm{d} }{\mathrm{d} z} \left ( (z-2i)^2*\frac{1/(z+2i)^2}{(z-2i)^2} \right )\right )$$
$$=\lim_{z\to2i}\left ( \frac{\mathrm{d} }{\mathrm{d} z} \left ( \frac{1}{(z+2i)^2} \right )\right )$$
$$=\lim_{z\to 2i}\left ( -\frac{2}{(z+2i)^3} \right )$$
$$=-\frac{2}{(4i)^3}$$
Similarly,
$$\operatorname*{Res}_{z=-2i}\left ( \frac{p_2(z)}{q_2(z)} \right )=\operatorname*{Res}_{z=-2i}\left ( \frac{1/(z-2i)^2}{(z+2i)^2} \right )=\lim_{z\to-2i}\left ( \frac{\mathrm{d} }{\mathrm{d} z} \left ( (z+2i)^2*\frac{1/(z-2i)^2}{(z+2i)^2} \right )\right )$$
$$=\lim_{z\to-2i}\left ( \frac{\mathrm{d} }{\mathrm{d} z} \left ( \frac{1}{(z-2i)^2} \right )\right )$$
$$=\lim_{z\to -2i}\left ( -\frac{2}{(z-2i)^3} \right )$$
$$=-\frac{2}{(-4i)^3}$$
So finally,
$$\int_{-R}^{R}\frac{dx}{(x^2+4)^2} + \int_{C_R}\frac{dz}{(z^2+4)^2}=2 \pi i \left ( -\frac{2}{(4i)^3}-\frac{2}{(-4i)^3} \right )=0$$
So,
$$\int_{-R}^{R}\frac{dx}{(x^2+4)^2} =0- \int_{C_R}\frac{dz}{(z^2+4)^2}$$
$$=-\left ( \int_{C_1}\frac{1/(z+2i)^2}{(z-2i)^2}dz+\int_{C_2}\frac{1/(z-2i)^2}{(z+2i)^2}dz \right )$$
where $C_1$ contains the point $z=2i$ and $C_2$ contains the point $z=-2i$.
$$=-\left (2\pi i\left ( \frac{1}{(2i+2i)^2} \right )+2\pi i\left ( \frac{1}{(-2i-2i)^2} \right )  \right )$$
$$=-\frac{2\pi i}{(4i)^2}-\frac{2\pi i}{(-4i)^2}$$
$$=\frac{\pi i}{4}$$
The final answer should be $\frac{\pi}{16}$, however, which I cannot seem to get.
Any help is greatly appreciated!
 [/INST] You should get $2\pi i \ Res(f(z)|_{z=2i} = 2\pi i \frac{d}{dz} \frac{1}{(z+2i)^2}|_{z=2i} = 2\pi i \frac{-2}{(4i)^3} = 2\pi i \frac{-2}{-64i} = \frac{\pi}{16}$.
</s>