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

Method

 * 1) Starting with \(\langle\phi|\mathbf{\hat{A}}|\psi\rangle\), use completeness of states to expand the bracket.
 * 2) Insert identity operators either side of the operator in terms of two bases, \(x\) and \(y\): \(\langle\phi|\mathbb{I}_x\mathbf{\hat{A}}\mathbb{I}_y|\psi\rangle\)
 * 3) Use the completeness of states for Hilbert space \( (\mathbb{I}=\int dx |x\rangle\langle x|) \) to substitute out the identity operators: \( \langle\phi| (\int dx |x\rangle\langle x|) \mathbf{\hat{A}} (\int dy |y\rangle\langle y|) |\psi\rangle \)
 * 4) Rearrange the bras and kets to rewrite the equation in terms of projections onto the basis states.
 * 5) Move everything inside the integral signs: \(\int \int dx dy \langle\phi|x\rangle\langle x|\mathbf{\hat{A}}|y\rangle\langle y|\psi\rangle\)
 * 6) Since \(\langle x|\phi\rangle\) is the projection of the state \(\phi\) onto the basis state \(x\), replace the bras and kets with wavefunctions: \(\int \int dx dy \phi^*(x)\langle x|\mathbf{\hat{A}}|y\rangle\psi(y) \)