Completing the Square
calculator.
Completing the square rewrites a quadratic so its vertex and roots can be read off.
- Vertex (lowest)
- (−3, −4)
- Axis of symmetry
- x = −3
- Discriminant
- 16
The parabola opens upward, so its lowest point is y = −4 at x = −3. It crosses the x-axis twice, an equal distance either side of x = −3.
Parabola and vertex
Drag the point to move the vertexA parabola that opens upward, with its vertex at (−3, −4) and the axis of symmetry at x = −3, shown by the dashed guide. It crosses the x-axis at x = −5 and x = −1.
Working
- 1Start from the standard formy = x² + 6x + 5
- 2Halve the x number and square the resultHalf is 3, and its square is 9
- 3Add that square and take it awayy = x² + 6x + 9 − 9 + 5
- 4The first three terms make a perfect squarey = (x + 3)² − 9 + 5
- 5Combine the plain numbersy = (x + 3)² − 4
- 6Read off the vertex and the axis(h, k) = (−3, −4), and the axis is x = −3
- 7Solve for y = 0(x − h)² = 4x =−5or x =−1
- 8Check: multiply the vertex form back out, and put the roots in−2ah = 6 and ah² + k = 5, the b and c you started withy at x = −5 is 0y at x = −1 is 0
The square you are completing
Each strip is half of the x term. The corner, 9, is the square of 3 and is what you add. The picture is not to scale.
How it's worked out
The aim is to turn into . OpenStax calls this the vertex form, because is the turning point of the parabola.
- If a is not 1, take it out of the x terms and leave c outside the bracket.
- Halve the x number inside the bracket, then square it.
- Add that square and take it away inside the bracket, which changes nothing.
- Write the first three terms as a perfect square.
- Bring the leftover out, multiplying it by a, and combine it with c.
The result gives a formula for each part. Here h is the x of the vertex and also the axis of symmetry, a vertical line that splits the parabola in half. The value k is the y of the vertex.
Setting y to 0 now takes a single square root, and that is the same route the book uses to solve an equation by this method. The sign under the root decides the kind of root.
Worked examples
Jo works through an odd middle number
Jo has . Half of 3 is , and its square is . Taking that from 1 leaves .
The vertex is at (−1.5, −1.25) as decimals. Setting y to 0 gives , or about −2.618034 and −0.381966. Keeping fractions until the last line is what makes this one come out clean.
Ravi handles a leading number of 2
For , Ravi takes 2 out of the x terms and gets . Half of 4 is 2, and its square is 4.
That 4 sits inside a bracket with 2 in front, so it comes out as 8. This step is easy to miss. Then gives −2, and the answer is , with roots .
Kim finds the top of a thrown ball
A ball thrown from a 40 foot building at 80 feet per second has a height of feet after t seconds. Kim wants the top of the path, so she needs the vertex.
The vertex is at 2.5 seconds and 140 feet. Since a is negative, the parabola opens downward and that point is the highest, which matches the book's answer. Only the later root makes sense here, as time starts at 0.
Reading your result
The sign of a tells you the direction. When a is above 0 the parabola opens upward and k is the smallest value of y. When a is below 0 it opens downward and k is the largest. A bigger a in size makes a narrower curve.
k and a together predict the roots. Opposite signs mean two real roots, since the curve crosses the axis. A k of 0 means one repeated root. Matching signs mean complex roots, as in , whose roots are . This is the same split the discriminant gives.
Exact forms need whole-number coefficients. Any decimal among a, b or c switches the answer to decimals, shown to the places you pick. To check a result, multiply the bracket out and compare with what you started from, as the last step of the working does.
| Standard form | Vertex form | Roots |
|---|---|---|
| x² − 2x − 3 | ||
| x² + 4x + 7 | ||
| x² − 5x + 6 | ||
| 2x² − 12x + 10 | ||
| −x² + 6x − 5 | ||
| 4x² + 4x − 3 |
Common mistakes
- Reading h with the wrong sign. The form has a minus built in, so has h = −3, not 3. The vertex sits where the bracket equals 0.
- Forgetting a when the square leaves the bracket. In Ravi's example, 4 comes out as 8. Bringing out 4 gives the wrong k.
- Adding the square without taking it away. On an expression you must do both, or you change its value. On an equation you may add it to both sides instead, which is how the book writes it.
- Halving b when a is not 1. The number to halve is the x number inside the bracket, which is b over a.