Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

How to Complete the Square

Add the one number that turns x2+bxx^2 + bx into a perfect square: half of bb, squared. Then the equation reads (x+b2)2=k(x + \frac{b}{2})^2 = k, and a square root finishes it. The same move rewrites a parabola in vertex form.

Recognize the task

A quadratic that you are told to solve by completing the square, one with a=1a = 1 and an even bb (x2+6x+5=0x^2 + 6x + 5 = 0), a request for the vertex form a(x−h)2+ka(x - h)^2 + k, or the equation of a circle to tidy up. Test: you need a perfect square, not just the roots.
The lesson section is solving by completing the square; the target shape is a perfect square trinomial.

Steps

StepOn x2+6x+5=0x^2 + 6x + 5 = 0
1Make the leading coefficient 1. Divide every term by aa if a≠1a \neq 1.Multiplication property of equality ↗a=1a = 1 already
2Move the constant to the other side. Leave only x2+bxx^2 + bx on the left.Addition property of equality ↗x2+6x=−5x^2 + 6x = -5
3Add (b/2)² to both sides. Half of bb, squared (completing the square). Both sides, or the equation changes.x2+6x+9=−5+9x^2 + 6x + 9 = -5 + 9
4Write the left side as a square. x2+bx+(b2)2=(x+b2)2x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2.(x+3)2=4(x + 3)^2 = 4
5Take square roots of both sides, with ±. Square root property; a negative right side means no real roots.x+3=±2  ⇒  x=−1x + 3 = \pm 2 \;\Rightarrow\; x = -1 or x=−5x = -5

Worked examples

Example 1 · odd b

fractions
x2+3x−1=0  ⇒  x2+3x+94=1+94x^2 + 3x - 1 = 0 \;\Rightarrow\; x^2 + 3x + \tfrac{9}{4} = 1 + \tfrac{9}{4}
(32)2=94\left(\frac{3}{2}\right)^2 = \frac{9}{4}
(x+32)2=134  ⇒  x=−3±132\left(x + \tfrac{3}{2}\right)^2 = \tfrac{13}{4} \;\Rightarrow\; x = \frac{-3 \pm \sqrt{13}}{2}

Example 2 · leading coefficient 2

divide first
2x2−8x+3=0  ⇒  x2−4x=−322x^2 - 8x + 3 = 0 \;\Rightarrow\; x^2 - 4x = -\tfrac{3}{2}
divide by 22, move the constant
(x−2)2=4−32=52(x - 2)^2 = 4 - \tfrac{3}{2} = \tfrac{5}{2}
add 44
x=2±52=2±102x = 2 \pm \sqrt{\tfrac{5}{2}} = 2 \pm \tfrac{\sqrt{10}}{2}

Example 3 · vertex form

no equation to solve
y=x2+4x+1=(x2+4x+4)−4+1y = x^2 + 4x + 1 = (x^2 + 4x + 4) - 4 + 1
add and subtract 44 on the same side
y=(x+2)2−3y = (x + 2)^2 - 3, vertex (−2,−3)(-2, -3)

See it happen

Enter coefficients
x2+x+= 0
Try a preset
Geometric Picture
x²6x5
Starting equation. Three terms: an x² piece, a 6x piece, and the constant 5. We will arrange them into a geometric square to read off the vertex form.
Step-by-step solution
1Starting equation
Three terms: an x² piece, a 6x piece, and the constant 5. We will arrange them into a geometric square to read off the vertex form.
x² + 6x + 5 = 0
2Place the x² square
Start with a square of side x. Its area is x².
x² + 6x + 5
3Split the 6x rectangle
Half of 6 is 3. Split the 6x rectangle into two equal strips of size x × 3. Place one to the right of the square and one below.
x² + 2·(3·x) + 5
4Move the constant 5 into the corner
The bottom-right corner has dimensions 3 × 3 = 9. The constant 5 sits inside this corner, but only partially fills it.
(x² + 2·(3·x)) + 5
5Gap of 4
The corner needs area 9 to complete the square. The constant 5 fills part of it; the gap is 9 − 5 = 4. So the original expression is 4 less than the completed square.
Inside parentheses: (x + 3)² − 4
6Vertex form
Combine the pieces: x² + 6x + 5 = (x + 3)² − 4.
(x + 3)² − 4 = 0
7Solve for x
Move the constant to the right side and take the square root.
x = -3 ± 2 ≈ -1 or -5
Vertex form
y = (x + 3)² − 4
Vertex: (-3, -4)
x2+6xx^2 + 6x is an xx-by-xx square plus two xx-by-33 strips laid along two sides. One 33-by-33 corner is missing; adding 99 fills it, and the whole shape becomes a square of side x+3x + 3.

Common mistakes

Adding to one side only

✗ x2+6x+9=−5x^2 + 6x + 9 = -5
✓ add 99 to both sides: =4= 4

Adding b² instead of (b/2)²

✗ x2+6x+36x^2 + 6x + 36
✓ (62)2=9\left(\frac{6}{2}\right)^2 = 9

Completing before dividing by a

✗ 2x2−8x2x^2 - 8x: add 1616
✓ divide by 22 first: x2−4xx^2 - 4x, add 44

Forgetting ±

✗ (x+3)2=4⇒x=−1(x + 3)^2 = 4 \Rightarrow x = -1
✓ x+3=±2x + 3 = \pm 2: also x=−5x = -5