# Infinite square well centered at the origin

• Kaguro

#### Kaguro

Moved from a technical forum
The problem is:
Solve the time independent Schrodinger Equation for infinite square well centered at origin. Show that the energy is same as in the original case(well between x=0 and x=L). Also show that the solution to the this case can be obtained by setting x to x-L/2 in ##\psi## in the original one.

Now, in the original problem, E = ## \frac{n^2\pi^2ħ^2}{2mL^2}##.

Here, I got my answer as 4 times that value:

From the Schrodinger Equation, put V=0 in (-L/2,L/2):
##\frac{d^2\psi}{dx^2}## + ##\frac{2mE}{ħ^2}\psi## = 0

So,
##\psi## = Acos(kx) + Bsin(kx) where ##k^2 = \frac{2mE}{ħ^2}##

Now the boundary conditions require ##\psi## be 0 at x=-L/2 and x=+L/2
Putting these and solving them I get:
0 = Acos(kL/2) - Bsin(kL/2) and 0 = Acos(kL/2) + Bsin(kL/2)

From them:
tan(kL/2) = A/B and also A/B = -tan(kL/2)

which means: 2tan(kL/2) = 0
and so kL/2 = n##\pi##

From the definition of k, I have:
E = ##\frac{2n^2\pi^2ħ^2}{mL^2}##

What mistake did I make?

From them:
tan(kL/2) = A/B and also A/B = -tan(kL/2)

This assumes that B is nonzero. What if B is zero?

This assumes that B is nonzero. What if B is zero?

Actually I am having trouble finding the constants A and B. I tried various ways and got 4 possibilities:
A=0,B=0(not together), cos(kL/2) = 0, or sin(kL/2)=0.

Except the condition that A and B together must not be zero, and the condition that kL/2 can't have two different values, I don't see any condition which will tell me which constant to set to 0.

Actually I am having trouble finding the constants A and B. I tried various ways and got 4 possibilities:
A=0,B=0(not together), cos(kL/2) = 0, or sin(kL/2)=0.

Except the condition that A and B together must not be zero, and the condition that kL/2 can't have two different values, I don't see any condition which will tell me which constant to set to 0.

Either ##A = 0## or ##B = 0##. You need to solve both cases to get the full list.

You solved for ##A = 0## only, hence got every other solution, hence your ##n## was out of step with the full set of energy states.

• Nugatory
Either ##A = 0## or ##B = 0##. You need to solve both cases to get the full list.

You solved for ##A = 0## only, hence got every other solution, hence your ##n## was out of step with the full set of energy states.
If I do that, I get two different values of k:
Set A=0:
k = 2n##\pi##/L

Set B=0:
k = (2n-1)##\pi##/L

If I do that, I get two different values of k:
Set A=0:
k = 2n##\pi##/L

Set B=0:
k = (2n-1)##\pi##/L

There's nothing wrong with that. That's an either/or. There would be nothing wrong with finding that, say: ##k =0## or ##k =1##.

There's nothing wrong with that. That's an either/or. There would be nothing wrong with finding that, say: ##k =0## or ##k =1##.
Well... then can you tell me how to proceed from here? I have 2 possible values of k and so using the definition of k in terms of E I can get two possible values of E:

E = ##\frac{2n^2\pi^2ħ^2}{L^2}##
Or
E = ##\frac{(2n-1)^2\pi^2ħ^2}{2mL^2}##

Which one to take? And why?

I have 2 possible values of k

Both of which are actually special cases of one general formula for ##k##. Can you see what it is?

