In this paper, the following commutativity theorem is proved: Let $R$ be a left (resp. right) $s$-unital ring, and let $m>1$, $n$, $r$ and $s$ be fixed non-negative integers. If $R$ satisfies the polynomial identity $[x^ry\pm x^ny^mx^s,x]=0$ (resp. $[yx^r\pm x^ny^mx^s,x]=0$) for all $x,y\in R$, then $R$ is commutative. Other related results are also obtained for the case $m=1$.