generalized differentiation