Example (Laplace's equation with Dirichlet boundary conditions on 3D annulus)

Solve $$ \begin{align*} \begin{cases} \Delta\phi = 0, & r< 1, \\ \phi = f(\theta), &r=1. \end{cases} \end{align*} $$ Since $f$ has no $\varphi$-dependence, $\phi$ is axis-symmetric.

We use separation of variables and obtain $$ \begin{align*} \phi(r,\theta) = \sum_{n=0}^{\infty} \left(a_n r^n + \frac{\beta_n}{r^{n+1}}\right) P_n(\cos\theta). \end{align*} $$ Since 0 is in the domain, we have $\beta_n = 0$.

To satisfy $\phi = f(\theta)$ at $r=1$, we require $$ \begin{align*} f(\theta) = \sum_{n=0}^{\infty} a_n P_n(\cos\theta). \end{align*} $$

Recall that Legendre polynomials satisfy $$ \begin{align*} \int_{-1}^{+1} P_n(x) P_m(x) \d x = \frac{2}{2n+1} \delta_{nm}. \end{align*} $$ Making a substitution $x=\cos\theta$, $$ \begin{align*} \int_{0}^{\pi} P_n(\cos\theta) P_m(\cos\theta)\sin\theta \d \theta = \frac{2}{2n+1} \delta_{nm}. \end{align*} $$ Hence $$ \begin{align*} \int_{0}^{\pi} f(\theta) P_m(\cos\theta)\sin\theta \d \theta &= \sum_{n=0}^{\infty} a_n \int_{0}^{\pi} P_n \cos(\theta) P_m(\cos\theta) \sin\theta \d \theta \\ &= \frac{2}{2m+1} \alpha_m \\ \alpha_m &= \frac{2n+1}{2}\int_{0}^{\pi} f(\theta) P_n(\cos\theta)\sin\theta \d \theta \end{align*} $$