Solution (source code)

= Solution

Write $\psi=Ce^{i\alpha x}+De^{-i\alpha x}$ inside the barrier. Matching the <wavefunction> and derivative gives the four equations
$$
\boxed{A+B=C+D,\qquad k(A-B)=\alpha(C-D),}
$$
$$
\boxed{Ce^{i\alpha a}+De^{-i\alpha a}=Fe^{ika},\qquad \alpha(Ce^{i\alpha a}-De^{-i\alpha a})=kFe^{ika}.}
$$
For sub-barrier energy the same equations hold by analytic continuation to imaginary $\alpha$. No coefficient solution is needed for these matching conditions.