Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Algebra formulas

Completing the square

Rewrite a quadratic expression as a square plus or minus a constant.

Algebra · Quadratics
$$x^2+bx=\left(x+\frac b2\right)^2-\left(\frac b2\right)^2$$

Completing the square is one of 4 quadratics formulas in the algebra section of this library, and it is used at high school level.

Why completing the square works

Expanding the squared bracket produces x squared plus bx plus the square of half b. That is the original expression plus one extra constant, so subtracting the same constant leaves the value untouched while making the perfect square visible.

What each symbol means

$b$ is the coefficient of $x$ after the leading coefficient is made $1$.

Completing the square: when it holds

If the original leading coefficient is not $1$, factor it from the quadratic and linear terms first.

When it stops applying

The pattern assumes a leading coefficient of 1. Factor it out first: 2x squared + 12x becomes 2 times (x squared + 6x), then 2 times ((x + 3) squared - 9), which finishes as 2(x + 3) squared - 18 and agrees with the original at x = 0.

Completing the square: a worked example

$x^2+6x=(x+3)^2-9$.

The mistake to avoid

What people do: Adding the square of half b without subtracting it again.

Why it goes wrong: That changes the expression instead of rewriting it. At x = 0, the original x squared + 6x is 0 while (x + 3) squared is 9, so the two are not the same thing.

Do this instead: Add and subtract the constant in the same step, keeping the subtraction outside the bracket where you can see it.

Completing the square: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $b$ is the coefficient of $x$ after the leading coefficient is made $1$.
  3. Check the conditions before substituting. If the original leading coefficient is not $1$, factor it from the quadratic and linear terms first.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most algebra slips.

Where this formula fits

Subject
Algebra formulas — 28 entries in this library
Topic
Quadratics
Level
High school

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where completing the square comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about completing the square

Why half of b and not b itself?

Because expanding a square doubles the cross term. Halving first cancels that doubling, so the bracket produces exactly the bx you started with.

Why bother when the quadratic formula already solves everything?

Because this rewrite hands you the vertex, converts circle equations into centre-radius form, and sets up integrals later. It gives structure, not just roots.

Does it still work when b is odd?

Yes, with a fraction. Rewriting x squared + 5x gives (x + 2.5) squared - 6.25, and checking at x = 1 gives 6 both ways.

What happens when b is negative?

Half of b keeps its sign, so the bracket subtracts. For x squared - 10x you get (x - 5) squared - 25, and both forms give -9 at x = 1.

Stuck on a problem?

Work a completing the square problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.