Consider a commutator acting on a 1D wavefunction: $$[\frac{\hbar}{i} \frac{d}{dx},x]\psi(x)=(\frac{\hbar}{i} \frac{d}{dx}x-x\frac{\hbar}{i} \frac{d}{dx})\psi(x).$$
Now does this mean
- $\frac{\hbar}{i} (\frac{d}{dx}x) \psi(x)-x\frac{\hbar}{i} \frac{d}{dx} \psi(x)$ or
- $\frac{\hbar}{i} (\frac{d}{dx}x \psi(x))-x\frac{\hbar}{i} \frac{d}{dx} \psi(x)?$
In the first cast $\frac{d}{dx}$ only acts on $x$. In the second case $\frac{d}{dx}$ acts on $x\psi (x)$. Which is correct?