# How to evaluate a bra-ket expression?

I'm having difficulty working with the bra-ket notation of quantum mechanics. I know this probably sounds simple, but I literally don't understand how to actually evaluate an expression, and I can't find anything instructing me on how to do so online.

The expression I'm trying to evaluate is:

$$\langle\psi(x, t=0)|\hat{x}^2|\psi(x, t=0)\rangle$$

Where:

$$\psi(x, t=0) = f(x)$$

Any idea on how to evaluate this specific expression/expressions of this type in general would be really appreciated.

By the way, if it makes a difference, the Hamiltonian here is that of a quantum harmonic oscillator.

Since you're not dealing with time dependence, and the state is clearly marked, the hamiltonian is not needed here. You can also forget about the time dependence, so the question can be rephrased as evaluating the expectation value $$\langle\psi|\hat{x}^2|\psi\rangle$$ where $$\langle x|\psi\rangle = \psi(x) = \frac{1}{(2\pi\bar{\sigma}_x^2)^\frac{1}{4}}e^{-\frac{(x-a)^2}{4\bar{\sigma}_x^2}}.$$

Note that:

• I have removed mention of $$x$$ from the bras and kets in the first expression. The state vector $$|\psi\rangle$$ is an 'abstract' state vector, and it doesn't care about what representation you're using for it (say, the position or the momentum representations).
• Instead, the position-representation wavefunction $$\psi(x)$$ can be obtained from the abstract state vector $$|\psi\rangle$$ by taking its inner product with the position-state bra $$\langle x|$$, as in the second equation.

To calculate the expectation value in question, you use the position representation, via the following steps:

• You first insert the resolution of identity $$\mathbb I = \int_{-\infty}^\infty |x\rangle\langle x|\mathrm dx$$ between $$\hat{x}^2$$ and $$|\psi\rangle$$.
• Then you use the fact that $$|x\rangle$$ is an eigenstate of the position operator $$\hat x$$ to obtain $$\hat x^2|x\rangle = x^2|x\rangle$$, and you use the wavefunction identification $$\langle x|\psi\rangle = \psi(x)$$ from above.
• You can then move the (now scalar) $$x^2$$ out of the way to get the other bra-ket sandwich, $$\langle\psi|x\rangle$$, which is the complex conjugate of $$\langle x|\psi\rangle$$.

Thus, you have \begin{align} \langle\psi|\hat{x}^2|\psi\rangle & = \langle\psi|\hat{x}^2 \int_{-\infty}^\infty |x\rangle\langle x| \mathrm dx|\psi\rangle \\ & = \int_{-\infty}^\infty \langle\psi|\hat{x}^2 |x\rangle\langle x|\psi\rangle \mathrm dx \\ & = \int_{-\infty}^\infty \langle\psi|x^2 |x\rangle\langle x|\psi\rangle \mathrm dx \\ & = \int_{-\infty}^\infty x^2\langle\psi|x\rangle\langle x|\psi\rangle \mathrm dx \\ & = \int_{-\infty}^\infty x^2\psi(x)^*\psi(x) \mathrm dx \\ & = \int_{-\infty}^\infty x^2|\psi(x)|^2 \mathrm dx . \end{align} From there the rest is just putting in the explicit wavefunction and evaluating the integral, which is a job for you.