The Completing the Square Formula
The general completing the square formula for ax² + bx + c, and a line-by-line derivation of the quadratic formula from it, with each step explained.
The Completing the Square Formula
You need the general formula for completing the square and the exact derivation that turns it into the quadratic formula. Most algebra pages give you the vertex coordinates h = −b/2a and k = c − b²/4a, then stop. Here you get the full line-by-line derivation of the quadratic formula from completing the square, with the common failure points named and fixed.
The completing the square formula rewrites any quadratic f(x) = ax² + bx + c into vertex form f(x) = a(x − h)² + k.This form reveals the parabola's vertex, its axis of symmetry x = h, and it is the algebraic backbone of the quadratic formula, certain integrals, and circle equations.
Derivation for ax² + bx + c
Start with the general quadratic expression f(x) = ax² + bx + c, where a ≠ 0. The goal is to force a perfect square trinomial inside the parentheses. This derivation follows the standard algebra text notation from OpenStax College Algebra 2e, Section 5.1, pages 440-441.
Step 1: Factor a From the First Two Terms
Write f(x) = a[x² + (b/a)x] + c. Factoring a is critical when a ≠ 1. The most common failure here is to forget this step and try to complete the square directly on ax² + bx, which produces a wrong vertex.
Step 2: Add and Subtract (b/(2a))² Inside the Brackets
Inside the bracket, add and subtract the square of half the coefficient of x: (b/(2a))². The expression becomes a[x² + (b/a)x + (b/(2a))² − (b/(2a))²] + c. Adding and subtracting the same term keeps the expression balanced. This is the step where students who only ever solved equations mistakenly add (b/(2a))² to just one side. Because you are rewriting an expression, not solving an equation, you must add and subtract inside the same parentheses.
Step 3: Rewrite the Perfect Square Trinomial
The first three terms inside the bracket form a perfect square: x² + (b/a)x + (b/(2a))² = (x + b/(2a))². So now f(x) = a[(x + b/(2a))² − (b/(2a))²] + c.
Step 4: Distribute a and Simplify the Constant
Distribute a to get a(x + b/(2a))² − a(b/(2a))² + c. The term a(b/(2a))² simplifies to b²/(4a). So f(x) = a(x + b/(2a))² − b²/(4a) + c.
Step 5: Combine the Constants
Rewrite as f(x) = a(x + b/(2a))² + (c − b²/(4a)). Now replace + b/(2a) with −(−b/(2a)). Because the vertex form is a(x − h)², you get h = −b/(2a) and k = c − b²/(4a). The axis of symmetry is the vertical line x = h.
Deriving the Quadratic Formula, Line by Line
The quadratic formula x = [−b ± √(b² − 4ac)] / (2a) is derived directly from completing the square on the general equation ax² + bx + c = 0. This derivation is the single best proof of why the formula works, yet it is rarely shown to students. It takes eight lines. The source is OpenStax College Algebra 2e, Section 2.5, pages 218-219.
Begin with the equation ax² + bx + c = 0, a ≠ 0. Divide every term by a: x² + (b/a)x + c/a = 0. Isolate the x terms by subtracting c/a: x² + (b/a)x = −c/a. Now add (b/(2a))² to both sides. This is the key move: because you are solving an equation, you add the same quantity to both sides, not add and subtract inside one side. The equation becomes x² + (b/a)x + (b/(2a))² = −c/a + (b/(2a))².
The left side factors as (x + b/(2a))². The right side becomes −c/a + b²/(4a²). Write both terms over a common denominator 4a²: −c/a = −4ac/(4a²), so the right side is (b² − 4ac)/(4a²). Now take the square root of both sides. Remember the ±: x + b/(2a) = ± √(b² − 4ac) / (2a). Subtract b/(2a) from both sides to isolate x: x = −b/(2a) ± √(b² − 4ac) / (2a). Combine over the common denominator 2a to get x = [−b ± √(b² − 4ac)] / (2a).
The expression b² − 4ac under the radical is the discriminant. It determines the number and type of roots. If b² − 4ac > 0, there are two distinct real roots. If b² − 4ac = 0, there is exactly one real root (a repeated root). If b² − 4ac < 0, there are two complex conjugate roots.
Where the Discriminant Appears
The discriminant b² − 4ac emerges naturally at line 6 of the derivation. It is the term that must be non-negative for the square root to be real. This is not an extra concept bolted onto the quadratic formula; completing the square forces it into view.
Use the discriminant to check your work before plugging into the quadratic formula. Compute b² − 4ac first. If it is negative, stop: the quadratic formula will give complex numbers, and any real-world problem expecting a real answer is set up wrong. If it is zero, remember that the ± vanishes and the formula gives a single value.
The failure case most students encounter: they compute the discriminant correctly but then forget the denominator 2a when taking the square root, writing x = [−b ± √(b² − 4ac)] / a.
Using the Formula to Check Your Work
The completing the square formula and the quadratic formula are two sides of the same coin. After you complete the square to find the vertex (h, k), you can verify the vertex by plugging h into the original quadratic and seeing that f(h) = k. Alternatively, use the relationship h = −b/(2a) as a quick sanity check. If you solved a quadratic by completing the square and got a root, the quadratic formula should produce the same number.
Example: For f(x) = 2x² + 8x + 6, completing the square gives h = −2 and k = −2. Check that f(−2) = 2(4) + 8(−2) + 6 = 8 − 16 + 6 = −2, which matches k. Then solve 2x² + 8x + 6 = 0 by the quadratic formula: a = 2, b = 8, c = 6 gives x = [−8 ± √(64 − 48)] / 4 = [−8 ± √16] / 4 = [−8 ± 4] / 4. The roots are x = −1 and x = −3. Completing the square on the same equation should yield the same roots when you solve (x + 2)² = 1.
When the two methods disagree, the most common mistake is an arithmetic error in the completing the square process, especially the step where you factor a and add a·(b/(2a))² to the constant side. Use the quadratic formula as the tiebreaker because it has fewer steps and a single canonical form.
Common Questions
What is the completing the square formula?
The completing the square formula rewrites f(x) = ax² + bx + c as f(x) = a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a). This is the vertex form of a quadratic function.
How do you derive the quadratic formula by completing the square?
Start with ax² + bx + c = 0. Divide by a, isolate the x terms, add (b/(2a))² to both sides, factor the left side as (x + b/(2a))², simplify the right side to (b² − 4ac)/(4a²), take the square root, and solve for x.
What is h = −b/2a used for?
h = −b/(2a) gives the x-coordinate of the parabola's vertex and the equation of its axis of symmetry, x = h. It also appears in the derivation of the quadratic formula as the shift that centers the perfect square.
What is the most common error when completing the square?
Forgetting to factor out a before adding and subtracting inside the parentheses when a ≠ 1. This mistake changes the vertex's y-coordinate by a factor of a. Always factor a from the first two terms first.
When should I use completing the square instead of the quadratic formula?
Use completing the square when you need the vertex of a parabola, when rewriting a quadratic into vertex form, or when the quadratic appears inside an integral that requires a trigonometric substitution. For solving equations, the quadratic formula is faster.