Commutator of $x$ and $p^2$ I have a question:
If I have to find the commutator $[x, p^2]$ (with $p= {h\over i}{d \over dx} $) the right answer is:
$[x,p^2]=x p^2 - p^2x = x p^2 -pxp + pxp - p^2x = [x,p]p + p[x,p] = 2hip$
But why can't I say:
$[x,p^2]=x p^2 - p^2x = - x h^2{d^2 \over dx^2} + h^2 {d^2 \over dx^2}x = 0$  ?
Thank you for your reply.

You treat $x$ like a scalar when in fact it is an operator. Let's write it as $\hat{x}$ instead. Then $[\hat{x}, p^2]$ is also an operator, so let's see what happens when we apply an arbitrary function $\psi$ to it.
\begin{align}
[\hat{x},p^2]\psi&=\left(\hat{x}p^2-p^2\hat{x}\right)\psi \\
&=-xh^2\frac{\mathrm{d}^2}{\mathrm{d}x^2}\psi+h^2\frac{\mathrm{d}^2}{\mathrm{d}x^2}(x\psi) \\
&=-xh^2\frac{\mathrm{d}^2}{\mathrm{d}x^2}\psi+h^2x\frac{\mathrm{d}^2}{\mathrm{d}x^2}\psi+2h^2\frac{\mathrm{d}}{\mathrm{d}x}\psi \\
&=2h^2\frac{\mathrm{d}}{\mathrm{d}x}\psi \\
&=2hi\frac{h}{i}\frac{\mathrm{d}}{\mathrm{d}x}\psi=2hip\psi
\end{align}
so that $[\hat{x},p^2]=2hip$.
