I am taking my first course in QFT and have come across this problem
From the canonical commutation relations for a real scalar field $\hat{\phi}$ show that
$[\partial^i \hat{\phi} , \hat{\phi}] = 0$
From the canonical commutation relations for a real scalar field $\hat{\phi}$ show that $$[\partial_i \hat{\phi} , \hat{\phi}] = 0,$$ where $i$ is a spatial index.
I have had an attempt but I'm not sure if what I'm doing is allowed. What I did is
The cannonical commutation relation tells us
$[ \hat{\phi} (x^0,x^i) , \hat{\phi}(x^0,x^{'i})] = \hat{\phi} (x^0,x^i)\hat{\phi} (x^0,x^{'i})-\hat{\phi} (x^0,x^{'i})\hat{\phi} (x^0,x^{i})= 0 $
Taking $\frac{\partial}{\partial x_i}$
$\frac{\partial \hat{\phi} (x^0,x^i)}{\partial x_i}\hat{\phi} (x^0,x^{'i})-\hat{\phi} (x^0,x^{'i})\frac{\partial \hat{\phi} (x^0,x^i)}{\partial x_i}= 0$
Then set $x'=x$
$[\partial^i \hat{\phi} (x^0,x^i),\hat{\phi} (x^0,x^i)]=0$