= Solution
For a radial <electric potential>, $\mathbf E=-V'(r)\mathbf r/r$. Comparing radial coefficients gives
$$
V'_{\rm in}(r)=\frac{kr}{a^3},\qquad V'_{\rm out}(r)=\frac{k}{r^2}.
$$
Integrating these one-variable <derivatives> gives the general local expressions
$$
\boxed{V_{\rm in}(r)=\frac{kr^2}{2a^3}+C_{\rm in},\qquad
V_{\rm out}(r)=-\frac kr+C_{\rm out}}.
$$
The two constants are initially independent because these integrations were performed in separate radial regions.
Back to article page