Complete the square to find the maximum or minimum value of a quadratic function