Completing the Square Calculator
Transform quadratic equations ax² + bx + c = 0 into vertex form a(x − h)² + k = 0, solve for exact roots, and visualize the geometric square completion model with verified arithmetic.
Must not be zero (a ≠ 0)
Linear coefficient
Constant term
Standard form: x² + 6x + 5 = 0
Obtained by isolating the squared binomial: (x + 3)² = 4 ⇒ x + 3 = ±2.
The corner piece (emerald) completes the square of side (x + b/2a), visually illustrating why the method is called completing the square.
Step-by-Step Derivation & Algebraic Solution
Completing the Square Formula
Completing the square converts a quadratic expression ax² + bx + c into vertex form a(x − h)² + k. It isolates the variable inside a single squared binomial by adding and subtracting the square completion constant (b / 2a)², enabling direct root extraction and identification of the parabola's vertex.
What Is Completing the Square?
Completing the square is an essential algebraic method used to manipulate quadratic polynomials. In standard form, a quadratic contains both a squared term (x²) and a linear term (x), which makes isolating x using basic linear operations impossible.
By adding a carefully chosen constant term to both sides, we re-engineer the expression into a perfect square trinomial:
Once the variable is consolidated inside a single squared binomial, taking the square root of both sides allows direct solving for x without relying on memorized formulas.
The concept dates back over 1,200 years to the Persian mathematician Muhammad ibn Musa al-Khwarizmi (c. 820 CE) in his foundational text Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala, which gave algebra its name. Al-Khwarizmi solved quadratics using geometric square and rectangle diagrams.
The Step-by-Step Algorithm (a = 1 vs. a ≠ 1)
- Isolate variable terms: Subtract c from both sides: x² + bx = −c.
- Calculate the completion term: Halve b and square the result: (b / 2)².
- Add to both sides: x² + bx + (b/2)² = −c + (b/2)².
- Factor as a square: (x + b/2)² = (b² − 4c) / 4.
- Solve for x: Take the square root of both sides: x + b/2 = ±√(...).
- Divide or factor out a: Divide the entire equation by a: x² + (b/a)x = −c/a.
- Calculate completion term: Halve the new linear coefficient (b/a) → b / (2a), and square: (b / 2a)² = b² / (4a²).
- Add to both sides: x² + (b/a)x + b²/(4a²) = −c/a + b²/(4a²).
- Factor LHS: (x + b / (2a))² = (b² − 4ac) / (4a²).
Step-by-Step Worked Examples
1. x² + 8x = −12.
2. Half of 8 is 4; square is 4² = 16.
3. x² + 8x + 16 = −12 + 16 = 4.
4. (x + 4)² = 4.
5. x + 4 = ±2 ⇒ x = −4 ± 2 ⇒ x = −2 or x = −6.
1. Divide by 2: x² + 6x − 7 = 0 ⇒ x² + 6x = 7.
2. Half of 6 is 3; 3² = 9.
3. x² + 6x + 9 = 7 + 9 = 16.
4. (x + 3)² = 16 ⇒ x + 3 = ±4 ⇒ x = −3 ± 4 ⇒ x = 1 or x = −7.
1. x² + 4x = −20.
2. Half of 4 is 2; 2² = 4.
3. x² + 4x + 4 = −20 + 4 = −16.
4. (x + 2)² = −16 ⇒ x + 2 = ±√(−16) = ±4i.
5. x = −2 ± 4i.
Deriving the Quadratic Formula via Completing the Square
The universally memorized Quadratic Formula is not an arbitrary axiom; it is the direct algebraic solution of the general quadratic equation ax² + bx + c = 0 solved via completing the square:
1. Start: ax² + bx + c = 0
2. Divide by a: x² + (b/a)x = −c/a
3. Add [b/(2a)]² = b²/(4a²) to both sides:
x² + (b/a)x + b²/(4a²) = b²/(4a²) − c/a = (b² − 4ac) / (4a²)
4. Factor LHS as a square:
[x + b / (2a)]² = (b² − 4ac) / (4a²)
5. Take square root of both sides:
x + b / (2a) = ± √(b² − 4ac) / (2a)
x = [−b ± √(b² − 4ac)] / (2a) ■
Converting Standard Form to Vertex Form
Standard form f(x) = ax² + bx + c is convenient for computing derivatives, but vertex form f(x) = a(x − h)² + k provides instant geometric insight:
| Feature | Standard Form (ax² + bx + c) | Vertex Form [a(x − h)² + k] |
|---|---|---|
| Vertex (Turning Point) | (−b/2a, c − b²/4a) | (h, k) read directly |
| Axis of Symmetry | x = −b / (2a) | x = h |
| Extremum Value | f(−b/2a) | y = k (Min if a > 0, Max if a < 0) |
The Geometric Area Model: Why It Is Called "Completing the Square"
Imagine an area represented by x² + bx. Geometrically, this consists of a square of side x (area = x²) and a rectangle of dimensions b by x.
To build a larger composite square:
- Cut the rectangle in half lengthwise into two strips of dimension (b/2) by x.
- Place one strip along the right side of the x² square and the other along the bottom.
- The resulting shape is an L-shaped figure missing exactly one small square in the bottom-right corner.
- The missing corner has dimensions (b/2) by (b/2), giving area (b/2)².
Adding this missing corner piece completes the larger square of side (x + b/2)!
Common Algebraic Traps & Mistakes
1. Forgetting to Factor Out Leading Coefficient a
If an equation has a = 2 (e.g. 2x² + 8x = 10), halving 8 to get 4 and squaring it to add 16 is incorrect. You must factor out 2 first: 2(x² + 4x). Half of 4 is 2, so you add 2² = 4 inside the parenthesis, which actually adds 2 × 4 = 8 to the equation!
2. Adding the Constant to Only One Side
Whatever value you add to complete the square on the left side of the equality must also be added to the right side to maintain balance.
3. Forgetting the Plus-or-Minus Sign
When taking the square root of both sides of (x + d)² = k, the right-hand side produces two branches: ±√k. Forgetting the negative root loses half of all solutions.
Applications in Calculus, Conics & Physics
In evaluating integrals like ∫ dx / (x² + 4x + 13), completing the square transforms the denominator to (x + 2)² + 9, enabling instant arctangent substitution: (1/3) arctan((x+2)/3).
General conic equations like x² + y² − 6x + 8y = 0 are converted to standard circle form (x − 3)² + (y + 4)² = 25 by completing the square in x and y simultaneously.
A ball launched with height h(t) = −16t² + 64t + 80 reaches maximum height at the vertex. Completing the square yields −16(t − 2)² + 144, showing maximum height is 144 ft at t = 2 s.
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.