I want to verify mathematically
for wave function $\psi(x)$ satisfying
$\psi(x)=0$ for $\lvert x \rvert \ge \frac{L}{2} $ and
$\int_{- \frac{L}{2}}^{\frac{L}{2}} \lvert \psi(x) \rvert ^2 dx = 1 $
Below holds
$\int_{-\frac{L}{2}}^{\frac{L}{2}} x^2 {\lvert \psi(x)\rvert}^2 dx - \left( \int_{-\frac{L}{2}}^{\frac{L}{2}} x {\lvert \psi(x) \rvert}^2 dx \right) ^2 \le \frac{L^2}{4} $
I know that the equality holds for ${\lvert \psi(x) \rvert}^2 = \frac{1}{2} \delta (x - \frac{L}{2}) +\frac{1}{2} \delta (x + \frac{L}{2}) $
But.. I dont konw how to establish the inequality
Thanks in advance for any help
Given that $\lvert x \rvert \le \frac{L}{2}$ in the range of the integral, $ x^2 \le \frac{L^2}{4}$ and thus
Substracting any positive number, like $\left( \int_{-\frac{L}{2}}^{\frac{L}{2}} x {\lvert \psi(x) \rvert}^2 dx \right) ^2$, from the LHS will preserve the inequality.
The equality holds iff
$ \int_{-\frac{L}{2}}^{\frac{L}{2}} x^2 {\lvert \psi(x)\rvert}^2 dx = \frac{L^2}{4}$
and
$\int_{-\frac{L}{2}}^{\frac{L}{2}} x {\lvert \psi(x) \rvert}^2 dx = 0.$
I wonder if the function you gave is the only case of equality.