I wishing to calculating the integral$$ I:=\int_0^\infty \frac{y^{n}}{(1+y^2)^2}dy \qquad n=0,1,2 $$ I am looking for real analytic solutions thanks, the closed form is cosecant function so it is very nice.
My input can be from a complex analytic method only: Note, we have double poles at $y=\pm i$. We close contour around a complex function $f(z)=z^n(1+z^2)^{-2}$ in the upper half plane to obtain $$ \text{Res}_{z=i}=\frac{1}{4i}, \ (n=2)\quad \text{Res}_{z=i}=0, \ (n=1)\quad \text{Res}_{z=i}=\frac{1}{2i}, \ (n=0). $$ Now we can write $2\pi i \cdot \text{Res}_{z=i} \ \forall \ n=0,1,2 $. And then we can finish the problem. But I wish to calculate I by real analysis methods, thanks.