(Hint: ##2n## is even and ##2n - 1## is odd. When you combine the set of even numbers with the set of odd numbers, what do you get?)

Both of which are actually special cases of one general formula for ##k##. Can you see what it is?

(Hint: ##2n## is even and ##2n - 1## is odd. When you combine the set of even numbers with the set of odd numbers, what do you get?)
Okay okay... I can take just n. So this works up pretty well and I get the correct value for energy. But I still don't know ##\psi##.

But I still don't know ψ\psi.

Can you write down an expression for ψ?

Well... then can you tell me how to proceed from here? I have 2 possible values of k and so using the definition of k in terms of E I can get two possible values of E:

E = ##\frac{2n^2\pi^2ħ^2}{L^2}##
Or
E = ##\frac{(2n-1)^2\pi^2ħ^2}{2mL^2}##

Which one to take? And why?

I think you lost sight of what you were trying to do. You were looking for ALL solutions to the equation:

##\psi'' + k^2 \psi =0##

With the boundary conditions that ##\psi(L/2) = \psi(-L/2) = 0##

First, you found a sequence of solutions for odd positive integers ##n##:

##k = n \pi/L##

and

##\psi(x) = A \cos(\frac{n\pi x}{L})##

And, you found a sequence of solutions for even positive integers ##n##:

##k = n \pi/L##

and

##\psi(x) = B \sin(\frac{n\pi x}{L})##

It's not clear why you think that you can only have solutions for odd ##n## or even ##n## but not both. If you try these functions in the origin equation, you'll see that both sets of functions are indeed solutions.

In any case, you clearly have a solution for every positive integer.

• Kaguro
Can you write down an expression for ψ?
##\psi##= Acos (kx) + Bsin (kx).
I now know k but not A or B.

##\psi##= Acos (kx) + Bsin (kx).
I now know k but not A or B.

In general, ##A## and ##B## can be any complex numbers. But, wavefunctions must be normalised, so you need to calculate the magnitude of ##A## and ##B## to get a well-defined eigenfunction in each case.

Last edited:
I now know k but not A or B.

For any particular value of ##k## (i.e., any particular ##n##), won't one of ##A## or ##B## be zero?

In general, ##A## and ##B## can be any complex numbers. But, wavefunctions must be normalised, so you need to calculate the magnitude of ##A## and ##B## to get a well-defined eigenfunction in each case.
If I try to normalize then I get this:
##A^2+B^2=\frac {2}{L}##

For any particular value of ##k## (i.e., any particular ##n##), won't one of ##A## or ##B## be zero?
If you mean at the boundaries then I would say it depends on whether n is odd or even.

If you mean at the boundaries then I would say it depends on whether n is odd or even.

The values of ##A## and ##B## for a particular value of ##n## can't be different at the boundaries than elsewhere; the solution for a particular value of ##n## has to have the same ##A## and ##B## everywhere within the well.

The values of ##A## and ##B## for a particular value of ##n## can't be different at the boundaries than elsewhere; the solution for a particular value of ##n## has to have the same ##A## and ##B## everywhere within the well.
Yes but I don't have any information within the well. Only that V=0...

I don't have any information within the well.

So what? Did you read what I said? Did you understand that, since the boundary conditions are sufficient to find ##A## and ##B## at the boundaries for each ##n## (one of the two is zero for every ##n##, so the other can be found easily by normalization), that gives you the solution for each ##n## within the entire well?

The boundary conditions are sufficient to find ##A## and ##B## at the boundaries for each ##n## (one of the two is zero for every ##n##
Evidently I don't see how...

I think this is about time I give up and look up the solution from somewhere. Thanks for help.

Evidently I don't see how...

You already knew that either ##A = 0## or ##B = 0## for every ##n## when you made your post #5. So for every ##n##, you only have one nonzero term, and you can find its coefficient (##A## or ##B##, whichever is nonzero for that value of ##n##) by normalization (all you have to do is take the formula you gave in post #15 and remove whichever of ##A## or ##B## is zero for that ##n##). So for every ##n## you know the exact solution.

I think this is about time I give up

You should not give up now, when you are almost there (you've already done all the pieces, as above, you just need to put them together).

If I try to normalize then I get this:
##A^2+B^2=\frac {2}{L}##

That looks right. But, remember that for every solution either ##A = 0## or ##B = 0##.

That looks right. But, remember that for every solution either ##A = 0## or ##B = 0##.
Does the OP understand that all of the A and B should really carry a subscript n (or k) and that specifying a particular solution for a given problem requires more information (perhaps the wavefunction everywhere at t=0)?

specifying a particular solution for a given problem requires more information (perhaps the wavefunction everywhere at t=0)?

The problem asks for solutions to the time-independent Schrodinger Equation, so it's asking for energy eigenstates, not a general time-dependent state (which would be an arbitrary linear combination of energy eigenstates). Enough information is given to find the energy eigenstates.

all of the A and B should really carry a subscript n

This is a good point to emphasize.

After giving the problem some rest when I looked at it again, I found that I was desperately trying to get a single function describe everything. Now that I've understood that it's not possible, I can easily present a piecewise defined function.

To summarise:
Write the TISE. Set V=0.
Find ψ= Acos (kx) + Bsin (kx)
Take help from boundary conditions to get:
0 = Acos(kL/2) + Bsin(kL/2) and 0= Acos(kL/2) - Bsin(kL/2)

This means Either A=0 or B=0.
Set A=0:
k = 2nπ/L

Set B=0:
k = (2n-1)π/L

So in general k = nπ/L
get energy from there: ##E_n= \frac{n^2\pi^2ħ^2}{2mL^2}##

Normalise to get ##A^2+B^2=\frac{2}{L}##
Then write the boundary condition again:
0 = ##Acos(n\pi/2) + Bsin(n\pi/2)##

If n is odd:
0 = B*1 or B=0
Then ##\psi = \sqrt{ \frac{2}{L}}cos(n\pi x/L)##

Similarly,
If n is even:
Then ##\psi = \sqrt{ \frac{2}{L}}sin(n\pi x/L)##

So:
##\psi (x) =\begin{cases} \sqrt{ \frac{2}{L}}cos(n\pi x/L) & \text{if n is odd} \\ \sqrt{ \frac{2}{L}}sin(n\pi x/L) & \text{if n is even} \end{cases} ##

Is all good?

Last edited:
• vanhees71 and PeroK
Okay, apart from having two "odds" in the final equation.

Okay, apart from having two "odds" in the final equation.

Hmm... that's odd...

Sorry. • vanhees71
Thanks to everyone for help! I'll learn lots of QM!

I found that I was desperately trying to get a single function describe everything. Now that I've understood that it's not possible, I can easily present a piecewise defined function.

Just to clarify terminology: you were never looking for a single function, because you have an infinite number of possible values of ##n##, and each value of ##n## leads to a different function. Each of these functions describes a possible energy eigenstate for the system.

What you were looking for was a single general form that all of these functions would take--i.e., a single expression with ##n## appearing in it, that would describe all of the possible energy eigenstates. What you have given now is not a "piecewise defined" function (that would be a single function whose form was different for different ranges of ##x##). It's two expressions, one for odd ##n## and one for even ##n##, that together describe all of the possible energy eigenstates. In other words, your two expressions describe an infinite number of possible functions of ##x##, one for each ##n##, and each function (i.e., each specific value of ##n##) is a possible energy eigenstate for the system.

• vanhees71
I probably shoudn't do this, because it might confuse the issue ... but, here is another way to do this problem assuming the solution for a well from ##x=0## to ##x=L## is known. Use translation of functions, i.e., stuff like ##g\left(x\right) = f\left(x-a\right)## and ##h\left(x\right) = f\left(x+a\right)##.

• vanhees71, atyy and PeroK
That's great. Then you can also show that this of course doesn't change anything concerning the physics, since it's just a different choice of where you set the 0 point of your (spatial) reference frame. This "change of description" is formally given by a corresponding unitary transformation (a translation, which is a fundamental symmetry of Galilean spacetime), and thus indeed nothing is changed physicswise, just our description has changed :-).

I probably shoudn't do this, because it might confuse the issue ... but, here is another way to do this problem assuming the solution for a well from ##x=0## to ##x=L## is known. Use translation of functions, i.e., stuff like ##g\left(x\right) = f\left(x-a\right)## and ##h\left(x\right) = f\left(x+a\right)##.
This sounds interesting! Can you please elaborate how to get the solution of centered well from the normal one?

Exactly where do I substitute these new limits?

This sounds interesting! Can you please elaborate how to get the solution of centered well from the normal one?

Exactly where do I substitute these new limits?

Sometimes the square well is taken to be from ##0## to ##L## and in this case the solution comes out slightly more easily than it does in the cases of ##-L/2## to ##L/2##.

Since you now have the solution for a well from ##-L/2## to ##L/2##, you can get the solutions for a well from ##0## to ##L## using a change of coordinates.

Can you see how to do that?

• vanhees71
Sometimes the square well is taken to be from ##0## to ##L## and in this case the solution comes out slightly more easily than it does in the cases of ##-L/2## to ##L/2##.

Since you now have the solution for a well from ##-L/2## to ##L/2##, you can get the solutions for a well from ##0## to ##L## using a change of coordinates.

Can you see how to do that?

I have ##\psi= \sqrt{\frac{2}{L}} cos(n\pi x/L) ## if n is odd and
##\psi= \sqrt{\frac{2}{L}} sin(n\pi x/L) ## if n is even

To get solution for well from 0 to L ,I should make the transformation x ##\to ## x+L/2

There for odd n:
##\psi= \sqrt{\frac{2}{L}} cos(n\pi (x+L/2)/L) ##
##= \sqrt{\frac{2}{L}} cos(n\pi x/L)cos(n\pi /2) - sin(n\pi x/L)sin(n\pi /2) ##
##=-\sqrt{\frac{2}{L}}sin(n\pi x/L) ##

For even n:
##\psi= \sqrt{\frac{2}{L}} sin(n\pi (x+L/2)/L) ##
##= \sqrt{\frac{2}{L}} (sin(n\pi x/L)cos(n\pi /2) + cos(n\pi x/L)sin(n\pi /2) )##
##= \sqrt{\frac{2}{L}}(-1)^{n/2} sin(n\pi x/L)##

How to combine them?