# Understanding Heaviside and Dirac Delta for Quantum step function

Looking at the solution for from this site I'm a bit confused on how two quantities necessarily reduce.

I'm given this wavefunction

$$\psi(x) = \begin{cases} Ax & 0

If I take the derivative, we can express it as a step function.

\begin{align} \frac{\partial\ \psi(x)}{\partial x} &= \begin{cases} A & 0

## First Question

How does the step function reduce to this?

$$A \left[ \theta(x) - \theta \left(x-\frac{a}{2} \right) - \theta \left(x-\frac{a}{2} \right) + \theta(x-a) \right] = -A \left( 2 \theta \left(x-\frac{a}{2} \right) - 1 \right) \, ,$$ i.e. where did the one come from?

So with that that quantity, I take second derivative to get

$$\frac{\partial^2\ \psi(x)}{\partial^2 x} = -2A\ \delta \left(x-\frac{a}{2} \right) \, .$$

## Second Question

So now what is left is integrating my second derivative with my step function, in which I have no idea which terms vanish.

$$\int_{-\infty}^{\infty} \psi^{*} \frac{\partial^2\ \psi(x)}{\partial^2 x}dx = A \int_{0}^{a/2} x \delta(x-a/2) dx + A \int_{a/2}^{a} a \delta(x-a/2) dx - A \int_{a/2}^{a} x \delta(x-a/2) dx$$

• The $1$ comes from the fact that $\theta(x)$ is $1$ in the interval from $0$ to a. $\theta(x-a)$ only affects values for $x > a$, so it can be ignored in this interval. Commented Dec 30, 2019 at 22:35

First Question I guess your source is implicitly stating 'let's focus only on $] 0,a [$'. You can leave the $\theta(x)$ and the $\theta(a-x)$, the corresponding deltas will vanish anyway (see below).
Second Question I would say the way you wrote the integral miss some pieces: $$\int_{0}^{a/2} \psi^{*} \frac{\partial^2\ \psi(x)}{\partial^2 x} \ \mathrm{d}x = \int_{0}^{a/2} A x \cdot -2A\ \delta(x-\frac{a}{2}) \ \mathrm{d}x = A \int_{0}^{a/2} \delta(x-a/2) \ \mathrm{d} x \ \ ??$$ Etc.
Anyway, you can calculate the energy expectation value using directly the property of delta: $$\int_{x_1}^{x_2} f(x) \delta(x-c) \ \mathrm{d}x = f(c)$$ where $c \in \ ]x_1, x_2[$ (but you correctly wrote $]-\infty,\infty[$, so that's certainly true).
If you want, $\int_{x_1}^{x_2} f(x) \delta(x-x_2) \ \mathrm{d}x = f(x_2) / 2$ etc, but it's simpler if you don't split the integral at all.
• Hi, I defined the bounds of the integral from $[-\infty,\infty]$ to represent all space, which reduce to the bounds of the step function. For the integrals of $\int_{a/2}^{a} x \delta(x-a/2)dx + \int_{a/2}^{a} \delta(x-a/2)$, how would you evaluate it? Commented Oct 6, 2016 at 16:06