Completing the Square Calculator

Rewrite ax² + bx + c as a completed square and see its vertex.

The coefficient of x², not 0.

The coefficient of x.

The constant term.

Try

Result

You entered1x2+−5x+61x^2 + -5x + 6

(x−5/2)2−1/4\displaystyle (x - 5/2)^2 - 1/4

Vertex

(52,−14)\displaystyle \left(\frac{5}{2}, -\frac{1}{4}\right)

Roots

x=2,x=3\displaystyle x = 2, x = 3
Show the work
  1. Vertex form of a quadratic

    Completing the square rewrites the quadratic so that the vertex (h,k)(h, k) can be read off. Here a=1a = 1, b=−5b = -5 and c=6c = 6.

    Using ax2+bx+c=a(x−h)2+kax^2 + bx + c = a\left(x - h\right)^2 + k

  2. x-coordinate of the vertex

    Expanding a(x−h)2a(x - h)^2 gives an xx term of −2ah-2ah, which must equal bb; solving for hh gives the vertex position.

    h=−b2a=−(−5)2×1=−(−5)2=52\begin{aligned} h &= -\frac{b}{2a} \\ &= -\frac{\left(-5\right)}{2 \times 1} \\ &= -\frac{\left(-5\right)}{2} \\ &= \frac{5}{2} \end{aligned}
  3. y-coordinate of the vertex

    Expanding a(x−h)2+ka(x - h)^2 + k gives a constant of ah2+kah^2 + k, which must equal cc; solving for kk gives the height of the vertex. Here h=52h = \frac{5}{2}.

    k=c−ah2=6−1×(52)2=6−(254)=−14\begin{aligned} k &= c - ah^2 \\ &= 6 - 1 \times \left(\frac{5}{2}\right)^2 \\ &= 6 - \left(\frac{25}{4}\right) \\ &= -\frac{1}{4} \end{aligned}
  4. Write in vertex form

    Put a=1a = 1, h=52h = \frac{5}{2} and k=−14k = -\frac{1}{4} into the vertex form. Subtracting a negative hh adds, so the bracket reads (x+∣h∣)(x + |h|), and a kk of 0 is left out.

    Using a(x−h)2+ka\left(x - h\right)^2 + k

    1(x−(52))2+(−14)=(x−52)2−141\left(x - \left(\frac{5}{2}\right)\right)^2 + \left(-\frac{1}{4}\right) = \left(x - \frac{5}{2}\right)^2 - \frac{1}{4}
  5. Result

    So the quadratic is (x−52)2−14\left(x - \frac{5}{2}\right)^2 - \frac{1}{4}, with its vertex at (52,−14)\left(\frac{5}{2}, -\frac{1}{4}\right).

Worked examples