A product of two generalized derivations on polynomials in prime rings