Completing the Square

Completing the square rewrites a quadratic as a perfect square plus a constant, making it easier to solve and find the parabola's vertex.

x2+bx=(x+b2)2b24x^2 + bx = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4}

Solve a problem with Completing the Square

Type the problem. The solver will use Completing the Square where Completing the Square is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Completing the Square takes
bb
xx
Completing the Square
SymbolMeaning
bbThe coefficient of the linear term xx in the quadratic; if xx is missing the linear term, b=0b = 0.
xxThe variable you're solving for; if you use a different variable (like tt or rr), substitute it for xx in the formula.

When to use it

Reach for completing the square when you need to solve a quadratic that doesn't factor easily or when you want to find a parabola's vertex form.

Level

Usually taught in: Algebra I · Appears on: SAT

Worked examples

1. Solve a quadratic with small integers

Problem

Solve x2+6x7=0x^2 + 6x - 7 = 0
  1. x2+6x=7x^2 + 6x = 7

    Rearrange by adding 7 to both sides of the original equation.

  2. x2+6x+9=7+9x^2 + 6x + 9 = 7 + 9

    Complete the square: take half the coefficient of xx (which is 62=3\frac{6}{2} = 3), square it (32=93^2 = 9), and add to both sides.

  3. (x+3)2=16(x + 3)^2 = 16

    Recognize that x2+6x+9x^2 + 6x + 9 is the perfect square trinomial (x+3)2(x + 3)^2.

  4. x+3=±4x + 3 = \pm 4

    Take the square root of both sides; use ±\pm because both 42=164^2 = 16 and (4)2=16(-4)^2 = 16.

  5. x=1orx=7x = 1 \quad \text{or} \quad x = -7

    Subtract 3 from each side: x=3+4=1x = -3 + 4 = 1 and x=34=7x = -3 - 4 = -7.

Answer: x=1 or x=7x = 1 \text{ or } x = -7

This problem is set up perfectly for completing the square: the leading coefficient is 1 and the integers are small. We can see how each step transforms the expression into the standard form.

2. Solve a quadratic with a leading coefficient and irrational roots

Problem

Solve 2x28x+3=02x^2 - 8x + 3 = 0
  1. 2x28x=32x^2 - 8x = -3

    Move the constant to the right by subtracting 3 from both sides.

  2. x24x=32x^2 - 4x = -\frac{3}{2}

    Divide everything by the leading coefficient 2 to make the x2x^2 coefficient equal 1.

  3. x24x+4=32+4x^2 - 4x + 4 = -\frac{3}{2} + 4

    Complete the square: half of 4-4 is 2-2; square it to get (2)2=4(-2)^2 = 4. Add 4 to both sides.

  4. x24x+4=52x^2 - 4x + 4 = \frac{5}{2}

    Simplify the right side: 32+4=32+82=52-\frac{3}{2} + 4 = -\frac{3}{2} + \frac{8}{2} = \frac{5}{2}.

  5. (x2)2=52(x - 2)^2 = \frac{5}{2}

    Recognize that x24x+4=(x2)2x^2 - 4x + 4 = (x - 2)^2.

  6. x2=±52x - 2 = \pm\sqrt{\frac{5}{2}}

    Take the square root of both sides.

  7. x=2±102x = 2 \pm \frac{\sqrt{10}}{2}

    Solve for xx: simplify 52=52=102\sqrt{\frac{5}{2}} = \frac{\sqrt{5}}{\sqrt{2}} = \frac{\sqrt{10}}{2} by rationalizing.

Answer: x=2+102 or x=2102x = 2 + \frac{\sqrt{10}}{2} \text{ or } x = 2 - \frac{\sqrt{10}}{2}

Here we have a leading coefficient that isn't 1 and irrational solutions, which makes completing the square essential—the quadratic formula might be quicker, but this method shows the structure.

3. Find optimal dimensions of a rectangular garden

Problem

A rectangular garden plot has a perimeter of 30 meters. If you want to maximize the area, what dimensions should the plot have?
  1. A=w(15w)A = w(15 - w)

    Set up the area function: if width is ww and perimeter is 30, then length is 15w15 - w.

  2. A=15ww2A = 15w - w^2

    Expand the product using the distributive property.

  3. A=(w215w)A = -(w^2 - 15w)

    Factor out 1-1 to prepare for completing the square.

  4. A=(w215w+2254)+2254A = -\left(w^2 - 15w + \frac{225}{4}\right) + \frac{225}{4}

    Complete the square inside the parentheses: half of 15-15 is 152-\frac{15}{2}, and (152)2=2254\left(-\frac{15}{2}\right)^2 = \frac{225}{4}.

  5. A=(w152)2+2254A = -\left(w - \frac{15}{2}\right)^2 + \frac{225}{4}

    Write the perfect square trinomial in factored form.

  6. w=152=7.5w = \frac{15}{2} = 7.5

    The maximum area occurs when the squared term equals zero, which happens at w=7.5w = 7.5 metres.

  7. length=157.5=7.5\text{length} = 15 - 7.5 = 7.5

    The length is also 7.5 metres, so the garden is a square.

