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$.
 A: 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}}.
$$
A: Here is another solution. Let $a, b > 0$ and consider the simple closed curve $\gamma$ parametrized by $(x, y) = (a\cos t, b\sin t)$ for $0\leq t \leq 2\pi$. Then
\begin{align*}
\int_{0}^{2\pi} \frac{dt}{a^2\cos^2 t + b^2\sin^2 t}
&= \frac{1}{ab} \int_{0}^{2\pi} \frac{(-b\sin t)(-a\sin t \, dt) + (a\cos t)(b\cos t \, d t)}{a^2\cos^2 t + b^2\sin^2 t} \\
&= \frac{1}{ab}\int_{\gamma} \frac{-y \, dx + x \, dy}{x^2+y^2}.
\end{align*}
Notice that our case corresponds to $(a, b) = (\sqrt{1-x}, 1)$. Now the last integral can be computed in various ways:
1st way. Denote by $C(\epsilon)$ the counter-clockwise oriented circle of radius $\epsilon$ centered at $0$. If $\epsilon$ is sufficiently so that $C(\epsilon)$ lies in the interior of $\gamma$, then by an application of the Green's theorem we have
$$ \int_{\gamma} \frac{-y \, dx + x \, dy}{x^2+y^2} = \int_{C(\epsilon)} \frac{-y \, dx + x \, dy}{x^2+y^2} = 2\pi. $$
2nd way. Let $z = x+iy$. Then it is easy to check that
$$ \int_{\gamma} \frac{-y \, dx + x \, dy}{x^2+y^2} = \operatorname{Im}\left( \int_{\gamma} \frac{dz}{z} \right) = 2\pi. $$
3rd way. Consider the polar coordinates $(x, y) = r(\cos\theta, \sin\theta)$. Then it is easy to check that
$$ d\theta = \frac{-y \, dx + x \, dy}{x^2+y^2} $$
and hence
$$ \int_{\gamma} \frac{-y \, dx + x \, dy}{x^2+y^2} = \int_{\gamma} d\theta = 2\pi. $$
(Although $\theta$ is not well-defined on all of $\Bbb{R}^2\setminus\{0\}$, this issue can be easily overcome by various means. For instance, we can split $\gamma$ into arcs on which polar coordinate change works well.)
A: $\cos^2{t}$ has period $\pi$, so the integral is the same as
$$ \frac{1}{\pi}\int_{-\pi/2}^{\pi/2} \frac{d\theta}{1-x\cos^2{\theta}} = \frac{1}{\pi}\int_{-\pi/2}^{\pi/2} \frac{\sec^2{\theta} \, d\theta}{\sec^2{\theta}-x}. $$
It's pretty obvious what to do now I've written it like this: put $t=\tan{\theta}$, and the integral becomes
$$ \frac{1}{\pi}\int_{-\infty}^{\infty} \frac{dt}{t^2+1-x}, $$
and then we know that this evaluates to $1/\sqrt{1-x}$ in the usual way.
