Show that the scalar (or inner) product of a quantum state \(\phi\) with itself can be written as an integral

Method

 * 1) Starting with \(\langle\phi|\phi\rangle\), use completeness of states to expand the bracket.
 * 2) As there is no explicit operator in the bracket, insert the identity operator: \(\langle\phi|\mathbb{I}|\phi\rangle\)
 * 3) Use the completeness of states for Hilbert space \( (\mathbb{I}=\int dx |x\rangle\langle x|) \) to substitute out the identity operator: \( \langle\phi|\int dx |x\rangle\langle x|\phi\rangle \)
 * 4) Rearrange the bras and kets to rewrite the equation in terms of projections onto the basis state.
 * 5) Move everything inside the integral sign: \(\int dx \langle\phi|x\rangle\langle x|\phi\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 dx \phi^*(x) \phi(x)\)
 * 7) Multiply the wavefunctions to simplify the equation: \(\int dx |\phi(x)|^2\)