Let R be a noncommutative prime ring of characteristic different from 2 with Utumi quotient ring U and extended centroid C, I a nonzero right ideal of R. Let f (x 1 , . . . , x n ) be a noncentral multilinear polynomial over C, m ≥ 1 a fixed integer, a a fixed element of R, g a generalized derivation of R. If ag( f (r 1 , . . . , r n )) m = 0 for all r 1 , . . . , r n ∈ I , then one of the following holds: (1) a I = ag(I ) = (0); (2) g(x) = q x, for some q ∈ U and aq I = 0;is an identity for I ; (4) g(x) = cx + [q, x] for all x ∈ R, where c, q ∈ U such that cI = 0 and [q, I ]I = 0.2000 Mathematics subject classification: primary 16N60, 16W25.