[cross-reference to target(s) "ccog-solve-by-completing-the-square" missing or not unique]
In this section, we will learn how to “complete the square” with a quadratic expression. This topic is useful for solving quadratic equations and putting quadratic functions in vertex form.
Subsection13.3.1Solving Quadratic Equations by Completing the Square
When we have an equation like \((x+5)^2=4\text{,}\) we can solve it quickly using the square root property:
The method of completing the square allows us to solve any quadratic equation using the square root property.
Suppose you have a small quadratic expression in the form \(x^2+bx\text{.}\) It can be visualized as an “L”-shape as in Figure 2.
The “missing” square in the upper right corner of Figure 2 is \(\frac{b}{2}\) on each side, so its area is \(\left(\frac{b}{2}\right)^2\text{.}\) This means that if we have \(x^2+bx\) and add \(\left(\frac{b}{2}\right)^2\text{,}\) we are “completing” the larger square.
Fact13.3.3.The Term that Completes the Square.
For a polynomial \(x^2+bx\text{,}\) the constant term needed to make a perfect square trinomial is \(\highlight{\left(\frac{b}{2}\right)^2}\text{.}\)
Process13.3.4.Completing the Square.
For a quadratic equation simplified to the form \(x^2+bx=c\text{,}\) to solve for \(x\) by completing the square,
Use Fact 3 to find the number to add to both sides of the equation to make the left hand side a perfect square. This number is always \(\highlight{\left(\frac{b}{2}\right)^2}\text{.}\)
Add that number to both sides of \(x^2+bx=c\) to get
The left hand side is now a perfect square that factors as \(x^2+bx+\left(\frac{b}{2}\right)^2=\left(x+\frac{b}{2}\right)^2\text{,}\) so the equation becomes
Solve the quadratic equation \(x^2+6x=16\) by completing the square.
Explanation.
To solve the quadratic equation \(x^2+6x=16\text{,}\) on the left side we can complete the square by adding \(\left(\frac{b}{2}\right)^2\text{;}\) note that \(b=6\) in this case, which makes \(\left(\frac{b}{2}\right)^2=\left(\frac{6}{2}\right)^2=3^2=9\text{.}\) We add it to both sides to maintain equality.
Now let’s see the process for completing the square when the quadratic equation is given in standard form.
Example13.3.6.
Solve \(x^2-14x+11=0\) by completing the square.
Explanation.
We see that the polynomial on the left side is not a perfect square trinomial, so we need to complete the square. We subtract \(11\) from both sides so we can add the missing term on the left.
Next comes the completing-the-square step. We need to add the correct number to both sides of the equation to make the left side a perfect square. Remember that Fact 3 states that we need to use \(\left(\frac{b}{2}\right)^2\) for this. In our case, \(b=-14\text{,}\) so \(\left(\frac{b}{2}\right)^2=\left(\frac{-14}{2}\right)^2=49\)
The solution set is \(\{7-\sqrt{38}, 7+\sqrt{38}\}\text{.}\)
Checkpoint13.3.7.
Complete the square to solve for \(y\) in \(y^2-20y-21=0\text{.}\)
Explanation.
To complete the square, first move the constant term to the right side of the equation. Then use Fact 3 to find \(\left(\frac{b}{2}\right)^2\) to add to both sides.
So far, the value of \(b\) has been even each time, which makes \(\frac{b}{2}\) a whole number. When \(b\) is odd, we end up adding a fraction to both sides. Here is an example.
Example13.3.8.
Complete the square to solve for \(z\) in \(z^2-3z-10=0\text{.}\)
Explanation.
First move the constant term to the right side of the equation:
Next, to complete the square, we need to find the right number to add to both sides. According to Fact 3, we need to divide the value of \(b\) by \(2\) and then square the result to find the right number. First, divide by \(2\text{:}\)
Now, to factor the seemingly complicated expression on the left, just know that it should always factor using the number from the first step in the completing the square process, Equation (13.3.1).
In each of the previous examples, the value of \(a\) was equal to \(1\text{.}\) This is necessary for our missing term formula to work. When \(a\) is not equal to \(1\) we will divide both sides by \(a\text{.}\) Let’s look at an example of that.
Example13.3.9.
Solve for \(r\) in \(2r^2+2r=3\) by completing the square.
Explanation.
Because there is a leading coefficient of \(2\text{,}\) we divide both sides by \(2\text{.}\)
The solution set is \(\left\{\frac{-1-\sqrt{7}}{2}, \frac{-1+\sqrt{7}}{2}\right\}\text{.}\)
Subsection13.3.2Deriving the Quadratic Formula by Completing the Square
In Section 7.2, we learned the Quadratic Formula. You may have wondered where the formula comes from, and now that we know how to complete the square, we can derive it. We will solve the standard form equation \(ax^2+bx+c=0\) for \(x\text{.}\)
First, we subtract \(c\) from both sides and divide both sides by \(a\text{.}\)
Now that we have completed the square, we can see that the \(x\)-value of the vertex is \(-\frac{b}{2a}\text{.}\) That is the vertex formula. Next, we solve the equation using the square root property to find the Quadratic Formula.
This shows us that the solutions to the equation \(ax^2+bx+c=0\) are \(\frac{-b\pm\sqrt{b^2-4ac}}{2a}\text{.}\)
Subsection13.3.3Putting Quadratic Functions in Vertex Form
In Section 2, we learned about the vertex form of a parabola, which allows us to quickly read the coordinates of the vertex. We can now use the method of completing the square to put a quadratic function in vertex form. Completing the square with a function is a little different than with an equation so we will start with an example.
Example13.3.10.
Write a formula in vertex form for the function \(q\) defined by \(q(x)=x^2+8x\)
Explanation.
The formula is in the form \(x^2+bx\text{,}\) so we need to add \(\left(\frac{b}{2}\right)^2\) to complete the square by Fact 3. When we had an equation, we could add the same quantity to both sides. But now we do not wish to change the left side, since we are trying to end up with a formula that still says \(q(x)=\ldots\text{.}\) Instead, we add and subtract the term from the right side in order to maintain equality. In this case,
To maintain equality, we both add and subtract \(16\) on the same side of the equation. It is functionally the same as adding \(0\) on the right, but the \(16\) makes it possible to factor the expression in a particular way:
Now that we have completed the square, our function is in vertex form. The vertex is \((-4,-16)\text{.}\) One way to verify that our work is correct is to graph the original version of the function and check that the vertex is where it should be.
Let’s look at a function that has a constant term and see how to complete the square.
Example13.3.12.
Write a formula in vertex form for the function \(f\) defined by \(f(x)=x^2-12x+3\)
Explanation.
To complete the square, we need to add and subtract \(\left(-\frac{12}{2}\right)^2=(-6)^2=36\) on the right side.
In the first two examples, \(a\) was equal to \(1\text{.}\) When \(a\) is not equal to one, we have an additional step. Since we are working with an expression where we intend to preserve the left side as \(f(x)=\ldots\text{,}\) we cannot divide both sides by \(a\text{.}\) Instead we factor \(a\) out of the first two terms. Let’s look at an example of that.
Example13.3.13.
Write a formula in vertex form for the function \(g\) defined by \(g(x)=5x^2+20x+25\)
Explanation.
Before we can complete the square, we factor the \(\highlight{5}\) out of the first two terms.
Notice that the constant that we subtracted is inside the parentheses, but it will not be part of our perfect square trinomial. In order to bring it outside, we need to multiply it by \(5\text{.}\) We are distributing the \(5\) to that term so we can combine it with the outside term.
Next, we complete the square for \(x^2+\frac{4}{3}x\) inside the grouping symbols by adding and subtracting the right number. To find that number, we divide the value of \(b\) by two and square the result. That looks like:
Remember that when completing the square, the expression should always factor with the number found in the first step of the completing-the-square process, Equation (13.3.7).
The vertex is \(\left(-\frac{2}{3},-\frac{5}{12}\right)\text{.}\)
Completing the square can also be used to find a minimum or maximum in an application.
Example13.3.15.
In Example 5.4.16, we learned that artist Tyrone’s annual income from paintings can be modeled by \(I(x)=-100x^2+1000x+20000\text{,}\) where \(x\) is the number of times he will raise the price per painting by $20.00. To maximize his income, how should Tyrone set his price per painting? Find the maximum by completing the square.
Explanation.
To find the maximum is essentially the same as finding the vertex, which we can find by completing the square. To complete the square for \(I(x)=-100x^2+1000x+20000\text{,}\) we start by factoring out the \(-100\) from the first two terms:
The vertex is the point \((5,22500)\text{.}\) This implies Tyrone should raise the price per painting \(\substitute{5}\) times, which is \(\substitute{5}\cdot20=100\) dollars. He would sell \(100-5(\substitute{5})=75\) paintings. This would make the price per painting \(200+100=300\) dollars, and his annual income from paintings would become $22,500 by this model.
Subsection13.3.4Graphing Quadratic Functions by Hand
Now that we know how to put a quadratic function in vertex form, let’s review how to graph a parabola by hand.
Example13.3.16.
Graph the function \(h\) defined by \(h(x)=2x^2+4x-6\) by determining its key features algebraically.
Explanation.
To start, we’ll note that this function opens upward because the leading coefficient, \(2\text{,}\) is positive.
Now we may complete the square to find the vertex. We factor the \(2\) out of the first two terms, and then add and subtract \(\left(\frac{2}{2}\right)^2=1^2=\highlight{1}\) on the right side.
The \(x\)-intercepts are \((1,0)\) and \((-3,0)\text{.}\)
Now we plot all of the key points and draw the parabola.
Example13.3.18.
Write a formula in vertex form for the function \(p\) defined by \(p(x)=-x^2-4x-1\text{,}\) and find the graph’s key features algebraically. Then sketch the graph.
Explanation.
In this function, the leading coefficient is negative so it will open downward. To complete the square we first factor \(-1\) out of the first two terms.
Now, we add and subtract the correct number on the right side of the function: \(\left(\frac{b}{2}\right)^2=\left(\frac{4}{2}\right)^2=2^2=\highlight{4}\text{.}\)
The vertex is \((-2,3)\) so the axis of symmetry is the line \(x=-2\text{.}\)
We find the \(y\)-intercept by looking at the value of \(c\text{,}\) which is \(-1\text{.}\) So, the \(y\)-intercept is \((0,-1)\) and we can find its symmetric point on the graph, \((-4,-1)\text{.}\)
The original expression, \(-x^2-4x-1\text{,}\) does not factor so to find the \(x\)-intercepts we need to set \(p(x)=0\) and complete the square or use the quadratic formula. Since we just went through the process of completing the square above, we can use that result to save several repetitive steps.
If a ball is throw straight up with a speed of \(59\ {\textstyle\frac{\rm\mathstrut ft}{\rm\mathstrut s}}\text{,}\) its height at time \(t\) (in seconds) is given by
If a ball is throw straight up with a speed of \(61\ {\textstyle\frac{\rm\mathstrut ft}{\rm\mathstrut s}}\text{,}\) its height at time \(t\) (in seconds) is given by
Let \(f(x) = x^{2}+bx+c\text{.}\) Let \(b\) and \(c\) be real numbers. Complete the square to find the vertex of \(f(x) = x^{2}+bx+c\text{.}\) Write \(f(x)\) in vertex form and then state the vertex.