Solution
= Solution
Cauchy’s formula is $f(w)=(2\pi i)^{-1}\int_\gamma f(z)/(z-w)\,dz$, proved by removing the removable singularity of $[f(z)-f(w)]/(z-w)$ and applying Cauchy’s theorem; similarly $f\prime(w)=(2\pi i)^{-1}\int f(z)/(z-w)^2dz$. The resulting estimates prove Liouville’s theorem. Finally $\cos^2x=(1+\cos2x)/2$ and residues in the upper half-plane give $\int_{-\infty}^\infty\cos^2x/(x^2+1)dx=\frac\pi2(1+e^{-2})$.