Commutator of scalar field and its spatial derivative Consider the usual commutation relations of two scalar fields
$$\left[\phi_{m}\left(t,\boldsymbol{x}\right),\pi_{n}\left(t,\boldsymbol{y}\right)\right]=\boldsymbol{i}\delta_{mn}\delta\left(\boldsymbol{x}-\boldsymbol{y}\right),$$
$$\left[\phi_{m}\left(t,\boldsymbol{x}\right),\phi_{n}\left(t,\boldsymbol{y}\right)\right]=\left[\pi_{m}\left(t,\boldsymbol{x}\right),\pi_{n}\left(t,\boldsymbol{y}\right)\right]=0.$$


*

*What's the commutator of $\left[\partial_{i}\phi_{m}\left(t,\boldsymbol{x}\right),\phi_{n}\left(t,\boldsymbol{y}\right)\right]$, where $\partial_{i}\equiv\partial/\partial x^{i}$ is one of the three spatial derivatives? 

*What about $\left[\partial_{i}\phi_{m}\left(t,\boldsymbol{x}\right),\pi_{n}\left(t,\boldsymbol{y}\right)\right]$ ?
Attempt 1:
$$\begin{array}{cl}
\left[\partial_{i}\phi\left(t,\boldsymbol{x}\right),\phi\left(t,\boldsymbol{y}\right)\right] & =\partial_{i}\left[\phi\left(t,\boldsymbol{x}\right),\phi\left(t,\boldsymbol{y}\right)\right]+\left[\partial_{i},\phi\left(t,\boldsymbol{y}\right)\right]\phi\left(t,\boldsymbol{x}\right)\\
 & =\left[\partial_{i},\phi\left(t,\boldsymbol{y}\right)\right]\phi\left(t,\boldsymbol{x}\right)\\
 & =\left(\partial_{i}\phi\left(t,\boldsymbol{y}\right)\right)\phi\left(t,\boldsymbol{x}\right)-\phi\left(t,\boldsymbol{y}\right)\partial_{i}\phi\left(t,\boldsymbol{x}\right)\\
 & =?
\end{array}$$
 A: Since we're not taking time derivatives, this is actually a pretty simple thing, but something that, for some reason, doesn't really pop out on a first viewing of a problem like this. 
The confusion perhaps arises from the fact that you have two types of operators acting on different spaces. You have the derivative operator $\partial_i$ acting on the space of functions from $\mathbb{R}^n$ to some general algebra of fields. You also have the field operators themselves, acting on your Hilbert space $\mathcal{H}$. Since these two operators act on different spaces, then we have
$$\left[\frac{\partial}{\partial x^i}\phi(\textbf{x},t),\phi(\textbf{y},t)\right]=\frac{\partial}{\partial x^i}\left[\phi(\textbf{x},t),\phi(\textbf{y},t)\right]=0.$$
That is to say, you can pull out the derivative since only the first term in the commutator depends on $\textbf{x}$. Similarly, we have
$$\left[\frac{\partial}{\partial x^i}\phi(\textbf{x},t),\pi(\textbf{y},t)\right]=\frac{\partial}{\partial x^i}\left[\phi(\textbf{x},t),\pi(\textbf{y},t)\right]=i\frac{\partial}{\partial x^i}\delta(\textbf{x}-\textbf{y}).$$
I don't know what it is about this question that trips people up (including myself the first time I was faced with something like this), but it's a lot simpler than it's made out to be.
A: Here is one formal way to think about it: 


*

*Use the Jacobi identity (JI) for commutators,

*and use the fact that a spatial derivative $\partial_x$ satisfies Leibniz product rule (LPR):
$$ [\partial_x, f]g~\equiv~\partial_x (fg)-f(\partial_x g)~\stackrel{LPR}{=}~(\partial_x f)g\quad\Rightarrow\quad  [\partial_x, f]~\stackrel{LPR}{=}~ (\partial_x f).$$
Then
$$ [(\partial_x \phi (x)), \pi (y)]~\stackrel{LPR}{=}~[[\partial_x,\phi (x)],\pi (y)]
~\stackrel{JI}{=}~[\partial_x,[\phi (x),\pi (y)]]-[\phi (x),[\partial_x,\pi (y)]]$$
$$~\stackrel{CCR}{=}~[\partial_x,i\hbar \delta(x\!-\!y)]-[\phi (x),0]
~\stackrel{LPR}{=}~i\hbar  (\partial_x\delta(x\!-\!y)) ,$$
and so forth.
