Quadratic functions and inequalities