# In quantum mechanics, why is expected value usually given as an integral w.r.t. $x$ instead of w.r.t. to whatever the basis variable is?

If I understand correctly, the definition of expectation value of an operator, $$\hat{Q}$$, is $$\int \Psi^* \hat{Q} \Psi dx$$. But why $$x$$ specifically? If we want the expected value of the energy operator, for example, shouldn't we perform a change of basis on $$\Psi$$ so it's in terms of energy and then integrate w.r.t. energy?

At first, I thought it was because the operators themselves were essentially doing exactly that, performing a change of basis. But if that were so, wouldn't we need to do $$\Psi^{-1} \hat{Q} \Psi$$ and then integrate w.r.t. to the new variable (energy, in my example)? But the formula doesn't do that, at least, not explicitly. Is $$\int \Psi^* \hat{Q} \Psi dx$$ ultimately equivalent to doing a change of basis and integrating w.r.t. the new variable? If so, where can I find the proof of this?

Edit: This question isn't a duplicate of the one it's been merged with. The other question asks about the general form of the expected value equation, and specifically why the terms in the integrand are ordered the way they are. My question, on the other hand, is about the integration variable used, which is something the other question doesn't even touch upon. Just because the question titles are superficially similar doesn't make them the same question. Before posting this question I had already looked at the other question, as well as every other question about the expectation value formula that I could find on the site. None of them even touch on the specific issue I'm asking about here. I've already gotten satisfactory responses to this question, but it still doesn't make sense to merge it with that other question that's only superficially similar.

• It's because one typically works in the wave-function which is the state in the "$x$-basis" so expectations are evaluated by integrals over $x$. If you choose to work with the Fourier transform of the wave-function, then you would integrate over $p$. If you choose to work with eigenstates of the Hamiltonian, then you would sum over energy levels. Mar 29, 2023 at 22:42
• Why the downvotes? What's the problem with the question? Mar 30, 2023 at 3:08
• @MikaylaEckelCifrese I didn't downvote, but I can imagine some people downvoted because your question is basically "Why is X true?" when X is not true. (That is, it's not true that expectation values are always integrals wrt $x$.)
– d_b
Mar 30, 2023 at 3:21
• Not a downvoter but it's a duplicate: e.g. physics.stackexchange.com/q/104747/226902 (and countless other similar questions... physics.stackexchange.com/q/128032/226902 , physics.stackexchange.com/q/299286/226902 ... ). Mar 30, 2023 at 9:16
• See e.g. this answer.. you do not have to use $dx$, just use any complete basis you may like (momentum, energy... whatever gives you a complete set of eigenvalues and represent the operator on that basis): physics.stackexchange.com/a/608560/226902 Mar 30, 2023 at 9:25

The expectation value of an operator is really the inner product with respect to a state $$\Psi$$, as $$\langle\Psi|\hat Q|\Psi\rangle$$. If you choose to write it in $$x$$ basis, then the inner product can be expanded as

$$\langle\Psi|\hat Q|\Psi\rangle=\int dx \Psi(x)^*\hat Q(x)\Psi(x)$$

but you can choose to expand it in any basis you choose.

Also, $$\Psi^{-1}\hat Q\Psi$$ is not the right way to change $$\hat Q$$ to a new basis. Instead, for example, if you want to change to momentum basis, just write

$$\Psi(x)=\int \frac{dp}{2\pi\hbar}e^{ipx/\hbar}\Phi(p)$$

Then,

\begin{align*} \int dx \Psi(x)^*\hat Q(x)\Psi(x)&=\int dx \int \frac{dp}{2\pi\hbar} \Phi(p)^* e^{-ipx/\hbar} \hat Q(x) \int \frac{dp^{\prime}}{2\pi\hbar} e^{ip^\prime x/\hbar} \Phi(p^\prime)\\ &= \int \frac{dp}{2\pi\hbar} \int \frac{dp^{\prime}}{2\pi\hbar} \Phi(p)^* \hat Q_{pp^\prime} \Phi(p^\prime) \end{align*}

where $$\hat Q_{pp^\prime}=\int dx e^{-ipx/\hbar} \hat Q(x) e^{ip^\prime x/\hbar}$$.