Can anyone help me get a handle on how to go about solving for the energies and wave function for a particle in an infinite box where there is a step function? That is, the potential is infinite for $x<0$ and $x>a$, $0$ in the range $0<x<\frac{a}{2}$, and $V_0$ in the range $\frac{a}{2}<x<a$. This is for self-study from an old problem set posted on MIT OpenCourseWare.
The problem-set asserts that the wave function in the zero potential region is $Asin(k_1*x)$, with k relating to the ordinary energy for a particle-in-a box ($\sqrt{2mE/\hbar^2})$. And it says that the wave function in the stepped up region is $B*sin(k_2(a-x))$, with k2 being ($\sqrt{2m(E-V_0)/\hbar^2}$).
The problem seems to revolve around ensuring that the wave function (and its derivative) actually meet up at the point $x=a/2$. But I'm really confused about how to implement this: I can solve for B in terms of A, $k_1$, and $k_2$ by equating the two wave functions at the point $a/2$, but the math quickly gets too confusing to follow for me. I end up relating $k_1$ to $k_2$ with some messy cotangent functions, but I don't see how that gets me to a single wave function, or the energy levels that I need. Can someone sketch the solution?