Let $R$ be a prime ring, $I$ a nonzero ideal of $R$, $d$ a derivation of $R$ and $m, n$ fixed positive integers. (i) If $(d[x,y])^{m}=[x,y]_{n}$ for all $x,y\in I$, then $R$ is commutative. (ii) If $\mathop {\rm Char}R\neq 2$ and $[d(x),d(y)]_{m}=[x,y]^{n}$ for all $x,y\in I$, then $R$ is commutative. Moreover, we also examine the case when $R$ is a semiprime ring.