Problem 4, part e)

In order to get wave functions, we need numerical solutions to the transcendental equations we obtained for the energies.  The equations, with the definition of c, are:

c = 3 Pi + 1;
eq1 = (Tan[q] == Sqrt[c^2 - q^2]/q);
eq2 = (-Cot[q] == Sqrt[c^2 - q^2]/q);

By plotting both sides of the equations, it's easy to see that there are four
even solutions (the solutions to eq1) and three odd solutions.

Plot[{eq1[[1]],eq1[[2]]},{q,0.2,c}]
Plot[{eq2[[1]],eq2[[2]]},{q,0.2,c}]

I use the FindRoot function of Mathematica, with different values of my initial guess so that the computer finds all the different solutions.

r1 = FindRoot[eq1,{q,3 Pi}];
r2 = FindRoot[eq1,{q,2 Pi}];
r3 = FindRoot[eq1,{q, Pi}];
r4 = FindRoot[eq1,{q,Pi-2}];
evenroots = Join[r1,r2,r3,r4]

r5 = FindRoot[eq2,{q,2.5 Pi}];
r6 = FindRoot[eq2,{q,1.5 Pi}];
r7 = FindRoot[eq2,{q, .5 Pi}];
oddroots = Join[r5,r6,r7]

I don't really care about the normalization, but it is interesting to see what the shape of the wave function is for the different values of q.  I'll set a=1, so that the q I found above is actually the q in my wave functions (chi = qa).  I know that the wave function outside of the well is always just decaying exponentials.  But the behavior inside is more interesting:

psi2even[x_] := Cos[q x]
psi2odd[x_] := Sin[q x]
Table[Plot[psi2even[x] /. evenroots[[i]],{x,-1,1}],{i,4,1,-1}]
Table[Plot[psi2odd[x] /. oddroots[[i]],{x,-1,1}],{i,3,1,-1}]

Here are the even solutions for increasing values of q.

And here are the odd solutions.

Notice that we pick up a node every time we go to a higher energy.  We will see this again when we study the hydrogen atom.