Critical polynomials related to generalized derivations