We have the following potential

The particle is bound into the well by the infinite potential and thus the wave function vanishes for and . For this reason the following boundary conditions must be satisfied for the wave function to be continuous.

Writing the SE for the region inside the well (outside it is 0) we get:

To find the wave function we can solve the TISE

which is to say

By moving the constants to the right side and imposing

we get

which has solutions

Now that we have the general form we need to apply the boundary conditions described above. From the first one we get

and from the second one

The solution with has to be discarded (otherwise the wave function would vanish) and so the only remaining option is to have which is satisfied for

From this, and from we get that the allowed energy values are

We still need to normalize the wave function (we still have to find ). If we do so we get