Skip to main content

Completing the Square Calculator

Mathematics - Completing the Square

Completing the Square Calculator

Rewrite any quadratic expression in vertex form a(x - h)² + k using the completing the square method. Get step-by-step working for solving equations and finding the vertex.

Complete the Square

Enter a quadratic expression in the form ax² + bx + c. Use ^ for exponents (e.g., x^2 + 6x + 5). Click Calculate to see the vertex form and solution steps.

Vertex form and steps will appear here.
Note: The calculator accepts expressions with or without "= 0". For solving equations, enter the quadratic expression and the result will show the roots as well.

Completing the Square – Complete Explanation

Completing the square is a powerful algebraic technique that transforms any quadratic expression ax² + bx + c into vertex form a(x - h)² + k. This method reveals the vertex of the parabola, solves quadratic equations, and forms the basis for deriving the quadratic formula.

Completing the Square Formula

For ax² + bx + c:
Factor out a: a(x² + (b/a)x) + c
Add and subtract (b/(2a))²: a[x² + (b/a)x + (b/(2a))² - (b/(2a))²] + c
Rewrite: a(x + b/(2a))² + (c - b²/(4a))

Vertex: (-b/(2a), c - b²/(4a))

1. Why Complete the Square?

This technique is essential for:

  • Finding the vertex of a parabola without graphing
  • Solving quadratic equations when factoring is difficult
  • Deriving the quadratic formula
  • Integrating certain rational functions in calculus
  • Identifying conic sections (circles, ellipses, hyperbolas)
  • Finding maximum/minimum values of quadratic functions

2. Step-by-Step Examples

Example 1: Simple Case (a = 1)

Complete the square for: x² + 6x + 5

Step 1: Coefficient of x is 6. Half of 6 is 3.
Step 2: Square it: 3² = 9.
Step 3: Add and subtract 9:
        x² + 6x + 9 - 9 + 5
Step 4: Group the perfect square:
        (x² + 6x + 9) - 9 + 5
        = (x + 3)² - 4

Vertex Form: (x + 3)² - 4
Vertex: (-3, -4)

Solve x² + 6x + 5 = 0:
(x + 3)² - 4 = 0
(x + 3)² = 4
x + 3 = ±2
x = -3 ± 2 → x = -1 or x = -5

Example 2: Leading Coefficient a ≠ 1

Complete the square for: 2x² - 8x + 3

Step 1: Factor out a = 2 from x-terms:
        2(x² - 4x) + 3

Step 2: Half of -4 is -2. Square: (-2)² = 4.
Step 3: Add and subtract 4 inside:
        2(x² - 4x + 4 - 4) + 3
Step 4: Rewrite perfect square:
        2((x - 2)² - 4) + 3
Step 5: Distribute:
        2(x - 2)² - 8 + 3
        = 2(x - 2)² - 5

Vertex Form: 2(x - 2)² - 5
Vertex: (2, -5)

Solve 2x² - 8x + 3 = 0:
2(x - 2)² - 5 = 0
2(x - 2)² = 5
(x - 2)² = 2.5
x - 2 = ±√2.5
x = 2 ± √2.5 ≈ 2 ± 1.581
x ≈ 3.581 or x ≈ 0.419

3. More Examples

Example 1: x² - 10x + 21

Half of -10 = -5, (-5)² = 25

(x² - 10x + 25) - 25 + 21 = (x - 5)² - 4

Vertex: (5, -4)

Example 2: 3x² + 12x + 7

Factor: 3(x² + 4x) + 7

Half of 4 = 2, 2² = 4

3(x² + 4x + 4 - 4) + 7 = 3(x + 2)² - 12 + 7 = 3(x + 2)² - 5

Vertex: (-2, -5)

Example 3: -x² + 6x - 2

Factor out -1: -(x² - 6x) - 2

Half of -6 = -3, (-3)² = 9

-(x² - 6x + 9 - 9) - 2 = -((x - 3)² - 9) - 2 = -(x - 3)² + 9 - 2 = -(x - 3)² + 7

Vertex: (3, 7) — parabola opens downward, vertex is maximum

4. Geometric Interpretation

Completing the square has a geometric meaning: you're literally "completing" a square. For x² + bx, think of a square of side x and a rectangle of dimensions b by x. By adding (b/2)², you form a perfect square of side (x + b/2).

