Let R be a prime ring with extended centroid C and f(X-1, ... ,X-t) a nonzero polynomial over C. Suppose d is a nonzero derivation of R such that [d(f(x(1), ... , x(t))), s(x(1) , ... , x(t))](k) = 0 for all x(1), ... , x(t) in some nonzero left ideal lambda of R, where k is a fixed positive integer. Then lambda C = RCe for some idempotent e in the socle of RC and the following statements hold: (i) f(X-1, ... , X-t) is central-valued on eRCe except when C is finite or 0 < char R less than or equal to k + 1. (ii) In the case of char R = p > 0, f(X-1, ... , X-t)(ps) is central-valued on eRCe for some integer s greater than or equal to 0 except when p = 2 and dim(C) eRCe = 4. (iii) If f(X-1, ... , X-t) is multilinear, then it is central-valued on eRCe except when char R = 2 and dime eRCe = 4.