Need help with this https://en.wikipedia.org/wiki/Methods_of_contour_integration#Example_1
$\int_{-\infty}^\infty \frac{1}{\left(x^2+1\right)^2}\,dx$
I understand this part
$f(z)=\frac{1}{\left(z^2+1\right)^2}$
$f(z)=\frac{\frac{1}{(z+i)^2}}{(z-i)^2}$
but am confused here :
$\oint_C f(z)\,dz = \oint_C \frac{\frac{1}{(z+i)^2}}{(z-i)^2}\,dz = 2\pi i \frac{d}{dz} \left(\frac{1}{(z+i)^2}\right)\Bigg|_{z=i} =2 \pi i \left(\frac{-2}{(z+i)^3}\right)\Bigg|_{z = i} =\frac{\pi}{2}$
How does taking the contour of the fraction lead to having to take a derivative later? Why does the integral go away? Is there some step missing?
Cauchy integral formula
$\oint_C \frac {f(z)}{z-a} dz = 2\pi i f(a)$
and
$\oint_C \frac {f(z)}{(z-a)^n} dz = 2\pi i \frac {f^{(n-1)}(a)}{(n-1)!}$
You probably have a much better proof in your book, then I am going to be able to write up here..