Answer: The garden should be 7.5 m×7.5 m\text{The garden should be } 7.5 \text{ m} \times 7.5 \text{ m}

Completing the square transforms the area function into vertex form, revealing immediately that the maximum occurs at w=7.5w = 7.5. This shows us both the optimal dimensions and that the area function is a downward-opening parabola. Without completing the square, we'd need calculus to find this maximum.

Common mistakes

Where Completing the Square usually goes wrong
Answer came out wrong
I added (b2)2(\frac{b}{2})^2 to only one side: x2+6x+9=5x^2 + 6x + 9 = 5 instead of x2+6x+9=5+9x^2 + 6x + 9 = 5 + 9.
Add the constant to BOTH sides: x2+6x=5x^2 + 6x = 5 becomes x2+6x+9=5+9=14x^2 + 6x + 9 = 5 + 9 = 14.
I found (x+3)2=16(x + 3)^2 = 16, so I wrote x+3=4x + 3 = 4 and got x=1x = 1 only.
Write x+3=±4x + 3 = \pm 4, giving x=1x = 1 or x=7x = -7.
I had 2x2+8x=52x^2 + 8x = 5 and added 424^2 to get (2x+4)2=5+16(2x + 4)^2 = 5 + 16.
Divide by 2 first: x2+4x=52x^2 + 4x = \frac{5}{2}, then add (42)2=4\left(\frac{4}{2}\right)^2 = 4 to both sides.
The mistakeWhy it is wrongThe fix
I added (b2)2(\frac{b}{2})^2 to only one side: x2+6x+9=5x^2 + 6x + 9 = 5 instead of x2+6x+9=5+9x^2 + 6x + 9 = 5 + 9.Equations must stay balanced; whatever you add to one side must be added to the other.Add the constant to BOTH sides: x2+6x=5x^2 + 6x = 5 becomes x2+6x+9=5+9=14x^2 + 6x + 9 = 5 + 9 = 14.
I found (x+3)2=16(x + 3)^2 = 16, so I wrote x+3=4x + 3 = 4 and got x=1x = 1 only.Squaring gives two solutions; you must use ±\pm when taking the square root.Write x+3=±4x + 3 = \pm 4, giving x=1x = 1 or x=7x = -7.
I had 2x2+8x=52x^2 + 8x = 5 and added 424^2 to get (2x+4)2=5+16(2x + 4)^2 = 5 + 16.You must divide by the leading coefficient FIRST so the coefficient of x2x^2 is 1, or you won't have a perfect square trinomial.Divide by 2 first: x2+4x=52x^2 + 4x = \frac{5}{2}, then add (42)2=4\left(\frac{4}{2}\right)^2 = 4 to both sides.

Tips and when to use something else

  • Always move the constant to the right side before completing the square.
  • If the leading coefficient isn't 1, divide the entire equation by it before adding (b2)2(\frac{b}{2})^2.
  • Remember ±\pm when you take the square root; quadratics usually have two solutions.
  • If the solutions are messy fractions or surds, try the Quadratic Formula instead—it's faster for complicated cases.

Frequently asked questions

What does 'completing the square' actually mean?
It means rewriting x2+bxx^2 + bx as (x+b2)2b24(x + \frac{b}{2})^2 - \frac{b^2}{4}, turning the quadratic into a perfect square trinomial (x+b2)2(x + \frac{b}{2})^2 plus a constant. The phrase comes from the geometric idea of filling in a missing square to make a larger square.
Why do I need to use ±\pm when taking the square root?
Because both 32=93^2 = 9 and (3)2=9(-3)^2 = 9. When you solve (x+2)2=9(x + 2)^2 = 9, both x+2=3x + 2 = 3 and x+2=3x + 2 = -3 are valid, giving you two different answers for xx.
Can I use completing the square if the leading coefficient isn't 1?
Yes, but you must divide the entire equation by the leading coefficient first so that x2x^2 has coefficient 1. Otherwise the expression won't form a perfect square trinomial.
When should I use completing the square instead of the Quadratic Formula?
Use completing the square if you want to find the vertex of a parabola, or if factoring obviously won't work and you want to understand the structure. Use the Quadratic Formula if you just need numerical answers quickly, especially with messy coefficients.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver