Maximum and minimum of a quadratic function

The maximum or minimum of a quadratic function is found at the vertex of its graph. Let us find the maximum of y=x2+4x1y = -x^2 + 4x - 1.

Since the coefficient of x2x^2 is negative, this graph is a downward-opening parabola. When it opens downward, the vertex is the highest point of the graph, where the function attains its maximum (there is no lower bound, so no minimum).

We find the vertex by completing the square: x2+4x1=(x24x)1=((x2)24)1=(x2)2+3-x^2 + 4x - 1 = -(x^2 - 4x) - 1 = -\left((x - 2)^2 - 4\right) - 1 = -(x - 2)^2 + 3, so the vertex is (2,3)(2, 3). Since (x2)2-(x - 2)^2 is 1-1 times a square, it is always at most 00, and it is largest when x=2x = 2. So the maximum value 33 is taken at x=2x = 2.

In general y=a(xp)2+qy = a(x - p)^2 + q has, when a<0a < 0 (opening downward), a maximum qq at x=px = p, and when a>0a > 0 (opening upward), a minimum qq at x=px = p. Whether it is a maximum or a minimum depends only on the sign of the coefficient of x2x^2. The large dot on the graph is the vertex (2,3)(2, 3), where the maximum is attained.