﻿ Quadratic Functions and the Completing the Square Technique
QUADRATIC FUNCTIONS and the
COMPLETING THE SQUARE TECHNIQUE

DEFINITION quadratic function (standard form; vertex form)
Let $\,a\,$, $\,b\,$ and $\,c\,$ be real numbers, with $\,a \ne 0\,$.

A quadratic function is a function that can be written in the form $\ y = ax^2 + bx + c\$;
this is called the standard form of the quadratic function.

Every quadratic function can also be written in the form $\ y=a{(x-h)}^2 + k\$;
this is called the vertex form of the quadratic function.
COMMENTS ON THE DEFINITION:

• What type of term must a quadratic function have?
If $\,a = 0\,$ in the expression $\,ax^2 + bx + c\,$, then the $\,x^2\,$ term disappears.
Thus, the requirement that $\,a\ne 0\,$ says that a quadratic function must have an $\,x^2\,$ term.
• What other types of terms is a quadratic function allowed to have?
There are no restrictions placed on $\,b\,$ or $\,c\,$ in the definition of quadratic function;
they can be real number.
In particular, $\,b\,$ is allowed to equal zero, which causes the $\,x\,$ term to disappear.
Thus, a quadratic function may or may not have an $\,x\,$ term.
Similarly, $\,c\,$ is allowed to equal zero, which causes the constant term to disappear.
Thus, a quadratic function may or may not have a constant term.
• Summary of terms types in a quadratic function:
A quadratic function must have an $\,x^2\,$ term; it is allowed to have an $\,x\,$ term;
it is allowed to have a constant term. It may not have any other types of terms.
• Quadratic functions go by different names
Like all expressions, $\,ax^2 + bx + c\,$ has lots of different names;
standard form and vertex form are just two names that are popular (since they're quite useful).
Different names are good for different purposes, so you should be able to switch from one to the other.
Going from vertex form, $\,a(h-k)^2 + k\,$, to standard form is easy—just multiply out.
Going from standard form, $\,ax^2 + bx + c\,$, to vertex form is harder,
and requires a technique that is explored in this section—the ‘completing the square technique’.
• Why is the name ‘vertex form’ appropriate?
As derived in Equations of Simple Parabolas,
equations of the form $\ y = a{(x-h)}^2 + k\$ graph as parabolas,
where $\,(h,k)\,$ is the vertex of the parabola.
Hence, the name vertex form is appropriate,
since it's easy to read the coordinates of the vertex from vertex form.
• What does the graph of a quadratic function look like?
Every quadratic function graphs as a parabola with directrix parallel to the $\,x$-axis.
If $\,a \gt 0\,$ then the parabola is concave up (hold water).
If $\,a \lt 0\,$ then the parabola is concave down (sheds water).

Before discussing the technique of completing the square, a preliminary definition is needed:

DEFINITION perfect square trinomial
A perfect square trinomial is a trinomial that can be written in the form $\,(x+k)^2\,$.

All of the following are perfect square trinomials: $$\begin{gather} x^2 + 2x + 1 = {(x+1)}^2\cr\cr x^2 - 6x + 9 = {(x-3)}^2\cr\cr x^2 + \frac{4}{5}x + \frac{4}{25} = {\bigl(x + \frac{2}{5}\bigr)}^2 \end{gather}$$

An investigation of $\,(x+k)^2 = x^2 + 2kx + k^2\,$ shows that there is a very simple relationship
between the coefficient of the $\,x\,$ term ($\,2k\,$) and the constant term ($\,k^2\,$) in a perfect square trinomial:
take the coefficient of the $\,x\,$ term, divide it by $\,2\,$, and then square the result, to obtain the constant term!

In other words, how can you get from $\,2k\,$ to $\,k^2\,$?
Divide by two, and then square: $$2k \ \ \overset{\text{divide by } 2}{\rightarrow} \ \ k \ \ \overset{\text{square}}{\rightarrow} \ \ k^2$$ This is the key observation in the following technique:

COMPLETING THE SQUARE TECHNIQUE
The process of finding the correct number to add to an expression of the form $\ x^2+bx\$ to form a perfect square trinomial is called completing the square.

The correct number to add is $\displaystyle\,{\left(\frac{b}{2}\right)}^2\,$.
That is, take the coefficient of the $\,x\,$ term, divide it by $\,2\,$, and then square the result.

Then: $$\overset{\text{start with this}}{\overbrace{x^2 + bx}} + \overset{\text{and add this number}}{\overbrace{ {\left(\frac{b}{2}\right)}^2}} = \overset{\text{to get a perfect square}}{\overbrace{ {\left(x + \frac{b}{2}\right)}^2}}$$
EXAMPLE   (completing the square)
Question:
What number must be added to $\ x^2 - 3x\$ to form a perfect square trinomial?
Then, what perfect square trinomial results?
Solution:
The $\,x\,$ term is $\,-3x\,$;   the coefficient of the $\,x\,$ term is $\,-3\,$.
Take this number, divide it by $\,2\,$, and then square it:   thus, the number to add is $\ {(\frac{-3}{2})}^2\,$.
The perfect square trinomial that results is:
$x^2 - 3x + (\frac{-3}{2})^2 = {(x-\frac{3}{2})}^2$
Notice that the number inside the parentheses gets plopped down next to $\,x\,$ in the resulting perfect square: $$x^2-3x+\bigl( \overset{\text{the # inside}}{\overbrace{ \frac{-3}{2}}} \bigr)^2 \overset{\rightarrow \rightarrow \rightarrow \rightarrow}{ \vphantom{\left(\frac{{{{{-3}^2}^2}^2}^2}{2}\right)} = }\bigl(\ \ x\overset{\text{goes here}}{\overset{\downarrow}{-\frac{3}{2}}}\bigr)^2$$
CAUTION! COMPLETING THE SQUARE CHANGES THE EXPRESSION!

Be careful—when you add $\,{(\frac{b}{2})}^2\,$ to complete the square, you are changing the expression that you started with!

In other words, the expression you started with (which wasn't a perfect square)
and the expression you end up with (which is a perfect square) are different.

Sometimes you just want to rename an expression in a form that involves a perfect square;
you don't want to change the original expression.
In this situation, when you add $\,{(\frac{b}{2})}^2\,$, you also have to subtract it at the same time.
This is illustrated in the next example:

EXAMPLE   (renaming as an expression involving a perfect square trinomial)
Question: Rename $\ x^2+6x\$ as an expression involving a perfect square trinomial.
Solution: Note that $\,{(\frac{6}{2})}^2 = 3^2 = 9\,$.
 $\,x^2+6x\,$ (starting expression) $\ \ =x^2+6x+9-9$ (add zero in an appropriate form) $\ \ =(x^2+6x+9)-9$ (regroup) $\ \ =(x+3)^2-9$ (rename the perfect square)

The technique of completing the square only works when the coefficient of the $\,x^2\,$ term is $\,1\,$.
Any other coefficient must be factored out before completing the square, as shown next.

GOING FROM STANDARD FORM TO VERTEX FORM

In what follows, the completing the square technique is applied to the standard form, $\,ax^2+bx+c\,$,
to change it to vertex form, $\,a{(x-h)}^2+k\,$:

 $\,ax^2+bx+c\,$ (original expression) $\ \ = (ax^2+bx)+c$ (group first two terms) $\ \ =a(x^2+\frac{b}{a}x)+c$ (factor $\,a\ne 0\,$ out of the first two terms) $\ \ =a\left(x^2+\frac{b}{a}x+{(\frac{b}{2a})}^2 - {(\frac{b}{2a})}^2 \right)+c$ (add zero in an appropriate form inside the parentheses; note that $\,\frac{b}{a}\div 2=\frac{b}{a}\cdot \frac{1}{2}=\frac{b}{2a}\,$) $\ \ =a\left(x^2+\frac{b}{a}x+{(\frac{b}{2a})}^2 \right) - a{(\frac{b}{2a})}^2 + c$ (distributive law) $\ \ =a{(x+\frac{b}{2a})}^2 + \text{stuff}$ (rename as a perfect square)

Notice that the $\,x\,$-value of the vertex is $\,-\frac{b}{2a}\,$.   This is worth recording and memorizing.
Don't bother memorizing the yucky formula for the $\,y$-value of the vertex;
once you have the $\,x$-value, it's easy to compute the corresponding $\,y$-value.

VERTEX OF A QUADRATIC FUNCTION IN STANDARD FORM
Let $\,a\ne 0\,$.
The vertex of the parabola $\ y=ax^2+bx+c\$ has $\,x\,$-value equal to $\displaystyle\,-\frac{b}{2a}\,$.
In this context, the expression $\displaystyle\,-\frac{b}{2a}\,$ is often called the vertex formula.

To conclude, we look at two different methods for going from standard form to vertex form:

EXAMPLE   (going from standard form to vertex form)
Question:
Write $\,y=5x^2+3x-1\,$ in vertex form and give the coordinates of the vertex.
First Solution:
Use the technique of completing the square to put the function in vertex form:

\begin{align} y &= 5x^2+3x-1\cr &= 5(x^2 +\frac{3}{5}x) - 1\cr &= 5\left(x^2 +\frac{3}{5}x+{(\frac{3}{10})}^2 - {(\frac{3}{10})}^2\right)-1\cr &= 5{\bigl(x +\frac{3}{10}\bigr)}^2-5\cdot \frac{9}{100}-1\cr &= 5{\bigl(x+\frac{3}{10}\bigr)}^2 - \frac{29}{20} \end{align}

Thus, the vertex is $\displaystyle\,\bigl(-\frac{3}{10},-\frac{29}{20}\bigr)\,$.
Second Solution:
• Use the vertex formula to find the $\,x$-value of the vertex:
$\displaystyle-\frac{b}{2a} = -\frac{3}{2(5)} = -\frac{3}{10}\,$
• Find the corresponding $\,y$-value:
$\displaystyle y = \,5(-\frac{3}{10})^2+3(-\frac{3}{10})-1 = -\frac{29}{20}\,$
• Substitute the values of $\,a\,$, $\,h\,$ and $\,k\,$ into $\ y = a(x-h)^2 + k\,$:
With $\,h = -\frac{3}{10}\,$, $\,k = -\frac{20}{29}\,$, and $\,a = 5\,$, vertex form is $\displaystyle\ y=5{\bigl(x +\frac{3}{10}\bigr)}^2 -\frac{29}{20}\$.

Finally, you could zip up to WolframAlpha and type in:

vertex of y = 5x^2 + 3x - 1

Using the coordinates of the vertex, it's then easy to write the vertex form yourself!

Master the ideas from this section
by practicing the exercise at the bottom of this page.

When you're done practicing, move on to:
Algebraic Definition of Absolute Value

On this exercise, you will not key in your answer.
However, you can check to see if your answer is correct.
PROBLEM TYPES:
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
AVAILABLE MASTERED IN PROGRESS
 (MAX is 18; there are 18 different problem types.)