When a quantity is described by a probability we define the uncertainty in the quantity by its standard deviation from the mean. To calculate the standard deviation of \(x\) and \(p\) we first calculate their second moments defined by:
\begin{align*}
\amp \langle x^2 \rangle = \int_{-\infty}^{\infty} \psi^*(x,t) x^2\: \psi (x,t) dx.\\
\amp \langle p^2 \rangle = \int_{-\infty}^{\infty} \psi^*(x,t) \left[ -\hbar^2 \dfrac{\partial^2 }{\partial x^2}\right] \: \psi(x,t)dx.
\end{align*}
The standard deviations of \(x\) and \(p\text{,}\) which are a measure of uncertainty in the values of \(x\) and \(p\text{,}\) are
\begin{align*}
\amp \Delta x = \sqrt{\langle x^2 \rangle - \langle x \rangle^2},\\
\amp \Delta p = \sqrt{\langle p^2 \rangle - \langle p \rangle^2}.
\end{align*}
Werner Heisenberg showed that for all systems the product of the uncertainties in position and momentum has a lower bound as given by the following inequality.
\begin{equation}
\Delta x \Delta p \geq \dfrac{\hbar}{2}.\tag{51.12}
\end{equation}
This relation is called Heisenberg’s uncertainty principle for position and momentum. It says that when the position of a particle is known with more precision, i.e., when \(\Delta x\) is small, the momentum would be more uncertain so that the product of the uncertainties cannot be less than \(\hbar/2\text{.}\) That is, if you try to localize a particle in a small space its momentum will become uncertain and vice versa.
Sometimes the uncertainty in momentum is used to estimate the minimum kinetic energy the particle will have. For an uncertainty in momentum \(\Delta p\) we estimate that the minimum kinetic energy of the particle will be
\begin{equation*}
K.E. \sim \dfrac{(\Delta p)^2}{2m}.
\end{equation*}
Thus, if you try to confine a particle in a space of linear dimension \(a\text{,}\) that is for \(\Delta x = a/2\text{,}\) you would expect its kinetic energy to be at least
\begin{equation*}
K.E. \sim \dfrac{(\Delta p)^2}{2m} = \dfrac{\hbar^2}{2m (\Delta x)^2} = \dfrac{\hbar^2}{m a^2}.
\end{equation*}
This estimate gives a qualitatively correct answer in practical situations, such as the energy of an electron confined in an atom or in a nucleus. For instance, suppose you try to confine a particle in a potential well of height \(U_0\) and width \(a\text{.}\) If \(K.E.\) due to the uncertainty in the momentum due to confinement exceeds \(U_0\text{,}\) it will not be confined in the well.
\begin{equation*}
\textrm{Not confined if: }\quad\quad K.E. \ = \dfrac{\hbar^2}{m a^2} > U_0,\quad \longrightarrow\quad m a^2 U_0 \lt \hbar^2.
\end{equation*}
In three-dimensional space there is a Heiserberg uncertainty for each vector component of the momentum and position.
\begin{equation}
\Delta x \Delta p_x \geq \dfrac{\hbar}{2};\quad\quad \Delta y \Delta p_y \geq \dfrac{\hbar}{2};\quad \quad \Delta z \Delta p_z \geq \dfrac{\hbar}{2}.\tag{51.13}
\end{equation}
There are other similar relations in quantum mechanics. For instance, there is an energy-time uncertainty relation that states
\begin{equation*}
\Delta E \Delta t \ge \dfrac{\hbar}{2}.
\end{equation*}
This can be applied to find the lifetime of metastable states. Suppose we find that the energy released when a metastable state decay has a width \(\Delta E =\Gamma\text{,}\) then we can use the time-uncertainty relation to get an estimate of the lifetime of the metastable state to be
\begin{equation*}
\Delta t \sim \dfrac{\hbar}{2\:\Gamma}.
\end{equation*}