Showing that $\displaystyle\int_{-a}^{a} \frac{\sqrt{a^2-x^2}}{1+x^2}dx = \pi\left (\sqrt{a^2+1}-1\right)$. How can I show that $\displaystyle\int_{-a}^{a} \frac{\sqrt{a^2-x^2}}{1+x^2}dx = \pi\left(\sqrt{a^2+1}-1\right)$?

Let $x = a \sin(y)$. Then we have
$$\dfrac{\sqrt{a^2-x^2}}{1+x^2} dx = \dfrac{a^2 \cos^2(y)}{1+a^2 \sin^2(y)} dy $$
Hence,
$$I = \int_{-a}^{a}\dfrac{\sqrt{a^2-x^2}}{1+x^2} dx = \int_{-\pi/2}^{\pi/2} \dfrac{a^2 \cos^2(y)}{1+a^2 \sin^2(y)} dy $$
Hence,
$$I + \pi = \int_{-\pi/2}^{\pi/2} \dfrac{a^2 \cos^2(y)}{1+a^2 \sin^2(y)} dy + \int_{-\pi/2}^{\pi/2} dy = \int_{-\pi/2}^{\pi/2} \dfrac{1+a^2}{1+a^2 \sin^2(y)} dy\\ = \dfrac{1+a^2}2 \int_0^{2 \pi} \dfrac{dy}{1+a^2 \sin^2(y)}$$
Now $$\int_0^{2 \pi} \dfrac{dy}{1+a^2 \sin^2(y)} = \oint_{|z| = 1} \dfrac{dz}{iz \left(1 + a^2 \left(\dfrac{z-\dfrac1z}{2i}\right)^2 \right)} = \oint_{|z| = 1} \dfrac{4z^2 dz}{iz \left(4z^2 - a^2 \left(z^2-1\right)^2 \right)}$$
$$\oint_{|z| = 1} \dfrac{4z^2 dz}{iz \left(4z^2 - a^2 \left(z^2-1\right)^2 \right)} = \oint_{|z| = 1} \dfrac{4z dz}{i(2z + a(z^2-1))(2z - a(z^2-1))}$$
Now 
$$ \dfrac{4z}{(2z + a(z^2-1))(2z - a(z^2-1))} = \dfrac1{az^2 - a + 2z} - \dfrac1{az^2 - a - 2z}$$
$$\oint_{\vert z \vert = 1} \dfrac{dz}{az^2 - a + 2z} = \oint_{\vert z \vert = 1} \dfrac{dz}{a \left(z + \dfrac{1 + \sqrt{1+a^2}}a\right) \left(z + \dfrac{1 - \sqrt{1+a^2}}a\right)} = \dfrac{2 \pi i}{2 \sqrt{1+a^2}}$$
$$\oint_{\vert z \vert = 1} \dfrac{dz}{az^2 - a - 2z} = \oint_{\vert z \vert = 1} \dfrac{dz}{a \left(z - \dfrac{1 + \sqrt{1+a^2}}a\right) \left(z - \dfrac{1 - \sqrt{1+a^2}}a\right)} = -\dfrac{2 \pi i}{2 \sqrt{1+a^2}}$$
Hence,
$$\oint_{|z| = 1} \dfrac{4z dz}{i(2z + a(z^2-1))(2z - a(z^2-1))} = \dfrac{2 \pi i}i \dfrac1{\sqrt{1+a^2}} = \dfrac{2 \pi}{\sqrt{1+a^2}}$$
Hence, we get that
$$I + \pi = \left(\dfrac{1+a^2}2\right) \dfrac{2 \pi}{\sqrt{1+a^2}} = \pi \sqrt{1+a^2}$$
Hence, we get that
$$I = \pi \left(\sqrt{1+a^2} - 1 \right)$$
