min and max x^2 + c*x + d