You are right, I've omitted a crucial part:
Inside the box, the wavefunction is:
\begin{equation}
\frac{\hbar^2}{2m} \frac{d^2 \psi(x)}{dx^2} = E \psi(x) \iff
\frac{d^2 \psi(x)}{dx^2} = k^2 \psi(x)
\end{equation}
where ##k = \frac{\sqrt{2mE}}{\hbar}##. Outside the box...
That is not a bad idea, however, equation (12) is useful assuming that the values of ##\xi## are valid. The second value of ##\xi## produces an energy, ##E = 331.98##, making it a bit ambiguous given that the potential is only ##U_0 = 40##.
Most probably there are mistakes in both, analytical...