Ekuation

solving method

Completing the Square Calculator

Solve quadratic equations by completing the square with detailed step-by-step work. See every transformation from standard form to the solution.

Back to Quadratic Formula Calculator

The coefficient of x² in ax² + bx + c = 0

The coefficient of x in ax² + bx + c = 0

The constant term in ax² + bx + c = 0

Quick Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

Standard Form

Classic quadratic x² − 5x + 6 = 0 with two integer roots (x = 2 and x = 3)

Key values: a = 1 · b = −5 · c = 6

Physics Problem

Projectile height equation −4.9t² + 20t + 1.5 = 0 (when does the ball hit the ground?)

Key values: a = −4.9 · b = 20 · c = 1.5

Complex Roots

Equation x² + 2x + 5 = 0 with no real solutions (discriminant < 0)

Key values: a = 1 · b = 2 · c = 5

Documentation

Completing the Square

Completing the square transforms a quadratic expression into vertex form by creating a perfect square trinomial. It is the algebraic technique that derives the quadratic formula itself.

ax2+bx+c=a(x+b2a)2b24ac4aax^2 + bx + c = a\left(x + \frac{b}{2a}\right)^2 - \frac{b^2 - 4ac}{4a}

Step-by-Step Process

Given ax2+bx+c=0ax^2 + bx + c = 0:

  1. Divide by aa: x2+(b/a)x+c/a=0x^2 + (b/a)x + c/a = 0
  2. Move constant: x2+(b/a)x=c/ax^2 + (b/a)x = -c/a
  3. Add the "magic number": Add (b/2a)2(b/2a)^2 to both sides
  4. Factor the left side: (x+b/2a)2=(b24ac)/4a2(x + b/2a)^2 = (b^2 - 4ac) / 4a^2
  5. Take square root and solve: x=b/(2a)±b24ac/(2a)x = -b/(2a) \pm \sqrt{b^2-4ac}/(2a)

Key insight: Step 5 is the quadratic formula. Completing the square on the general equation ax2+bx+c=0ax^2 + bx + c = 0 is exactly how the quadratic formula is derived. Understanding this technique means you never need to memorize the formula — you can re-derive it.


Connection to Vertex Form

Completing the square converts y=ax2+bx+cy = ax^2 + bx + c into vertex form:

y=a(xh)2+ky = a(x - h)^2 + k

where the vertex is at (h,k)=(b/2a,  cb2/4a)(h, k) = (-b/2a, \; c - b^2/4a). This instantly reveals:

  • The axis of symmetry: x=hx = h
  • The minimum/maximum value: y=ky = k
  • The direction of opening: up if a>0a > 0, down if a<0a < 0

Worked Example

Solve 2x2+12x+7=02x^2 + 12x + 7 = 0 by completing the square:

x2+6x+72=0x^2 + 6x + \frac{7}{2} = 0
x2+6x+9=972=112x^2 + 6x + 9 = 9 - \frac{7}{2} = \frac{11}{2}
(x+3)2=112(x + 3)^2 = \frac{11}{2}
x=3±1120.655 or 5.345x = -3 \pm \sqrt{\frac{11}{2}} \approx -0.655 \text{ or } -5.345

Frequently Asked Questions

What is completing the square?

Completing the square is an algebraic technique that transforms a quadratic expression ax2+bx+cax^2 + bx + c into vertex form a(x+b/2a)2+ka(x + b/2a)^2 + k by creating a perfect square trinomial. It is the method used to derive the quadratic formula itself.

What is the "magic number" in completing the square?

The magic number is (b/2a)2(b/2a)^2, which you add to both sides of the equation. For x2+bx=cx^2 + bx = -c (after dividing by aa and moving the constant), adding (b/2)2(b/2)^2 to both sides creates a perfect square on the left: (x+b/2)2(x + b/2)^2.

When should I use completing the square instead of the quadratic formula?

Use completing the square when you need the vertex form for graphing or optimization, when deriving the quadratic formula itself, or when the equation is already close to a perfect square. For just finding roots, the quadratic formula is usually faster.

How does completing the square derive the quadratic formula?

Applying the completing the square steps to the general equation ax2+bx+c=0ax^2 + bx + c = 0 produces (x+b/2a)2=(b24ac)/(4a2)(x + b/2a)^2 = (b^2 - 4ac)/(4a^2). Taking the square root and solving for xx gives x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}, which is the quadratic formula.

Can completing the square be used with non-integer coefficients?

Yes. The method works for any real coefficients. Divide by aa first, then add (b/2a)2(b/2a)^2 to both sides. Fractions and decimals make the arithmetic more involved but the process is identical. The calculator handles all coefficient types automatically.

Related solving-method Variants

Explore more solving-method options

More Math Calculators

Explore the category

Calculator Search

Search and find calculators