Question: another infinite square well plotting problem

I'm trying to make an infinite square well of width a, and i want to plot individual solutions along with the walls of the well at x=a and x=-a, does anyone know how to modify my code to show the solution and the vertical lines at x=a and x=-a, id like to also show that the wavefunction is zero at the walls, but due to the equation it continues past them, is there some way i can either modify the equation to stop the plot at x=a and -a (preferable) or blank out the graph after the walls?

this is the code i have written:

restart;

a:=1;

for n from 1 by 2 to 3

do psi[n]:=sqrt(a)*cos((n*Pi*x)/2*a);

plot(psi[n],x=-2..2,title="Potential as a function of x"):

plot((psi[n]^2),x=-2..2,title="Probability density"):

isw:=plot([a,y,y=0..a]):

isw2:=plot([-a,y,y=0..a]):

display(isw,isw2,pot_well):

display(isw,isw2,prob_dens):

od;

The isw's are the infinite square walls at a and -a. I'd like to show a vertical line at both of these values. I've tried using 'display' to show them all on the same plot but for some reason the isw's just give loads of numbers.

Below is the wavefunction of psi[1], ideally i'd like to change the axis labels to show an 'a' and '-a' where the 1's are - is that possible?
plot(cos((Pi*x)/2),x=-2..2)

Please Wait...