Let R be a prime ring, U the Utumi quotient ring of R, C = Z(U ) the extended centroid of R, L a non-central Lie ideal of R, and H, G nonzero generalized derivations of R. Suppose that there exists an integer n ≥ 1 such that H(u n )u n + u n G(u n ) ∈ C for all u ∈ L, then either there exists a ∈ U such that H(x) = xa and G(x) = −ax, or R satisfies the standard identity s4 and one of the following holds: (i) char(R) = 2; (ii) n is even and there exist a ∈ U , α ∈ C and derivations d, δ of R such that H(x) = a x + d(x) and G(x) = (α − a )x + δ(x); (iii) n is even and there exist a ∈ U and a derivation δ of R such that H(x) = xa and G(x) = −a x + δ(x); (iv) n is odd and there exist a , b ∈ U and α, β ∈ C such that H(x) = a x + x(β − b ) and G(x) = b x + x(α − a ); (v) n is odd and there exist α, β ∈ C and a derivation d of R such that H(x) = αx + d(x) and G(x) = βx + d(x); (vi) n is odd and there exist a ∈ U and α ∈ C such that H(x) = xa and G(x) = (α − a )x. As an application of this purely algebraic result, we obtain some range inclusion results of continuous or spectrally bounded generalized derivations H and