# Delta function in discontinuous derivative of a wavefunction

In variational principle problem; we need to find $$\frac{d^2\psi}{dx^2}$$ to find $$\langle T \rangle$$; if \begin{align} \psi = \begin{cases} A \cos ( \pi x / a ) , & -a/2 Then, how does $$\frac{d^2\psi}{dx^2}$$have delta functions at $$x= \pm a/2$$? This means that $$\frac{d\psi}{dx}$$ has a Heaviside function; but I can't figure out the Heaviside either.

Quoting from Grifthhs:

We do not need to worry about the kink at $$\pm a/2$$. It is true that $$\frac{d^2 \psi }{dx^2}$$ has delta functions there, but since $$\psi(\pm a/2) = 0$$ no “extra” contribution to $$\langle T\rangle$$ comes from these points.

• Maybe you can express $\psi$ via a rectangular function, which admits a representation in terms of Heaviside functions? Commented Dec 11, 2022 at 13:50
• Please use MathJax Commented Dec 11, 2022 at 13:51

The "delta functions" that Griffiths is talking about arise from the discontinuity of $$\psi'(x)$$. This does not necessarily mean that the definition of $$\psi'(x)$$ actually has Heaviside step functions in it (though you can think of it as such.)
If we take the derivative of $$\psi$$ we get \begin{align} \psi'(x) = \begin{cases} - \frac{\pi A}{a} \sin ( \pi x / a ) & -a/2 This is discontinuous at $$x = \pm a/2$$; in particular, we have $$\lim_{\epsilon \to 0} \left[ \psi'(a/2 + \epsilon) - \psi'(a/2 - \epsilon) \right] = \frac{\pi A}{2}.$$ But we also have $$\lim_{\epsilon \to 0} \left[ \psi'(a/2 + \epsilon) - \psi'(a/2 - \epsilon) \right] = \lim_{\epsilon \to 0} \left[ \int_{a/2 - \epsilon}^{a/2 + \epsilon} \psi''(x) \, dx \right]$$ and since this integral does not vanish in the limit as $$\epsilon \to 0$$, it must be the case the $$\psi''(r)$$ (defined as a distribution) includes a delta-function at $$x = a/2$$. Similar logic applies to the point $$x = - a/2$$.
That said, if you really insist on the idea that $$\psi'(x)$$ must have step functions in it, you can take the approach suggested in the comments and rewrite it as $$\psi'(x) = - \frac{\pi A}{a} \sin \left( \frac{\pi x}{a} \right) \left[ \Theta\left( x + \frac{a}{2} \right) - \Theta \left( x - \frac{a}{2} \right) \right].$$ But this sort of rewriting rapidly becomes cumbersome for more complicated functions. In contrast, the "integral proof" above can be extended straightforwardly to show that any discontinuity in $$f^{(n)}(x)$$ implies that $$f^{(n+1)}(x)$$ has a delta function in its distributional derivative.
What Griffith wrote means that if you take the second derivative of the proposed wavefunction, it is \begin{align} \psi'' = \begin{cases} -A \left( \frac{\pi}{a} \right)^2 \cos ( \pi x / a ) \left( \delta(x+a)-\delta(x-a)\right), & -a/2 However, the contribution of the two deltas to every integral where $$\psi''$$ is multiplied by a function regular at $$\pm a$$ is zero due to the vanishing of the cosinus at these two points.