Spherical harmonic matching with a derivative jump (source code)

= Spherical harmonic matching with a derivative jump
{title2=$\Phi_n^{\rm in}=a_nr^nP_n,\quad\Phi_n^{\rm out}=a_nr^{-n-1}P_n$}

For a regular interior and a decaying exterior harmonic potential with continuous values on the unit sphere, the same coefficient multiplies the two radial branches of each <Legendre polynomial> mode. Its exterior-minus-interior radial derivative is $-(2n+1)a_nP_n$. Thus an axisymmetric prescribed jump $j_nP_n(\cos\theta)$ produces coefficient $a_n=-j_n/(2n+1)$. This diagonal matching rule reduces a spherical interface problem to its angular-mode coefficients.