Solution (source code)

= Solution

On the slit plane $\mathbb C\setminus[-a,a]$, choose
$$
F(z)=\sqrt{z-a}\sqrt{z+a}
$$
so that $F(z)\sim z$ as $z\to\infty$. This <branch cut> gives, for $-a<x<a$, the boundary values
$$
F_+(x)=i\sqrt{a^2-x^2},
\qquad
F_-(x)=-i\sqrt{a^2-x^2}.
$$

Integrate $F$ over the boundary of a large disk with a thin slit removed. The upper bank is traversed from $-a$ to $a$ and the lower bank from $a$ to $-a$, so together they contribute
$$
2i\int_{-a}^{a}\sqrt{a^2-x^2}\,dx.
$$
At infinity the <Laurent series> is
$$
F(z)=z\left(1-\frac{a^2}{z^2}\right)^{1/2}
=z-\frac{a^2}{2z}+O(z^{-3}),
$$
and hence the counterclockwise large-circle integral tends to $-\pi i a^2$. By the <Cauchy integral theorem>, the large-circle and slit-boundary contributions sum to zero. Therefore
$$
-\pi i a^2+2i\int_{-a}^{a}\sqrt{a^2-x^2}\,dx=0,
$$
which yields
$$
\boxed{\int_{-a}^{a}\sqrt{a^2-x^2}\,dx=\frac{\pi a^2}{2}.}
$$