Derivation (separation of variables on a 2D annulus)
In polar coordinates $(r,\theta)$, Laplace's equation is $$ \begin{align*} \frac{1}{r}\pdd{r}\left(r \pdfd{\phi}{r}\right) + \frac{1}{r^2} \pdfd[2]{\phi}{\theta} = 0. \end{align*} $$ Substituting $\phi = R(r) \Theta(\theta)$ and multiplying by $r^2/\phi$, we get $$ \begin{align*} \frac{r(r R')'}{R} + \frac{\Theta''}{\Theta} = 0. \end{align*} $$ Since $r$ and $\theta$ are independent, each term must be a constant, so $$ \begin{align*} \begin{cases} r(rR')' = \lambda R,\\ \Theta'' + \lambda \Theta = 0. \end{cases} \end{align*} $$ For the equation for $\Theta$, the general solution is $$ \begin{align*} \Theta(\theta) = C\cos(\sqrt{\lambda}\, \theta) + D\sin(\sqrt{\lambda}\, \theta). \end{align*} $$ Since $\theta$ is angular, we require $\Theta(\theta+2\pi) = \Theta(\theta)$ for all $\theta$, so $$ \begin{align*} 2\pi\sqrt{\lambda} \in 2\pi\Z \implies \lambda=\lambda_n := n^2, \qquad n=0,1,2,\ldots. \end{align*} $$ Therefore $$ \begin{align*} \Theta_n(\theta) = C_n \cos(n\theta) + D_n\sin(n\theta). \end{align*} $$
Now the equation for $R$ becomes $$ \begin{align*} r(rR')' = n^2 R. \end{align*} $$ For $n\neq 0$, since this is equidimensional, guess $R \propto r^\beta$, and we get $$ \begin{align*} \beta^2 = n^2 \implies \beta = \pm n \end{align*} $$ so the solution is $$ \begin{align*} R_n = A_n r^n + \frac{B_n}{r^n}. \end{align*} $$ And if $n=0$, the solution is $$ \begin{align*} R_0 = A + B\log r. \end{align*} $$ Therefore $R_n(r) \Theta_n(\theta)$ all solve Laplace's equation, so by superposition, so does $$ \begin{align*} \phi(r,\theta) = A + B\log r + \sum_{n=1}^{\infty} \left[\left(A_n r^n + \frac{B_n}{r^n}\right)\left(C_n \cos(n\theta) + D_n \sin(n\theta)\right)\right]. \end{align*} $$