<s>[INST] Contour integration of $\int_{-\infty}^{\infty} \frac{1-b+x^2}{(1-b+x^2)^2 + 4bx^2}dx = \pi$ Given $0< b <1$, derive the equality:
$\displaystyle \int_{-\infty}^{\infty} \frac{1-b+x^2}{(1-b+x^2)^2 + 4bx^2}dx = \pi$
by integrating the function $(1+z^2)^{-1}$ around the rectangle with  vertices $R, -R, R+i\sqrt{b}, -R+i\sqrt{b}$ for $R>0$ and taking $R \to \infty$. What happens if $b>1$?
Could you give me some help with the 4 integrals that I should evaluate? Also, if there is any other trick I would appreciate it if could give me some help.
 [/INST] Note
$$ (1-b+x^2)^2+4bx^2=(1-b+x^2+2\sqrt{b}xi)(1-b+x^2-2\sqrt{b}xi)=[(x+\sqrt bi)^2+1][(x+\sqrt bi)^2+1] $$
and hence
$$ \frac{1-b+x^2}{(1-b+x^2)^2+4bx^2}=\frac12\left(\frac{1}{(x+\sqrt bi)^2+1}+\frac{1}{(x+\sqrt bi)^2+1}\right). $$
It is easy to use contour integral to check
$$ \int_{-\infty}^\infty \frac{1}{(x+\sqrt bi)^2+1}dx=\int_{-\infty}^\infty \frac{1}{(x-\sqrt bi)^2+1}dx=\int_{-\infty}^\infty\frac{1}{x^2+1}dx=\pi.$$
Thus
$$ \int_{-\infty}^\infty \frac{1-b+x^2}{(1-b+x^2)^2+4bx^2}dx=\pi.$$
</s>