How Completing the Square Works

Visual and algebraic demonstration of why completing the square works, plus deriving the quadratic formula.

Interactive Demonstration

Enter a simple quadratic x² + bx to see the geometric proof visually.

Derive the Quadratic Formula

Enter general coefficients to see the quadratic formula derived via completing the square.

Algebraic Explanation

Key Identity
x² + 6x + 9 = (x + 3)²
Perfect Square Trinomial
Expression x² + 6x
Half of b 3
(b/2)² 9
Completed Square (x + 3)² - 9

Step-by-Step Explanation

x² + bx + (b/2)² = (x + b/2)²

Quadratic Formula Derivation

1Click "Derive Formula" to see the full derivation.

Why Does Completing the Square Work?

Completing the square works because of a fundamental algebraic identity: (x + n)² = x² + 2nx + n². This means any expression of the form x² + 2nx can be turned into a perfect square by adding n². The method exploits this identity in reverse -- given x² + bx, we find n = b/2 and add (b/2)² to create a perfect square trinomial.

The Geometric Proof

The name "completing the square" comes from a geometric interpretation. Consider the expression x² + 6x. We can visualize this as:

  • A square with side length x (area = x²)
  • A rectangle with dimensions x by 6 (area = 6x)

Now split the rectangle into two equal pieces, each with dimensions x by 3. Arrange these two rectangles along two sides of the x-by-x square. You now have an L-shaped figure. To "complete" it into a full square, you need a small 3-by-3 square in the corner. This small square has area 9 = (6/2)² = (b/2)².

The total area of the completed square is (x + 3)² = x² + 6x + 9. Since we added 9, we must subtract 9 to keep the expression equal: x² + 6x = (x + 3)² - 9.

Deriving the Quadratic Formula

Step 1: Start

Begin with the general equation ax² + bx + c = 0.

ax² + bx + c = 0

Step 2: Divide by a

Divide every term by a (assuming a is not zero).

x² + (b/a)x + c/a = 0

Step 3: Isolate

Move the constant to the right side.

x² + (b/a)x = -c/a

Step 4: Complete

Add (b/(2a))² to both sides.

x² + (b/a)x + b²/(4a²) = -c/a + b²/(4a²)

Step 5: Factor

The left side is a perfect square.

(x + b/(2a))² = (b² - 4ac)/(4a²)

Step 6: Solve

Take the square root of both sides and isolate x.

x = (-b +/- sqrt(b²-4ac)) / (2a)

Historical Context

Completing the square has ancient origins. Babylonian mathematicians around 1800 BCE used geometric methods equivalent to completing the square to solve quadratic equations. The Persian mathematician al-Khwarizmi (c. 780-850 CE) gave the first systematic account of this technique in his book "Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala" (The Compendious Book on Calculation by Completion and Balancing), from which we get the word "algebra."

Why This Identity Works Algebraically

The core identity can be verified by expanding (x + n)²:

  1. (x + n)² = (x + n)(x + n)
  2. = x(x + n) + n(x + n)
  3. = x² + xn + nx + n²
  4. = x² + 2nx + n²

So if we have x² + bx, we need 2n = b, which means n = b/2. Adding n² = (b/2)² creates the perfect square (x + b/2)².

Applications Beyond Quadratics

  • Conic sections: Converting general second-degree equations to standard form for circles, ellipses, and hyperbolas.
  • Calculus: Evaluating integrals involving quadratic expressions in the denominator.
  • Statistics: Deriving properties of the normal distribution.
  • Physics: Analyzing projectile motion and energy equations.
  • Optimization: Finding maximum and minimum values without calculus.