Axisymmetric harmonic extension from a sphere (source code)

= Axisymmetric harmonic extension from a sphere
{title2=$\Psi_{\rm in}=\sum_\ell f_\ell(r/a)^\ell P_\ell,\quad\Psi_{\rm out}=\sum_\ell f_\ell(a/r)^{\ell+1}P_\ell$}

For boundary data $f(u)$ on the sphere $r=a$, with $u=\cos\theta$, define its <Legendre polynomial> coefficients by $f_\ell=(2\ell+1)\int_{-1}^1f(u)P_\ell(u)\,du/2$. <Separation of variables> in the <Laplace equation> gives radial factors $r^\ell$ and $r^{-\ell-1}$. Regularity at the origin selects the first for the interior <Dirichlet problem>; decay at infinity selects the second for the exterior problem. Matching each boundary coefficient gives the displayed <series>. For continuous boundary data the resulting <harmonic functions> attain those data, with convergence interpreted through their harmonic extension rather than requiring uniform convergence of the unweighted boundary series. The <maximum principle for harmonic functions> proves uniqueness in the bounded interior and decaying exterior classes.