Explain Heisenberg's uncertainty principle There was one homework question that asks what Heisenberg uncertainty tell us about the energy of an electron in an infinite square well when the length of the well decreases. The correct answer is that the energy decreases when length increases. I know that the energy should decrease by the formula for energy eigenstate, but I feel like this has nothing to do with Heisenberg's uncertainty principle. Uncertainty principle only tells us how accurate is the measurement. Can someone explain how is the uncertainty in energy related to the actual energy of the electron?
 A: The expected answer is direct. A particle in a stationary state in the box has zero averaged momentum, just because the particle stays there stationarily. Hence $(\Delta P)^2 = \langle P^2\rangle$ which is proportional to the averaged energy of the particle. However, this value is also the eigenvalue of the energy since the state has  definite energy by hypothesis. If we decrease  the size of the box, due to the Heisenberg inequality, then $\Delta P$ and thus the energy must increase.
However, in my view, this answer, though popular,  is wrong as it stands (see my comment below however). That is  because the momentum observable does not exist in the box with vanishing boundary conditions (so the validity of the H principle is disputable). Also the energy observable in the box is different of the energy observable in the whole real line where the Heisenberg principle is valid (is a theorem).
ADDENDUM. To make more acceptable the argument from the physical side, we can proceed as follows.  We can say that the infinite well is nothing but a very steep well, defined along the whole real line. The energy levels are the ones computed with the ideal well just approximately. On the complete real line we have no problems in defining the momentum operator and approximately, in our physical context,  the energy is only kinetic (proportional to $P^2$). From this perspective, within the assumed approximations,  the reason why the energy increases when the well width decreases is in fact the Heisenberg inequality. However this line of reasoning is very difficult to follow from a mathematical perspective.
A: You are right that the energy has zero uncertainty (informational entropy), so there is no direct connection to HUP here.
The connection to HUP is a bit more subtle. The particle-in-a-box system has a kind of unusual property in that, given its positional wave functions do not permit support outside the box, it is not possible to have a state with a momentum which is free of uncertainty, i.e. zero informational entropy.
The best information available about the momentum can be found by transforming a usual eigenstate, e.g.
$${\psi_x}_n(x) = \mathrm{rect}\left(\frac{x}{L} - \frac{1}{2}\right) \cdot \left[\sqrt{\frac{2}{L}} \sin\left(\frac{n\pi x}{L}\right)\right]$$
where the box is taken as the interval $(0, L)$. The Fourier transform is that of a sine function windowed by the boxcar function $\mathrm{rect}$, which is easy to find noting that
$$\mathcal{F}[\mathrm{rect}](\omega) = \mathrm{sinc}(\omega)$$
and the Fourier transform of the sine function is a pair of delta spikes:
$$\mathcal{F}[x \mapsto \sin(ax)](\omega) = \sqrt{2\pi} \frac{\delta(\omega - a) - \delta(\omega + a)}{2i}$$
Hence we can convolute these to get that the momentum distribution is a pair of sinc functions separated by a separation inversely proportional to the box width.
This is how you can say "HUP" is involved: the uncertainty, $\Delta p$, is the "width" of the total distribution, and that width grows as the two peaks move further apart, and that width is increased with narrowing the box, so you can say "$\Delta x \Delta p$" obeys the usual relation.
That said, really, the "uncertainties" $\Delta x$, etc. are not really a good way to quantify what is going on, because the distribution is pretty peaked, just bimodally so. Much better is to use the informational entropy. And one way to think of this is that in the box system, there is no information as to in what direction the particle is moving in at any given time - at least, not for an energy eigenstate, but there is "decent" - especially at high energies and/or long boxes - information as to what speed it is moving. It has no sense in which it is moving to the left or right in the box, only that it is "quite surely" (but not absolutely so!) moving with some speed. You can, of course, add direction information at the expense of energy information, i.e. delete one of the peaks, and then you will have a non-steady state that will oscillate back and forth in the box.
Moreover, it gets worse: note what I said above about "pretty good" - but not perfect - speed information? There is no way to localize the momentum much better than this, even after removing a peak to add direction information. In some sense, the particle has a floor on the information entropy for momentum - an absolute maximum amount of information that the momentum parameter can carry, and this constraint is stronger than the usual HUP!
A: At first, uncertainty principle tells us not about how accurate measurement can be, but how accurate a state of particle can be regardless of any measurement devices used for measuring anti-commutating operators. Second, when you decrease length of well, then particle position becomes more accurate, hence by Heisenberg uncertainty, momentum uncertainty increases, and so does expected value spread of it as per : $$\Delta p = \sqrt{\langle p^2 \rangle - \langle p \rangle ^2}.$$
Bigger variance of momentum means that you'll notice far more often higher electron momentum, which was not expected before in a wider setting of well size. And momentum uncertainty is related to energy uncertainty by :
$$ \Delta E=\Delta pc. $$
Btw, as a side-note, using this relation is quite easy to jump from momentum-position uncertainty to energy-time uncertainty :
$$ \begin{align}
 \Delta p \cdot \Delta x &> \hbar/2 \to\\
 \Delta pc \cdot \Delta xc^{-1} &> \hbar/2 \to\\
 \Delta E \cdot \Delta t &> \hbar/2.
\end{align}
$$
A: The infinite square well is a time-independent solution.
Energy is related to time through the HUP. Position is related to linear momentum.
It means that the infinite square well, with a definite energy, has arbitraryily large uncertainty on when the particle is in the well.
The width of the well is related to the uncertainty in location. So you need to get the uncertainty in position $x$ and momentum $p$. The momentum is given by the momentum  operator $i h\frac{\partial}{\partial x}$.
A: Heisenberg's uncertainty relation tells you that
$\langle (X-\langle X \rangle )^2 \rangle \langle (P -\langle P \rangle)^2 \rangle \ge (\hbar/2)^2$,
where $X$ is the position operator, $P$ the momentum operator and $\langle A \rangle := \langle \psi | A |\psi \rangle $ denotes the expectation value of the operator $A$ in an arbitrary state $| \psi \rangle$. In the ground state of the infinite square well potential, you will have $\langle P \rangle = 0$ and $\langle X \rangle = 0$, if the square well is centered around $x=0$ (say, the particle is confined to the region $[-L/2, L/2]$). In this specific case, the uncertainty relation simplifies to
$\langle X^2 \rangle \langle P^2 \rangle \ge \hbar^2/4$.
As the Hamiltonian of the particle is given by $H=P^2/2m$ (just the kinetic energy) and the expectation value of $X^2$ must be just $L^2$ times some dimensionless numerial constant $k$ of order $1$ ($\langle X^2 \rangle = k L^2$), the uncertainty relation gives you a lower bound for the energy of the system (and thus the ground state energy),
$E_0= \langle P^2/2m\rangle \ge \hbar^2/(8m\langle X^2 \rangle) = \hbar^2/(8 m k L^2)$,
and indeed $E_0 \sim 1/L^2$. By the way, in a similar manner you may also determine the ground state energy of the harmonic oscillator without solving the eigenvalue equation explicitly.