Visual Understanding

The area x² + bx becomes a complete square when you add the missing corner piece (b/2)², giving total area (x + b/2)².

5. Solving Quadratic Equations

Once in vertex form a(x - h)² + k = 0, solving is straightforward:

a(x - h)² = -k
(x - h)² = -k/a
x - h = ±√(-k/a)
x = h ± √(-k/a)

This method always works, even when factoring fails or the roots are irrational.

6. The Discriminant Connection

In vertex form a(x - h)² + k, the term -k/a determines the nature of the roots:

  • -k/a > 0: Two distinct real roots
  • -k/a = 0: One repeated real root (vertex on x-axis)
  • -k/a < 0: No real roots (two complex conjugate roots)

This connects directly to the discriminant b² - 4ac from the quadratic formula.

7. Common Mistakes to Avoid

  • Forgetting to factor out 'a' first: When a ≠ 1, you must factor it from the x² and x terms before completing the square.
  • Not balancing the equation: What you add inside the parentheses must be subtracted (or accounted for) outside.
  • Sign errors with the constant term: Remember to multiply the subtracted term by 'a' when moving it outside.
  • Incorrect vertex coordinates: Vertex is (-b/(2a), f(-b/(2a))). The x-coordinate sign flips from (x - h).
  • Arithmetic with fractions: When b is odd, b/2 is a fraction — work carefully with fractions or decimals.

8. Deriving the Quadratic Formula

Completing the square on the general form ax² + bx + c = 0 yields the quadratic formula:

ax² + bx + c = 0
x² + (b/a)x = -c/a
x² + (b/a)x + (b/(2a))² = -c/a + (b/(2a))²
(x + b/(2a))² = -c/a + b²/(4a²)
(x + b/(2a))² = (b² - 4ac)/(4a²)
x + b/(2a) = ±√(b² - 4ac)/(2a)
x = [-b ± √(b² - 4ac)] / (2a)

9. Applications in Calculus

  • Integration: Completing the square transforms integrands like 1/(ax² + bx + c) into forms that yield arctangent or logarithmic antiderivatives.
  • Optimization: Vertex form instantly reveals the maximum or minimum value of a quadratic function.
  • Differential equations: Solving characteristic equations with complex roots.

10. Real-World Applications

  • Physics: Projectile motion — the vertex gives maximum height and the time to reach it.
  • Economics: Maximizing profit or minimizing cost functions that are quadratic.
  • Engineering: Optimization problems in design and control systems.
  • Architecture: Parabolic arches and cable structures.
  • Computer graphics: Calculating parabolic trajectories and collision detection.

11. Practice Problems with Solutions

Problem 1: Complete the square: x² + 8x + 12

Solution: (x + 4)² - 4 | Vertex: (-4, -4)

Problem 2: Complete the square: 2x² - 12x + 10

Solution: 2(x - 3)² - 8 | Vertex: (3, -8)

Problem 3: Solve by completing the square: x² - 4x - 5 = 0

Solution: (x - 2)² - 9 = 0 → x = 5 or x = -1

Problem 4: Complete the square: 4x² + 4x + 1

Solution: 4(x + 0.5)² | Vertex: (-0.5, 0) — perfect square trinomial

12. Tips for Mastering Completing the Square

  • Always write the quadratic in standard form ax² + bx + c first.
  • If a ≠ 1, factor it out before finding (b/2)².
  • Remember the pattern: (x + p)² = x² + 2px + p², so p = b/(2a).
  • Check your work by expanding the vertex form — you should get the original expression.
  • Practice with both integer and fractional coefficients.
  • Use this method to verify the quadratic formula instead of memorizing it blindly.

13. Final Thoughts

Completing the square is one of the most elegant techniques in algebra. It transforms a seemingly complex quadratic expression into a form that reveals its deepest properties — the vertex, the axis of symmetry, and the roots. It's the bridge between algebra and geometry, showing how symbolic manipulation can unlock visual understanding.

While this calculator performs the steps automatically, practicing the method by hand develops algebraic fluency that pays dividends throughout mathematics. Master completing the square, and you'll find quadratics no longer intimidating but rather beautiful and predictable.