Solution (source code)

= Solution

For <S-wave scattering>, write the radial wavefunction as $R_0(r)=u(r)/r$. In the attractive shell $a<r\leq2a$, the hard-core boundary condition $u(a)=0$ gives
$$
u_{\mathrm{in}}(r)=A\sin[\kappa(r-a)],
\qquad
\kappa^2=k^2+\frac{2mV_0}{\hbar^2}.
$$
Outside the potential, choose
$$
u_{\mathrm{out}}(r)=B\sin(kr+\delta_0).
$$
Continuity of the logarithmic derivative at $r=2a$ yields
$$
\kappa\cot(\kappa a)
=k\cot(2ka+\delta_0).
$$
Put $C=\kappa\cot(\kappa a)$. The <tangent addition formula> gives
$$
\tan(2ka+\delta_0)=\frac{k}{C},
$$
and solving for $\tan\delta_0$ gives
$$
\tan\delta_0
=\frac{k-C\tan(2ka)}{C+k\tan(2ka)}
=\boxed{
\frac{k\cos(2ka)-\kappa\cot(\kappa a)\sin(2ka)}
{k\sin(2ka)+\kappa\cot(\kappa a)\cos(2ka)}}.
$$