A quadratic function is a function of the form
If a is positive then the graph of f(x) is shaped like a valley and the function f(x) has a minimum. If a is negative then the graph of the function f(x) is shaped like a mountain and the function f(x) has a maximum. See the graphs below.

We can rewrite the function f(x) as shown below.

The important part of the formula on the right hand side of the last line is the factor

which is the only factor involving x. The important part of this factor is the term

which is the only term involving x. Notice that this term is zero if x = -b/2a and is positive otherwise. Therefore the minimum value of

is

and occurs when

If a is positive then the minimum value of f(x) is

and occurs when

If a is negative then the maximum value of f(x) is

and occurs when
