The aim of the paper is to study the commuting generalized derivations. Suppose that R is a prime ring of char(R) not equal 2, pi(xi(1), ...,xi(n)) is a noncentral multilinear polynomial over C and T-1, T-2 and T-3 are generalized derivations on R. If T-2(xi)T-1(xi) = T-1(xi)xi - xi T-3(xi) for all xi = pi(xi(1), ...,xi(n)) is an element of f(R), then we describe all possible forms of T-1, T-2 and T-3.