# How to compute the expectation value $\langle x^2 \rangle$ in quantum mechanics?

$$\langle x^2 \rangle = \int_{-\infty}^\infty x^2 |\psi(x)|^2 \text d x$$

What is the meaning of $|\psi(x)|^2$? Does that just mean one has to multiply the wave function with itself?

-

In general, $\psi$ will be a complex valued function. And so $|\psi(x)|^2$ will be not equal just $\psi(x)^2$ but it is $\psi(x)$, multiplied by its complex conjugate: $|\psi(x)|^2=\psi(x)^*\psi(x)$.

-

About your other question, the meaning of $|\psi(x)|^2$ is that of a density of probability, with $[|\psi(x)|^2 \mathrm{d}x]$ giving the probability that the particle is found between $x$ and $x + \mathrm{d}x$.

-

In quantum mechanics, the likelihood of a particle being in a particular state is described by a probability density function $\rho(x,t)$.

Suppose my system is a 6 sided die. Then the expectation value for a given roll is $$EV= \tfrac{1}{6} 1 + \tfrac{1}{6} 2 + \tfrac{1}{6} 3 + \tfrac{1}{6} 4 + \tfrac{1}{6} 5 + \tfrac{1}{6} 6 = 3.5$$

Similarly, the expectation value for a given parameter $x$ of a particle in quantum mechanics is

$$\langle x \rangle = \int_{-\infty}^{\infty} x \rho(x,t) dx$$

Note, in quantum mechanics, we don't just have the states but also their superpositions. Yet $\rho(x,t)$ doesn't contain information about these superpositions, only observable states. Therefore, we need something more fundamental that incorporates information about superpositions. That's what $\psi$ is for and why $\psi(x,t) \in \Bbb C$. By the Born rule (an axiom), $$\psi(x,t)^* \psi(x,t) = \rho(x,t)$$ In short, we need to use the "square" of the wave function because it gives us $\rho(x,t)$ and allows us to compute expectation values.

-
You claim $\rho$ talks about "observable states", but that's not quite right. For example, consider a wave traveling left with a wave with the exact same shape traveling right. The only difference is in their phase ($e^{ikx}$ vs. $e^{-ikx}$), which cancels out in $\rho$, so $\rho$ can't tell the difference between them. Yet we can observe the momenta just fine. – knzhou Jan 18 at 15:59
It's true that $\rho$ throws out information. But it's not simply "superposition" information, it's something different and somewhat worse. – knzhou Jan 18 at 16:00
What information does it throw out? – Stan Shunpike Jan 18 at 17:57
It throws out the phase information. Phase doesn't just tell you how wavefunctions superpose; it also tells you which way the particle is going. – knzhou Jan 18 at 18:42

$\psi$ can be thought of as a complex column vector with infinitely many entries indexed by the variable $x$. Entry at $x$ th position is denoted as $\psi(x)$. $|\psi(x)|^2$ is then mode square of the entry at $x$th position. The expression $\displaystyle\int_{-\infty}^{\infty}x^2|\psi(x)|^2dx$ can be heuristically understood as :

$[*,*,\overline{\psi(x)},*,*]\left[ \begin{array}{cc} * & 0 & 0 & 0 & 0\\ 0 & * & 0 & 0 & 0\\ 0 & 0 & x^2 & 0 & 0\\ 0 & 0 & 0 & * & 0\\ 0 & 0 & 0 & 0 & *\end{array}\right]\left[\begin{array}{cc}*\\*\\\psi(x)\\*\\*\end{array}\right]$

Where $[*,*,\overline{\psi(x)},*,*]$ is infinite dimensional row vector which is transpose conjugate of column vector $\psi$; And in the middle we have infinite dimensional diagonal matrix whose $(x,x)$th entry is $x^2$. This is in general true in QM. Any observable $A$ can be written as a hermitian matrix which acts on space of column vectors (the state space), and its expectation value for a given column vector $\psi$ is defined as $\langle A\rangle_{\psi}=\psi^{\dagger}A\psi = \displaystyle\sum_{i,j}\overline{\psi_i}A_{ij}\psi_{j}$. In this infinite dimensional case as above sum is replaced by integral over the continuous indices.

-