How do i evaluate the following integral? Hi I was wondering if someone can help me evaluate the following integral.
Show that if $-1 < x < 1$, then
$$\int_{0}^{\pi} \frac{\log{(1+x\cos{y})}}{\cos{y}}dy= \pi \arcsin{x} $$
thank you in advance.
 A: Probably the most direct way to do this is by infinite series: expanding the logarithm, and interchanging the sum and integral, we have
$$ I := \int_0^{\pi} \frac{\log{(1+x\cos{y})}}{\cos{y}} \, dy = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}x^n}{n} \int_0^{\pi} \cos^{n-1}{y} \, dy. $$
Firstly, note that $n-1$ has to be even for the integral to be nonzero, since $\cos{(\pi-y)}=-\cos{y}$. Therefore the sum is actually
$$ \sum_{k=0}^{\infty} \frac{x^{2k+1}}{2k+1} 2\int_0^{\pi/2} \cos^{2k}{y} \, dy $$
Now we have to do the integral. Thankfully, Wallis was there before us, and the answer is
$$ 2\int_0^{\pi/2} \cos^{2k}{y} \, dy = \frac{(2k)!}{2^{2k}(k!)^2} \pi. $$
Finally, identification of the power series,
$$ \pi \sum_{k=0}^{\infty} \frac{x^{2k+1}}{2k+1} \frac{(2k)!}{2^{2k}(k!)^2} $$
is required. Well, what does the series for $\arcsin{x}$ look like? It's the integral of the series of $(1-x^2)^{-1/2}$, so should contain coefficients of the form
$$ \frac{(-1)^k}{2k+1} \binom{-1/2}{k}, $$
so we just have to check that
$$ (-1)^k \binom{-1/2}{k} = \frac{(2k)!}{2^{2k}(k!)^2} \tag{1} $$
to show that the series we have is that of $\arcsin{x}$. At this point I'm going to cheat a bit more: first, note that both sides of (1) are equal (to $1$) if $k=0$. Now look at the ratio of the $k$th to $(k+1)$th terms:
$$ \frac{(-1)^{k+1} \binom{-1/2}{k+1}}{(-1)^k \binom{-1/2}{k}} = \frac{-(-1/2-k)}{k+1} = \frac{2k+1}{2(k+1)}, \\
\frac{(2(k+1))!/(2^{2(k+1)}((k+1)!)^2)}{(2k)!/(2^{2k}(k!)^2)} = \frac{(2k+2)(2k+1)}{(2(k+1))^2} = \frac{2k+1}{2(k+1)},
 $$
and so by induction they are equal for all $k>0$, and hence
$$ I = \pi \sum_{k=0}^{\infty} \frac{x^{2k+1}}{2k+1} \frac{(2k)!}{2^{2k}(k!)^2} = \pi \arcsin{x}. $$
A: Setting
$$
f(x)=\int_0^\pi\frac{\log(1+x\cos y)}{\cos y}\,dy, \quad x\in (-1,1),
$$
we have $f(0)=0$, and 
$$
f'(x)=\int_0^\pi\frac{\cos y}{(1+x\cos y)\cos y}\,dy=\int_0^\pi\frac{1}{1+x\cos y}\,dy\quad \forall x\in (-1,1)
$$
Setting
$$
t=\tan\frac{y}{2},
$$
we have
$$
y=2\arctan t,\, \frac{1}{1+x\cos y}=\frac{1}{1+x\frac{1-t^2}{1+t^2}}=\frac{1+t^2}{1+x+(1-x)t^2} \,\mbox{ and } \, dy=2\frac{dt}{1+t^2}.
$$
Now, for every $x\in (-1,1)$ we get:
\begin{eqnarray}
f'(x)&=&\int_0^\infty\frac{1+t^2}{1+x+(1-x)t^2}\cdot\frac{2}{1+t^2}\,dt=\frac{2}{1-x}\int_0^\infty\frac{1}{(1+x)(1-x)^{-1}+t^2}\,dt\\
&=&\frac{2}{\sqrt{1-x^2}}\arctan\left(\frac{t}{\sqrt{(1+x)(1-x)^{-1}}}\right)\Big|_0^\infty=\frac{2}{\sqrt{1-x^2}}\cdot\frac\pi2=\frac{\pi}{\sqrt{1-x^2}}.
\end{eqnarray}
Since $f(0)=0$, we deduce that
$$
\int_0^\pi\frac{\log(1+x\cos y)}{\cos y}\,dy=f(x)=f(0)+\int_0^xf'(\xi)\,d\xi=\int_0^x\frac{\pi}{\sqrt{1-\xi^2}}\,d\xi=\pi\arcsin x.
$$
