# Infinite square well centered at the origin

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?

PeterDonis
Mentor
2020 Award
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.

PeroK
Homework Helper
Gold Member
2020 Award
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

PeroK
Homework Helper
Gold Member
2020 Award
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?

PeterDonis
Mentor
2020 Award
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##.

Staff Emeritus
But I still don't know ψ\psi.
Can you write down an expression for ψ?

PeroK
Homework Helper
Gold Member
2020 Award
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.

PeroK
Homework Helper
Gold Member
2020 Award
##\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:
PeterDonis
Mentor
2020 Award
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.

PeterDonis
Mentor
2020 Award
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...

PeterDonis
Mentor
2020 Award
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.

PeterDonis
Mentor
2020 Award
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).

PeroK
Homework Helper
Gold Member
2020 Award
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##.

hutchphd
Homework Helper
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)?

PeterDonis
Mentor
2020 Award
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.

PeterDonis
Mentor
2020 Award
all of the A and B should really carry a subscript n
This is a good point to emphasize.