Integrate $\int_{0}^{2\pi}\log|1-e^{i\theta}| d\theta$ Here is exercise 11, chapter 3 from Stein & Shakarchi's Complex Analysis II:
Show that if $|a|<1$, then:
$$\int_{0}^{2\pi}\log|1-ae^{i\theta}|\,d\theta = 0$$
Then, prove that the above result remains true if we assume only that $|a|\leq 1.$
($a\in \mathbb{C}$)
I've already proved it for $|a|<1$, but couldn't make it for $|a|=1$, which I thought would be the easy part. But the only thing I could come up with was that, WLOG, it is enough to prove that:
$$\int_{0}^{2\pi}\log|1-e^{i\theta}|\,d\theta = 0$$
Tried to look for some kind of symmetry, but could't find it. Any ideas? Thanks!
 A: Note that for $|a|=1$, we can write $a=e^{i\psi}$.  Then, exploiting the $2\pi$-periodicity of the integrand, we have
$$\begin{align}
\int_{-\pi}^\pi \log|1-ae^{i\theta}|\,d\theta&=\int_{-\pi}^\pi \log|1-e^{i(\theta+\psi)}|\,d\theta\\\\
&=\int_{-\pi+\psi}^{\pi+\psi} \log|1-e^{i\theta}|\,d\theta\\\\
&=\int_0^{2\pi}\log|1-e^{i\theta}|\,d\theta
\end{align}$$
METHODOLOGY 1:
Note that we have $|1-e^{i\theta}|=\sqrt{2(1-\cos(\theta))}=2|\sin{\theta/2}|$.  Now, we have
$$\int_0^{2\pi}\log|1-e^{i\theta}|\,d\theta=4\int_0^{\pi/2}\log(2\sin(\theta))\,d\theta=0$$
since $\int_0^{\pi/2}\log(\sin(\theta))\,d\theta=-\frac{\pi}{2}\log(2)$

METHODOLOGY 2:
Now, we cut the complex plane with a line from $(1,0)$ and extending along the positive real axis.  
Note that $\log(1-z)$ is analytic within and on a closed contour $C$ defined by $z=e^{i\phi}$ for $\epsilon \le \phi \le 2\pi -\epsilon$, and $z=1+2\sin(\epsilon/2) e^{i\nu}$ for $\pi/2 + \gamma \le \nu \le 3\pi/2 -\gamma$, where $
\cos(\gamma)=\frac{\sin \epsilon}{\sqrt{2(1-\cos \epsilon)}}$ and $0 \le \gamma <2\pi$ on this branch of $\gamma$.
Then, from the residue theorem, we have 
$$\int_C  \frac{\log(1-z)}{z}dz=2\pi i \log(1-0)=0$$
which implies 
$$\begin{align}
\int_C \frac{\log(1-z)}{z} dz&=\int_{\epsilon}^{2\pi-\epsilon} \log(1-e^{i\phi})i d\phi+\int_{3\pi/2-\gamma}^{\pi/2+\gamma} \frac{\log(-2\sin(\epsilon/2) e^{i\nu})}{1+2\sin(\epsilon/2) e^{i\nu}}i2\sin(\epsilon/2) e^{i\nu}d\nu\\\\
&=i\int_{\epsilon}^{2\pi-\epsilon} \log(1-e^{i\phi}) d\phi+ i2\sin(\epsilon/2)  \int_{3\pi/2-\gamma}^{\pi/2+\gamma} \frac{\log(-2\sin(\epsilon/2)e^{i\nu})e^{i\nu}d\nu}{1+2\sin(\epsilon/2)e^{i\nu}}   \\\\
&=i\int_{\epsilon}^{2\pi-\epsilon} \log|1-e^{i\phi}| d\phi -i \int_{\epsilon}^{2\pi-\epsilon} \arctan \left(\frac{\sin \phi}{1-\cos \phi}\right)d\phi \\\\
&+ i2\sin(\epsilon/2)  \int_{3\pi/2-\gamma}^{\pi/2+\gamma} \frac{\log(-2\sin(\epsilon/2)e^{i\nu})e^{i\nu}d\nu}{1+2\sin(\epsilon/2)e^{i\nu}}   \\\\
&=0
\end{align}$$
As $\epsilon \to 0$ the first term on the RHS approaches $i$ times the integral of interest.  The second term approaches zero since $\arctan(\frac{\sin \phi}{1-\cos \phi})$ is an odd, $2\pi$-periodic function of $\phi$ and the integration extends over the entire period.  And the last term approaches $0$ since $x\log x \to 0$ as $x \to 0$.  Thus, the integral of interest is zero!
A: I'll plod on and see
what happens.
We want to show that
$\int_{0}^{2\pi}\log|1-e^{it}|dt 
= 0
$.
$\begin{array}\\
|1-e^{it}|
&=|1-\cos(t)-i\sin(t)|\\
&=\sqrt{(1-\cos(t))^2+\sin^2(t)}\\
&=\sqrt{1-2\cos(t)+\cos^2(t)+\sin^2(t)}\\
&=\sqrt{2-2\cos(t)}\\
&=\sqrt{2(1-\cos(t))}\\
&=\sqrt{2(2\sin^2(t/2))}\\
&=2\sin(t/2)
\qquad\text{if }0 \le t \le 2\pi\\
\end{array}
$
so
$\log|1-e^{it}|
=\log(2\sin(t/2))
$
so that
$\begin{array}\\
\int_{0}^{2\pi}\log|1-e^{it}|dt 
&=\int_{0}^{2\pi}\log(2\sin(t/2))dt\\
&=2\pi\log(2)+\int_{0}^{2\pi}\log(\sin(t/2))dt\\
&=2\pi\log(2)+2\int_{0}^{\pi}\log(\sin(t))dt\\
&=2\pi\log(2)+2(-\pi \log(2))
\qquad\text{according to Wolfy}\\
&=0\\
\end{array}
$
By Googling for
"integral with sine and log"
I got a number of references to
$\int_{0}^{\pi}\log(\sin(t))dt
=-\pi \log(2)
$
being a result of Euler
including this one:
http://www.ams.org/journals/proc/2005-133-05/S0002-9939-04-07863-3/S0002-9939-04-07863-3.pdf
(Added later)
According to that paper,
Euler proved his result
by using
$ \log(\sin x) 
= -\sum_{n=1}^{\infty} \dfrac{\cos(2nx)}{n}− \log 2
$
and
$\int_0^{\pi} \cos(2nx)dx
= 0
$.
