Direct proof that $\frac{1}{\sqrt{1-x}} = \frac{1}{2\pi}\int_0^{2\pi} \frac{d\theta}{1-x\cos^2\theta}$? In a totally indirect way, I've proven to myself that
$$\frac{1}{\sqrt{1-x}} = \frac{1}{2\pi}\int_0^{2\pi} \frac{d\theta}{1-x\cos^2\theta}.$$
The proof was by expanding the integrand as a power series in $x\cos^2\theta$, integrating term-by-term, and comparing to the binomial expansion of the left side.
But I would like a direct proof. Do you know one? I would be happy either with a method based on antidifferentiation, or a contour integral, or a double integral resulting from squaring, or some other method I haven't thought of. I am just trying to avoid the power series in $x$.

Here's the contour integral solution:
$$
\cos\theta=\frac{z+1/z}{2},
$$
where $z$ is belongs to the unit circle $C_1=\{z\in\mathbb C:\ z=e^{i\theta}\}$
and $d\theta=-i\,dz/z$ so
$$
\int_0^{2\pi}\frac{d\theta}{1-x\cos^2\theta}=\oint_{C_1}\frac{i4zdz}{xz^4+2(x-2)z^2+x}.
$$
If $x=0$, we get $-i\int_{C_1}dz/z=2\pi$. Otherwise, the  roots of the denominator are at
$$
z^2=\frac{2-x\pm2\sqrt{1-x}}{x}=\frac{1}{x}\left(1\pm\sqrt{1-x}\right)^2,
$$
thus, $$z_1^\pm=\frac{1\pm\sqrt{1-x}}{\sqrt{x}},\qquad z_2^\pm=-\frac{1\pm\sqrt{1-x}}{\sqrt{x}}.$$
For $0<x<1$, only $z_1^-$ and $z_2^-$ fall within the unit circle and the residue formula gives
$$
-8\pi\left[\frac{1}{4x(z_1^-)^2+4(x-2)}+\frac{1}{4x(z_2^-)^2+4(x-2)}\right]=-2\pi\frac{2}{-2\sqrt{1-x}}=\frac{2\pi}{\sqrt{1-x}}.
$$
