I've been trying to integrate
$$\int_{-\infty}^{\infty} \frac{x^{2}}{(1+x^{4})^{2}} dx$$
by using residues.
So I understand the set up of this problem by doing:
$$\int_{-R}^{R} \dfrac{x^{2}}{(1+x^{4})^{2}} dx + \int_{C_R} \dfrac{z^{2}}{(1+z^{4})^{2}} dz $$
where $C_{R}$ is the upper circle in the complex plane.
So when applying Cauchy's residue theorem, I am finding the resides of $f(z) = \dfrac{z^{2}}{(1+z^{4})^{2}} $ at $z= e^{\pi/4i}$ and $z= e^{ 3\pi /4 i}$ since they are within the upper circle in the complex plane. However, they are poles of order 2 and the algebra seems complicated. Anyone have any suggestion to find the residues of $f(z)$ at the poles?
Let$$h(z)=\frac z{(z-e^{3\pi i/4})(z-e^{5\pi i/4})(z-e^{7\pi i/4})}.$$With a few computations, you get that $h(e^{\pi i/4})=-\frac i4$ and that $h'(e^{\pi i/4})=\frac{e^{\pi i/4}}8$. So, near $e^{\pi i/4}$, you have$$h(z)=-\frac i4+\frac{e^{\pi i/4}}8\left(z-e^{\pi i/4}\right)+\cdots\tag1$$Now, let $g(z)=h^2(z)$. It follows from $(1)$ that, near $e^{\pi i/4}$, you have$$g(z)=-\frac1{16}-\frac{e^{3\pi i/4}}{16}\left(z-e^{\pi i/4}\right)+\cdots$$and so (again, near $e^{\pi i/4}$),\begin{align}f(z)&=\frac{g(z)}{\left(z-e^{\pi i/4}\right)^2}\\&=-\frac1{16}\left(z-e^{\pi i/4}\right)^{-2}-\frac{e^{3\pi i/4}}{16}\left(z-e^{\pi i/4}\right)^{-1}+\cdots\end{align}Therefore,$$\operatorname{res}_{z=e^{\pi i/4}}f(z)=-\frac{e^{3\pi i/4}}{16}$$and a similar computation shows that$$\operatorname{res}_{z=e^{3\pi i/4}}f(z)=-\frac{e^{\pi i/4}}{16}$$So\begin{align}\int_{-\infty}^\infty\frac{x^2}{(1+x^4)^2}\,\mathrm dx&=2\pi i\left(-\frac{e^{3\pi i/4}}{16}-\frac{e^{\pi i/4}}{16}\right)\\&=\frac\pi{4\sqrt2}.\end{align}