The prohibition against degeneracy of the energy levels in one-dimension is given in standard textbooks.1
Assume that there are two solutions and that have the same energy . Each will satsify the Time-Independent Schrodinger equation as follows
Multiplying Eq. by and multiplying Eq. by results in
Subtracting Eq. from Eq. yields
Equation can be rewritten as
Which implies that
Since this relationship holds true at any point , then taking the standard assumption that
results in which should be constant for .
Setting , rearranging Eq. gives the following relationship
resulting in
as the relationship between and . Expressing the relationship in exponential form gives
showing that and are not linearly independent functions.
Note that in order to proceed from Eq. to Eq., it is assumed that the first derivative is continuous everywhere.
For the particle in an infinite well, the assumption of continuity of the first derivative is false. Even in the traditional approach in which the value of the wave function is equated with zero at the boundary, it is accepted that the first derivative is not continuous at the boundary. Therefore, for the particle in a box, the prohibition against degeneracy is not applicable.
David Griffiths, Introduction to Quantum Mechanics. 2nd Edition. Pearson. 2005 pg. 100-106. []