Show that the scalar (or inner) product of two different quantum states \(\phi\) and \(\psi\) and the position operator \(x\) can be written as an integral

Method

 * 1) Follow the instructions here for rearranging the scalar product of two quantum states and an arbitrary operator, \(\langle\phi|\mathbf{\hat{A}}|\psi\rangle\), in terms of integrals of a wavefunction and substitute in the position operator \(\hat{x}\): \(\int \int dx dy \phi^*(x)\langle x|\hat{x}|y\rangle\psi(y) \)
 * 2) Remove \(y\), setting the expression solely in terms of \(x\).
 * 3) Use the identity for the position operator, \(\hat{x}|x\rangle = x|x\rangle\), to remove the operator from the equation: \(\int \int dx dy \phi^*(x)\langle x|y|y\rangle\psi(y) \)
 * 4) Take \(y\) outside the bracket: \(\int \int dx dy \phi^*(x)y\langle x|y\rangle\psi(y) \)
 * 5) Perform the inner product on \(\langle x|y \rangle\): \(\int \int dx dy \phi^*(x)y\delta(x - y)\psi(y) \)
 * 6) Integrate with respect to \(y\): \(\int dx \phi^*(x) x \psi(x) \)