Solution (source code)

= Solution

At a finite potential step, both $u$ and $u'$ are continuous:
$$
A\sin(k'a)=B\sin(ka+\delta_0),\qquad
Ak'\cos(k'a)=Bk\cos(ka+\delta_0).
$$
Taking the <logarithmic derivative> eliminates the amplitudes:
$$
\boxed{k'a\cot(k'a)=ka\cot(ka+\delta_0).}
$$
At a zero of a denominator, the original two matching equations provide the continuous limiting condition.