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 entered2x2+8x+32x^2 + 8x + 3

2(x+2)2−5\displaystyle 2(x + 2)^2 - 5

Vertex

(−2,−5)\displaystyle \left(-2, -5\right)

Roots

x=−2−(1/2)√10,x=−2+(1/2)√10\displaystyle x = -2 - (1/2)√10, x = -2 + (1/2)√10
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=2a = 2, b=8b = 8 and c=3c = 3.

    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=−82×2=−84=−2\begin{aligned} h &= -\frac{b}{2a} \\ &= -\frac{8}{2 \times 2} \\ &= -\frac{8}{4} \\ &= -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=−2h = -2.

    k=c−ah2=3−2×(−2)2=3−8=−5\begin{aligned} k &= c - ah^2 \\ &= 3 - 2 \times \left(-2\right)^2 \\ &= 3 - 8 \\ &= -5 \end{aligned}
  4. Write in vertex form

    Put a=2a = 2, h=−2h = -2 and k=−5k = -5 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

    2(x−(−2))2+(−5)=2(x+2)2−52\left(x - \left(-2\right)\right)^2 + \left(-5\right) = 2\left(x + 2\right)^2 - 5
  5. Result

    So the quadratic is 2(x+2)2−52\left(x + 2\right)^2 - 5, with its vertex at (−2,−5)\left(-2, -5\right).

The parabola, with its vertex and real roots marked.

Worked examples