What I am interested in is finding a closed form solution to the following integral:
$$\int_{-1}^{1}\frac{\sqrt{1-x^2}}{1+x^2}dx$$
My approach so far is as follows:
Let us consider $\Gamma = \gamma_1+\gamma_2$ where $\gamma_1$ is the path defined on the real axis from $-1$ to $1$. $\gamma_2$ is defined as $\textbf{not sure...}$. Thus, by the Residual Theorem, (under the assumption that our contour is in the upper half plane), we have:
$$\int_{\Gamma}f=2\pi i \text{Res}(f;i)=2\pi i \bigg( \frac{\sqrt{2}}{2i}\bigg)=\pi \sqrt{2}$$
And with the help of Mathematica, one finds that:
$$\int_{-1}^{1}\frac{\sqrt{1-x^2}}{1+x^2}dx=\pi(\sqrt{2}-1)$$
Naturally, I'm simply stuck on defining the contour to yield a nice integral to which should evaluate to $\pi$. From my understanding, defining $\gamma_2 = e^{it}, t\in [0, \pi]$ will not work since $i$ lies on such a contour.
Let $f(z)=\frac{\sqrt{1-z^2}}{1+z^2}$. Analyze the contour integral
$$I=\oint_C \frac{\sqrt{1-z^2}}{1+z^2}\,dz$$
where $C$ is the classical "dog-bone" or "dumbbell" contour.
Then, accounting for the residues from the poles at $z=\pm i$ and the Residue at Infinity we have
$$ \begin{align} I&=2\int_{-1}^{1}\frac{\sqrt{1-x^2}}{1+x^2}\,dx\\\\ &=2\pi i \text{Res}\left(\frac{\sqrt{1-z^2}}{1+z^2}, z=\pm i,\infty\right)\\\\ &=2\pi i \left(\frac{\sqrt 2}{2i}+\frac{-\sqrt 2}{-2i}+i\right)\\\\ &=2\pi \left(\sqrt 2 -1\right) \end{align}$$
whereupon dividing by $2$ yields the coveted integral
$$\int_{-1}^1 \frac{\sqrt{1-z^2}}{1+z^2}\,dz=\pi(\sqrt 2 -1)$$
as was to be shown!
Instead of appealing to the residue at infinity, we can alternatively and equivalently analyze the integral of $\frac{\sqrt{1-z^2}}{1+z^2}$ around $C$, where $C$ is a circle of radius $R$, centered at the origin and let $R\to \infty$. Then, we have
$$\begin{align} \lim_{R\to \infty}\oint_{|z|=R}\frac{\sqrt{1-z^2}}{1+z^2}\,dz&=\lim_{R\to \infty}\int_0^{2\pi}\frac{\sqrt{1-R^2e^{i2\phi}}}{1+R^2e^{i\phi}}\,iRe^{i\phi}\,d\phi\\\\ &=2\pi\\\\ &=2\pi i \text{Res}\left(\frac{\sqrt{1-z^2}}{1+z^2},z=\pm i\right)-2\int_{-1}^1\frac{\sqrt{1-x^2}}{1+x^2}\,dx \end{align}$$
whereupon solving for the integral of interest yields the expected result!