How to evaluate $\frac{1}{2\pi}\int_0^{2\pi}\log\left\lvert re^{it}-\zeta\right\rvert\,dt$? 
Prove that if $\zeta \in \mathbb{C}$ and $r>0$ then 
  $$
\frac{1}{2\pi}\int_0^{2\pi}\log\left\lvert re^{it}-\zeta\right\rvert\,dt = \log \left\lvert\zeta\right\rvert\,
$$ if $\,r\leq \left\lvert\zeta\right\rvert$, and it is $\,\log r\,$ if $\,r> \left\lvert\zeta\right\rvert$.


My Try:
First I consider the case where $\zeta=0$. Then we have only the case where $r>\left\lvert\zeta\right\rvert$. Then the result is obvious.
Now suppose $\zeta\neq 0$. Then $\left\lvert\zeta\right\rvert>0$. Suppose $0<r'<\left\lvert\zeta\right\rvert$. 
Let $u\left(z\right)=\log\left\lvert z\right\rvert$ for $z\in \mathbb{C}$.
Then $u\left(-\zeta\right)>-\infty$. So $u\left(z\right)$ is harmonic near $-\zeta$. So there is $\rho>0$ $(\rho$ depends on $-\zeta)$ such that $u\left(-\zeta\right)=\log\left\lvert\zeta\right\rvert=\frac{1}{2\pi}\int_0^{2\pi}\log\left\lvert re^{it}-\zeta\right\rvert \, dt\,$ for all $0\leq r<\rho$. Now if $r'<\rho$ then we are done. But what if $r'>\rho$? That is the place where I stuck. Can somebody please help me to solve it? Moreover, I don't know how to handle the case where $r'=\left\lvert\zeta\right\rvert$ for the original problem. 
 A: This is a rare case where Riemann sums can be used to evaluate
a definite integral of something other than a polynomial.
For $|\zeta| \neq r$, the integral
$\frac1{2\pi}\int_0^{2\pi}\log\left|re^{it}-\zeta\right|\,dt$
is the limit as $N \to \infty$ of
$$
\frac1N \sum_{n=0}^{N-1} \log \left| r e^{2\pi i n/N} - \zeta \right|
= \frac1N \log \Bigl| \, \prod_{n=0}^{N-1} (r e^{2\pi i n/N} - \zeta) \, \Bigr|.
$$
Now $e^{2\pi i n/N}$ varies over the $N$-th roots of unity as
as $n$ varies over $0, 1, \ldots, N-1$.  Hence
$$ 
\prod_{n=0}^{N-1} (r e^{2\pi i n/N} - \zeta)
= \prod_{w^n = 1} (r w - \zeta) = \pm \left( (rw)^n - \zeta^n \right).
$$
Hence our integral is
$$
\lim_{N \to \infty}
\frac1N \log \bigl| (rw)^n - \zeta^n \bigr|.
$$
This limit is readily seen to equal $r$ if $|\zeta|<r$ and $|\zeta|$ if
$|\zeta|>r$.  For $|\zeta|=r$ the integral equals both $r$ and $|\zeta|$, 
as can be proved either using a limiting argument (as suggested above)
or by adapting the Riemann-sum method to that case.
Added later: Here's an amusing route to the $|\zeta|=r$ case.
Since then $\zeta = r e^{i\theta}$ for some real $\theta$,
we can use the change of variable $t = \theta + \tau$ to reduce
the problem to proving that
$$
\int_0^{2\pi} \log \, \left| e^{i\tau} - 1 \right| \, d\tau = 0
$$
(which is the special case $r=\zeta=1$).
Call the integral $I$.  Then the change of variable
$\tau \leftarrow \tau+\pi$ shows that
$$
I = \int_0^{2\pi} \log \, \left| e^{i\tau} + 1 \right| \, d\tau.
$$
But then
$$
2I = I + I = 
\int_0^{2\pi}
  \left( \log \, \left| e^{i\tau} - 1 \right|
  + \log \, \left| e^{i\tau} + 1 \right|
    \,  \right)\, dt
 = \int_0^{2\pi} \log \, \left| e^{2i\tau} - 1 \right| \, dt.
$$
But that's also $I$, via the further change of variable 
$\tau \leftarrow \tau/2$:
$$  
 \int_0^{2\pi} \log \, \left| e^{2i\tau} - 1 \right| \, dt
 = \frac12 \int_0^{4\pi} \log \, \left| e^{i\tau} - 1 \right| \, dt
 = \frac12 \left( \int_0^{2\pi} \cdots \, dt
  + \int_{2\pi}^{4\pi} \cdots \, dt \right)
 = \frac12(I+I) = I.
