# How can difference of two operators produce a constant?

In the canonical commutation relations, $$[\hat{x}, \hat{p}] = \hat{x}\hat{p} - \hat{p}\hat{x} = i \hbar$$ Both $$\hat{x}$$ and $$\hat{p}$$ are operators and so are $$\hat{x}\hat{p}$$ and $$\hat{p}\hat{x}$$. How does their difference turn out to be a constant? Shouldn't it also be an operator?

• The RHS is missing the identity operator $I$ - which is usually omitted for notation convenience... Sep 18, 2023 at 14:40
• $i\hbar$ has to be understood as $i\hbar I$... Sep 18, 2023 at 14:40
• The operators also must act on a wave function, which is why it is often discouraged to write the operators this way. This reads "the commutator of position and momentum acting on a wave function returns the wave function times a constant." Sep 18, 2023 at 14:50
• Sep 18, 2023 at 21:42

The quantities that are not commuting in your example are the Hermitian operators associated with the position and momentum observables.

$$\hat{x} = x$$

$$\hat{p} = -i\hbar\frac{\partial}{\partial x}$$

By substituting these operators into the commutation relation, and remembering that they act on a dummy wavefunction $$\psi(x)$$ you get:

$$[\hat{x},\hat{p}] \psi(x) = \hat{x}\hat{p} \psi(x) - \hat{p}\hat{x} \psi(x) = -i\hbar x \frac{\partial \psi}{\partial x} - -i\hbar \frac{\partial}{\partial x}\left( x \psi(x)\right)$$

This requires the product rule to evaluate the derivative in the 2nd term.

$$[\hat{x},\hat{p}] \psi(x) = -i\hbar x \frac{\partial \psi}{\partial x} + i\hbar \psi + i\hbar x \frac{\partial \psi}{\partial x} = i\hbar \psi(x)$$

The resultant operator is then simply $$[\hat{x},\hat{p}] = i\hbar$$

Et voila.