Let R be a prime ring, Q its symmetric Martindale quotient ring, C its extended centroid, I a nonzero ideal of R, and F a generalized derivation with associated derivation d of R, m ≥ 1, n ≥ 1 two fixed integers, and 0 ≠ a ∈ R.Assume that a((F([x, y]))m − [x, y]n) = 0, for all x, y ∈ I, then one of the following statements holds:R is commutative;n = m = 1 and there exists b ∈ Q such that F(x) = bx for all x ∈ R with ab = a;There exists b ∈ C such that F(x) = bx for all x ∈ R with bm = 1 and [x, y]m = [x, y]n, for all x, y ∈ R;R ⊆ M2(C), the ring of 2 × 2 matrices over C; n = 1 and m ≥ 2 such that αm = α for all α ∈C; and there exists b ∈ Q such that F(x) = bx for all x ∈ R with ab = a;R ⊆ M2(C) and char(R) = 2.Assume that char(R) ≠ 2 and a((F([x, y]))m − [x, y]n) ∈ Z(R) for all x, y ∈ I. If there exist x0, y0 ∈ I such that a((F([x0, y0]))m − [x0, y0]n) ≠ 0, then either there exists a field E such that R ⊆ M2(E) or a ∈ Z(R), [x, y]m − [x, y]n ∈ Z(R) for any x, y ∈ R, and there exist b, c ∈ Z(R) sucht that (b + c)m = 1.