Differentiability of wave function at boundary in infinite square well I was told in class that a wave function should have the following properties:


*

*Finite and single-valued

*Continuous

*Differentiable

*Square integrable


But if we consider the wave function in an infinite square well, the wave function isn't differentiable at the boundaries since $\Psi (x)$ is:
$$\Psi (x) =\begin{cases}
\sqrt{\frac{2}{L}}\sin(\frac{n\pi x}{L}), & 0<x<L \\
0, & \text{elsewhere}
\end{cases}$$
This violates one of the properties of wave functions. So how is this an acceptable wave function?
 A: Like with a plane wave, the wave function you are giving is only a "limiting case".
In reality you should start with finitely high walls and impose all four requirements that you list.
Then, as you take the limit of higher and higher walls, you will obtain your wave function.  However, think of it only as a limiting case.  In reality, walls will always have finite height.
A: If you consider the differentiability of the wavefunction at the boundary from inside an infinite square well, you find: $\frac{d\Psi(x)}{dx}$ = $\sqrt{\frac{2}{L}}\frac{\pi}{L}$ as $x\rightarrow0^{+}$, and $\frac{d\Psi(x)}{dx}$ = $-\sqrt{\frac{2}{L}}\frac{\pi}{L}$ as $x\rightarrow L^{-}$. Outside the well, you obtain: $\frac{d\Psi(x)}{dx} = 0$ at $x=0$ and $x=L$. The derivatives do not match, hence the function is not differentiable at either boundary of the well.
This is easily seen by graphing the hybrid wavefunction (for say the ground state, $n=1$) and noting the sharp points.

The infinite square well is one of the first problems taught in undergraduate QM. It is an attempt at taking a free particle and trapping or localizing it over a finite domain, in order to obtain a normalizable wavefunction and demonstrate novel effects like energy quantization.
The problem is, you physically cannot produce a free particle over some finite domain, and then on either side arbitrarily "clamp it down" by imposing an infinite potential to instantaneously drive the wavefunction to zero. This is why you end up violating basic properties of the wavefunction, as you have mentioned.
You could, for instance, use a Fourier transform to build up a wave packet from a sum of plane waves of varying amplitude and momentum, approximating a sinusoidal solution over $0<x<L$, however, the probability of finding the particle outside of this domain would not sharply change to zero, as suggested by the infinite square well problem.
Finally, other issues arise as a result of this problem. Namely, the relationship $E=\frac{p^2}{2m}$ does not hold, where $p=\hbar k$, $k$ the wavenumber associated with the momentum, and you end up obtaining a continuous not discrete distribution of momenta, even though the energy is quantized. Carefully reading the Wikipedia article https://en.wikipedia.org/wiki/Particle_in_a_box helps elucidate these issues.
