Substituting the wave function $Ae^{\pm iqx}$ into the Schrödinger equation gives the relation
\[ \frac{\hbar^2 q^2}{2ma} -U_0 = E = \frac{\hbar^2 k^2}{2ma},\]which is satisfied by $A e^{\pm iqx}$.
We found that the wave vector inside the well is greater than outside, which corresponds to the refractive index
\[ n= \sqrt{1+ \frac{2maU_0}{\hbar^2k^2}}.\]Then the problem under consideration is equivalent to the problem of interference in a thin film with thickness $a$ and refractive index $n$, i.e., a Fabry-Perot resonator.
Using an analogy with wave optics, we can solve the problem by considering the refraction and reflection of de Broglie waves at the boundaries of the interface (as is done for a Fabry-Perot resonator).
Instead, we will solve the problem straightforwardly by writing down a system of equations based on the boundary conditions:
\[\Psi_-(0) = \Psi_\mathrm{in}(0), \quad \Psi_-‘(0) = \Psi_\mathrm{in}’(0)\]
\[\Psi_+(a) = \Psi_\mathrm{in}(a), \quad \Psi_+(a) = \Psi_\mathrm{in}'(a)\]
In terms of $r$, $t$, $A$ and $B$, we get the following system:
\[\begin{cases} 1+r = A+B \\ k(-1+r) = q(A-B) \\ te^{-ika} = A e^{iqa} + Be^{-iqa} \\ -k te^{ika} = q(Ae^ {iqa} - B e^{-iqa}) \end{cases}\]
It can be solved as follows
Let's calculate $|t|^2$:
\[\begin{split}|t|^2 = t t^* = \frac{16k^2 q^2}{(k-q)^4 + (k+q)^4 - 2(k-q)^2(k+q)^2\cos 2qa } =\\= \frac{4k^2q^2}{4k^2q^2+ (k^2-q^2)^2 \sin^2 qa }\end{split}\]
To scetch the graph, first note that when $qa=\pi n$, the particle completely passes through the well. When $qa = \pi/2 + \pi n$,
\[|t|^2_\text{min} = \frac{4}{4+\frac{(k^2-q^2)^2}{k^2q^2}}=\frac{4}{4+\frac{C}{k^2(k^2+C)}},\]where $C=2maU_0/\hbar^2$. Thus, $|t|^2$ from $k$ is an oscillating function enclosed between the envelope $|t|^2_\text{min}$ and unity.