Let $R$ be an associative ring with center $Z(R)$ and $d$ a nonzero derivation of $R$. The main object in this paper is to study the situation $[[d(x^r)x^n,x^r]_s,[y,d(y)]_t]^m\in Z(R)$ for all $x,y$ in some appropriate subset of $R$, where $n\geq 0$, $s\geq 0$, $t\geq 0$, $m\geq 1$, $r\geq 1$ are fixed integers and $R$ is a prime or semiprime ring.