Solution (source code)

= Solution

Apply <separation of variables> to the <Laplace equation in polar coordinates> by writing $\phi(r,\theta)=R(r)\Theta(\theta)$. Division by $R\Theta$ gives
$$
\frac{r(rR')'}R=-\frac{\Theta''}{\Theta}=n^2.
$$
The requirement that $\Theta$ be a real $2\pi$-<periodic function> restricts the separation constants to $n^2$, with angular factors $\cos(n\theta)$ and $\sin(n\theta)$. For $n\geq1$, the radial <ordinary differential equation> is an Euler equation with solutions $r^n$ and $r^{-n}$. For the zero mode, $\Theta$ is constant and
$$
(rR')'=0,
$$
so $R=a_0+c_0\log r$. By <linearity>, superposition gives
$$
\boxed{
\begin{aligned}
\phi(r,\theta)
={}&a_0+c_0\log r\\
&+\sum_{n=1}^{\infty}(a_nr^n+c_nr^{-n})\cos(n\theta)\\
&+\sum_{n=1}^{\infty}(b_nr^n+d_nr^{-n})\sin(n\theta).
\end{aligned}
}
$$
This is the separated expansion of a <harmonic function> in a circular region.