$$
Hence $2I=I$, so $I=0$ as claimed.
A: When $r\neq|\zeta|$, what you need is the Jensen's formula:

Suppose that $f$ is an analytic function in a region in the complex plane which contains the closed disk $D=\overline{B(0,r)}$ about the origin, $a_1, a_2, \cdots, a_n$ are the zeros of $f$ in the interior of $D$ repeated according to multiplicity, and $f(0)\neq 0$. Jensen's formula states that
  $$
{\displaystyle \log |f(0)|=\sum _{k=1}^{n}\log \left({\frac {|a_{k}|}{r}}\right)+{\frac {1}{2\pi }}\int _{0}^{2\pi }\log |f(re^{i\theta })|\,d\theta \tag{*}}
$$

You would get the desired identities by considering now $f(z)=z-\zeta$. If $r<|\zeta|$, then the first term on the RHS of $(*)$ would be $0$ since $f$ has no zeros in the interior of $D$. If $r>|\zeta|$, then $f$ has $\zeta$ as its only zero in $D$ and the first term becomes $\log|\zeta|-\log r$. 
When $r=|\zeta|$, you need a appropriate definition first for your integral
$$
\int_0^{2\pi}\log|re^{it}-\zeta|\ dt
$$
due to the singularity on the boundary of $D$.
A: If $\,\left\lvert\zeta\right\rvert<r$ then $\left\lvert re^{it}-\zeta\right\rvert = \big\lvert re^{-it}-\overline\zeta\big\rvert = \big\lvert r-\overline\zeta e^{it}\big\rvert$, so we can apply the mean value property for $z\mapsto \log\big\lvert r-\overline{\zeta}z\big\rvert$ and obtain 
$\displaystyle\frac1{2\pi}\int = \log\big\lvert r-\overline{\zeta}\cdot0\big\rvert = \log r$.
As mentioned in the comments, $\left\lvert \zeta\right\rvert=r$ can be considered a limit case.
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Leftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\, #2 \,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
Lets $\ds{\quad\zeta \equiv a + b\ic\,,\quad a, b\ \in\ \mathbb{R}}$ and let
$$
\mathrm{f}\pars{\zeta,\zeta^{*}} \equiv
{1 \over 2\pi}\int_{0}^{2\pi}\ln\pars{\verts{r\expo{\ic t} -\zeta}}\,\dd t =
{1 \over 4\pi}\int_{0}^{2\pi}\ln\pars{%
\bracks{r\expo{\ic t} -\zeta}\bracks{r\expo{-\ic t} -\zeta^{*}}}\,\dd t
$$
such that
\begin{align}
\partiald{\mathrm{f}\pars{\zeta,\zeta^{*}}}{\zeta} & =
-\,{1 \over 4\pi}\int_{0}^{2\pi}{\dd t \over r\expo{\ic t} - \zeta} =
-\,{1 \over 4\pi\ic}\oint_{\verts{z} = r}{\dd z \over z\pars{z - \zeta}}
\\[3mm] = &\
\left\lbrace\begin{array}{lcrcl}
\ds{\underbrace{{1 \over 2\zeta} + \pars{- {1 \over 2\zeta}}}_{\ds{=\ 0}}} & \mbox{if} & \ds{\verts{\zeta}} & \ds{<} & \ds{r}
\\[3mm]
\ds{{1 \over 2\zeta}} & \mbox{if} & \ds{\verts{\zeta}} & \ds{>} & \ds{r}
\end{array}\right.
\end{align}
Similarly,
\begin{align}
\partiald{\mathrm{f}\pars{\zeta,\zeta^{*}}}{{\zeta^{*}}} & =
\left\lbrace\begin{array}{lcrcl}
\ds{0} & \mbox{if} & \ds{\verts{\zeta}} & \ds{<} & \ds{r}
\\[3mm]
\ds{{1 \over 2\zeta^{*}}} & \mbox{if} & \ds{\verts{\zeta}} & \ds{>} & \ds{r}
\end{array}\right.
\end{align}


*

*
Obviously,
$\ds{\left.\vphantom{\LARGE A}
\mathrm{f}\pars{\zeta,\zeta^{*}}\right\vert
_{\ \color{#f00}{\verts{\zeta}\ <\ r}} = \mathrm{f}\pars{0,0} = \color{#f00}{\ln\pars{r}}}$. 


*
In addition,
$\ds{\left.\vphantom{\LARGE A}\mathrm{f}\pars{\zeta,\zeta^{*}}\right\vert
_{\ \color{#f00}{\verts{z}\ >\ r}} = \half\,\ln\pars{\zeta\zeta^{*}} = \color{#f00}{\ln\pars{\verts{\zeta}}}}$.


