Algebra • Quadratics & Polynomial Functions

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.

|
Last Updated: September 2026
|
Applied Algebra & Calculus Verified
Expression Form: ax² + bx + c = 0

Must not be zero (a ≠ 0)

Linear coefficient

Constant term

Completed Square (Vertex Form)
(x + 3)² − 4 = 0

Standard form: x² + 6x + 5 = 0

Quadratic Solutions (Roots)
x = −1  or  x = −5

Obtained by isolating the squared binomial: (x + 3)² = 4 ⇒ x + 3 = ±2.

Vertex (h, k) (−3, −4)
Axis of Symmetry x = −3
Added Constant 9
Geometric Area Model (x + b/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

Direct Answer & Overview
Verified Educational Guide

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.

Primary Mathematical Formula Universal Standard-to-Vertex Algebraic Identity
Standard Equation
ƒ(x)
Q.E.D.
ax2+bx+c=a(x+b2a)2+(c−b24a)ax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 + \left(c - \frac{b^2}{4a}\right)
Setting the vertex form equal to 0 and solving for x produces the universal Quadratic Formula: x = (−b ± √(b² − 4ac)) / (2a).
Exact Formula
Input Parameters
Required
1
Quadratic Coefficient (a): Non-zero leading coefficient (a ≠ 0)
2
Linear Coefficient (b): Multiplier of the first-degree variable x
3
Constant Term (c): Constant real number offset
Expected Outputs
Calculated
Vertex Form: a(x − h)² + k = 0
Vertex Coordinates (h, k): Minimum or maximum turning point (−b/2a, c − b²/4a)
Completion Constant Added: (b / 2a)²
Roots (x): Exact real or complex solutions
Worked Numerical Example
Instant Verification
Solve x² + 6x + 5 = 0 by completing the square.
→ 1. Subtract 5: x² + 6x = -5. 2. Take half of 6 (3) and square it (9). 3. Add 9 to both sides: x² + 6x + 9 = -5 + 9 = 4. 4. Factor LHS: (x + 3)² = 4. 5. Square root: x + 3 = ±2 => x = -3 ± 2 => x = -1 or x = -5.
(x + 3)² − 4 = 0; Roots: x = −1, x = −5

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:

x² + 2dx + d² = (x + d)²

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)

Case 1: Leading Coefficient a = 1 (x² + bx + c = 0)
  1. Isolate variable terms: Subtract c from both sides: x² + bx = −c.
  2. Calculate the completion term: Halve b and square the result: (b / 2)².
  3. Add to both sides: x² + bx + (b/2)² = −c + (b/2)².
  4. Factor as a square: (x + b/2)² = (b² − 4c) / 4.
  5. Solve for x: Take the square root of both sides: x + b/2 = ±√(...).
Case 2: Leading Coefficient a ≠ 1 (ax² + bx + c = 0)
  1. Divide or factor out a: Divide the entire equation by a: x² + (b/a)x = −c/a.
  2. Calculate completion term: Halve the new linear coefficient (b/a) → b / (2a), and square: (b / 2a)² = b² / (4a²).
  3. Add to both sides: x² + (b/a)x + b²/(4a²) = −c/a + b²/(4a²).
  4. Factor LHS: (x + b / (2a))² = (b² − 4ac) / (4a²).

Step-by-Step Worked Examples

Example 1: Even Linear Coefficient (x² + 8x + 12 = 0) x = −2, −6

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.

Example 2: Leading Coefficient a = 2 (2x² + 12x − 14 = 0) x = 1, −7

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.

Example 3: Complex Conjugate Roots (x² + 4x + 20 = 0) x = −2 ± 4i

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

Calculus Integration

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).

Conic Section Equations

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.

Projectile Trajectories

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.

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is completing the square in algebra?
Completing the square is an algebraic technique used to rewrite any quadratic expression ax² + bx + c into the vertex form a(x − h)² + k. It works by identifying the constant term (b / 2a)² that turns the x² and x terms into a perfect square binomial.
What is the formula for the number added to complete the square?
When a quadratic has a leading coefficient of 1 (x² + bx), the number added to complete the square is (b / 2)², which is half the linear coefficient squared. If the leading coefficient a ≠ 1, factor out a first, yielding a square completion term of (b / 2a)².
How do you derive the quadratic formula using completing the square?
Starting with ax² + bx + c = 0, divide by a: x² + (b/a)x = −c/a. Add (b/2a)² to both sides: (x + b/2a)² = (b² − 4ac) / (4a²). Taking the square root of both sides gives x + b/2a = ±√(b² − 4ac) / (2a), which simplifies to x = (−b ± √(b² − 4ac)) / (2a).
Can completing the square solve equations with complex roots?
Yes. When the right-hand side of the completed square equation is negative (e.g. (x + 2)² = −9), taking the square root produces imaginary numbers: x + 2 = ±3i ⇒ x = −2 ± 3i. Completing the square handles complex solutions seamlessly.
Why is this method called "completing the square"?
The name comes from ancient geometric algebra. Geometrically, the terms x² + bx represent a large square of area x² and two rectangles of area (b/2)x. To form a complete larger square of side (x + b/2), a small corner square of area (b/2)² must be added—literally "completing the square".
What is the advantage of vertex form over standard form?
Vertex form a(x − h)² + k immediately reveals the vertex (h, k) of the parabola, its minimum or maximum extreme value, and its axis of symmetry x = h without requiring calculus or formula memorization.