Completing the Square to Solve Equations

April 12, 2026

Problem

Solve x²+6x+2=0 by completing the square. Animate building the perfect square geometrically.

Explanation

What is "completing the square"?

Completing the square rewrites x2+bxx^2 + bx as a perfect square (x+b/2)2(x + b/2)^2 minus a correction term. This lets you solve quadratics by taking a square root instead of using the formula.

Step-by-step solution: Solve x2+6x+2=0x^2 + 6x + 2 = 0

Step 1 — Move the constant to the right side:

x2+6x=2x^2 + 6x = -2

Step 2 — Take half the coefficient of xx, then square it. Half of 6 is 3; 32=93^2 = 9. Add 9 to BOTH sides:

x2+6x+9=2+9x^2 + 6x + 9 = -2 + 9

Step 3 — The left side is now a perfect square:

(x+3)2=7(x + 3)^2 = 7

Step 4 — Take the square root of both sides (don't forget ±):

x+3=±7x + 3 = \pm\sqrt{7}

Step 5 — Solve for xx:

x=3±7x = -3 \pm \sqrt{7}

x1=3+70.354x_1 = -3 + \sqrt{7} \approx -0.354 x2=375.646x_2 = -3 - \sqrt{7} \approx -5.646

Step 6 — Check (using x1x_1): (0.354)2+6(0.354)+2=0.1252.124+20(-0.354)^2 + 6(-0.354) + 2 = 0.125 - 2.124 + 2 \approx 0

The geometric picture

"Completing the square" literally means building a square. You have an x×xx \times x square and a 6×x6 \times x rectangle. Cut the rectangle in half (3×x3 \times x each) and attach to two sides of the square. You get an (x+3)×(x+3)(x+3) \times (x+3) square minus the missing 3×33 \times 3 corner — that's the 9 you add.

Why learn this?

Completing the square is how the quadratic formula is derived, and it's essential for putting conics in standard form, vertex form of parabolas, and integration techniques in calculus.

Try it in the visualization

Adjust bb and cc. Watch the geometric square being built step by step. The parabola shifts to show the vertex form, and the roots appear on the x-axis.

Interactive Visualization

Parameters

6.00
2.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Completing the Square to Solve Equations | MathSpin