Maple input and output is offset from the main text by horizontal lines.
For n=1 (the ground state), we get
You could take the derivatives by hand (or get Maple to work
them out), but it's probably easier to go straight to Maple with
this expression:
> -hbar^2/(m*L)*int(sin(Pi*x/L) > *diff(sin(Pi*x/L),x$2),x=0..L);
Similarly, for n=2 (the first excited state)
> -hbar^2/(m*L)*int(sin(2*Pi*x/L) > *diff(sin(2*Pi*x/L),x$2),x=0..L);
There was another way to do this problem. For the particle in a box, . Thus (using the facts that and that the wavefunctions are normalized). You can verify that the answers given above are exactly the energies of the ground and first excited states of the particle in a box.
Since the commutator is not zero, the position and kinetic energy are not compatible.
I called this quantity deltaE1 in my Maple
session:
> deltaE1:=2*V/L*int(sin(Pi*x/L)^2 > *(x/L-1/2)^2,x=0..L);
Similarly, for the first excited state:
> deltaE2:=2*V/L*int(sin(2*Pi*x/L)^2 > *(x/L-1/2)^2,x=0..L);
> evalf(deltaE1);
> evalf(deltaE2);
> plot((x-1/2)^2,x=0..1);
where is whatever region of space we are interested in. For the 1s state,
(I find it a little easier to keep track of all the brackets if
I break it up into a product of three integrals than if I try to
embed the integrals one into the other.)
> 1/(Pi*a0^3)*int(exp(-r/a0)^2*r^2,r=0..2*a0) > *int(sin(theta),theta=0..Pi) > *int(1,phi=0..2*Pi);
> simplify(");
> evalf(");
For the 2s state:
> 1/(32*Pi*a0^3) > *int((2-r/a0)^2*exp(-r/(2*a0))^2*r^2,r=0..2*a0) > *int(sin(theta),theta=0..Pi) > *int(1,phi=0..2*Pi);
> simplify(");
> evalf(");
Finally, to the probabilities of finding the electron between and in the two states, we just need to change the limits of integration:
> 1/(Pi*a0^3)*int(exp(-r/a0)^2*r^2,r=2*a0..10*a0) > *int(sin(theta),theta=0..Pi) > *int(1,phi=0..2*Pi);
> simplify(");
> evalf(");
> 1/(32*Pi*a0^3) > *int((2-r/a0)^2*exp(-r/(2*a0))^2*r^2,r=2*a0..10*a0) > *int(sin(theta),theta=0..Pi) > *int(1,phi=0..2*Pi);
> simplify(");
> evalf(");