Derivative of a cubic function