Quadratic Functions:   Complete the Square

Introduction:

Completing the square is an algebraic process that rewrites a quadratic function from standard form:   \(f(x)=ax^2+bx+c\), into vertex form:   \( f(x)=a(x-h)^2+k\), where the point \((h,k)\) represents the vertex.   The process shown below focuses on the leading coefficient, \(a=1\).   This is the main skill needed by Algebra 1 students.   The final example shows the optional case for \(a\ne1\).


Example

Consider \(f(x)=x^2-6x+11\).   The steps below outline the process for completing the square:

Steps Description Example
#1: Start with \(b\) and divide by 2: \(b=-6 \longrightarrow \frac{-6}{2}=-3\)
#2: Square \(\large{\frac{b}{2}}\) from Step 1: \(-3\longrightarrow \left(-3\right)^2=9\)
#3: Now add and subtract \(\left(\frac{b}{2}\right)^2\) into the equation: \(f(x)=x^2-6x\color{green}{+9}\color{red}{-9}+11\)
#4: Form a "new" trinomial and add like terms: \(f(x)=\color{blue}{(x^2-6x+9)}+(-9+11)\longrightarrow f(x)=\color{blue}{(x^2-6x+9)}+2\)
#5: Factor the trinomial into vertex form: \(f(x)=(x-3)^2+2\)

From the vertex form \(f(x)=(x-3)^2+2\), \(h=3\) and \(k=2\) giving the vertex of \((3,2)\).
Note:   Many examples combine Steps #1 and #2 into one step.


Example

Consider \(y=x^2+26x+150\).   Complete the square and identify the vertex.


Completing the Square to Solve Equations

While this method is probably the last method one would choose to solve a quadratic equation, completing the square is a valid method to solve:

Solve the equation:  \(x^2-2x-2=0\).

$$\begin{array}{l} b=-2\rightarrow\frac{-2}{2}=-1,\;(-1)^2=1 \\ \implies x^2-2x\color{green}{+1}\color{blue}{-1}-2=0 \\ \implies (x-1)^2-3=0 \end{array}$$
Now apply the Square Roots Method: $$\begin{array}{l} (x-1)^2-3=0 \\ \implies (x-1)^2=3 \\ \implies x-1=\pm\sqrt{3} \\ \implies x=1\pm\sqrt{3}\;\color{green}{\checkmark}\end{array}$$

Solve the equation:  \(x^2-x=30\).

$$\begin{array}{l} b=-1\rightarrow\frac{-1}{2}=\frac{-1}{2},\;\left(\frac{-1}{2}\right)^2=\frac{1}{4} \\ \implies x^2-x\color{green}{+\frac{1}{4}}\color{blue}{-\frac{1}{4}}=30 \\ \implies (x-\frac{1}{2})^2=30+\frac{1}{4} \\ \implies (x-\frac{1}{2})^2=\frac{120}{4}+\frac{1}{4} \\ \implies x-\frac{1}{2}=\pm\sqrt{\frac{121}{4}} \\ \implies x=\frac{1}{2}\pm\frac{11}{2} \\ \implies x=\frac{1}{2}+\frac{11}{2}\;\& \;x=\frac{1}{2}-\frac{11}{2} \\ \implies x=\frac{12}{2},\;x=6\color{green}{\checkmark}\;\& \;x=\frac{-10}{2},\;x=-5\color{green}{\checkmark} \end{array}$$


OPTIONAL

This final example shows how to complete the square when the quadratic has \(a\ne1\).   There is really only one additional step here, divide every term by \(a\).   This then turns into a quadratic with \(a=1\), and the process can by applied.

Example

Consider \(f(x)=4x^2+32x-40\).   Complete the square after dividing out the leading \(4\).

Divide out the \(4\): \(\large{\frac{f(x)}{4}}\normalsize{=}\large{\frac{4x^2}{4}+\frac{32x}{4}-\frac{40}{4}}\normalsize{\implies}\large{\frac{f(x)}{4}}\normalsize{=x^2+8x-10}\)
Now proceed as above: \(b=8\) so divide by \(2\) and square \(\implies \left(\frac{8}{2}\right)^2=16\)
Add/subtract back in: \(\large{\frac{f(x)}{4}}\normalsize{=x^2+8x+16-16-40}\)
Factor and add like terms: \(\large{\frac{f(x)}{4}}\normalsize{=(x+8)^2-56}\)
Multiply back by \(4\) we divided out at start: \(f(x)=4(x+8)^2-56\)