Completing the Square Calculator

Convert quadratics to vertex form and solve equations with AI-powered step-by-step solutions

Drag & drop or click to add images or PDF

Math Input
Complete the square for x^2 + 6x + 5
Convert 2x^2 - 8x + 3 to vertex form
Solve x^2 + 4x - 5 = 0 by completing the square
Find the vertex of y = x^2 - 10x + 21

What is Completing the Square?

Completing the square is the algebraic technique of rewriting a quadratic ax2+bx+cax^2 + bx + c as:

a(xh)2+ka(x - h)^2 + k

where (h,k)(h, k) is the vertex of the parabola.

Why this matters:

  • Reveals the vertex (minimum/maximum point) of a parabola at a glance.
  • Lets you solve any quadratic equation without the quadratic formula.
  • Is the underlying technique that derives the quadratic formula.
  • Used to evaluate 1x2+bx+cdx\int \frac{1}{x^2 + bx + c}\,dx in calculus (reduces to arctan).
  • Essential for understanding Gaussian integrals and many topics in physics.

The core identity that makes it work:

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

How to Complete the Square

Case 1: Leading Coefficient is 1

For x2+bx+cx^2 + bx + c:

  1. Take half of bb and square it: (b/2)2(b/2)^2.
  2. Add and subtract this quantity: x2+bx+(b/2)2(b/2)2+cx^2 + bx + (b/2)^2 - (b/2)^2 + c.
  3. Group the perfect square: (x+b/2)2+c(b/2)2(x + b/2)^2 + c - (b/2)^2.

Example: x2+6x+5x^2 + 6x + 5

  • Half of 6 is 3. Squared: 9.
  • x2+6x+99+5=(x+3)24x^2 + 6x + 9 - 9 + 5 = (x + 3)^2 - 4

Vertex form: (x+3)24(x + 3)^2 - 4, vertex at (3,4)(-3, -4).

Case 2: Leading Coefficient is Not 1

For ax2+bx+cax^2 + bx + c, a1a \neq 1:

  1. Factor aa out of the first two terms: a(x2+bax)+ca\left(x^2 + \frac{b}{a}x\right) + c.
  2. Complete the square inside the parentheses: half of b/ab/a is b/(2a)b/(2a), squared is b2/(4a2)b^2/(4a^2).
  3. Add and subtract inside: a(x2+bax+b24a2)ab24a2+ca\left(x^2 + \frac{b}{a}x + \frac{b^2}{4a^2}\right) - a \cdot \frac{b^2}{4a^2} + c.
  4. Simplify: a(x+b2a)2+cb24aa\left(x + \frac{b}{2a}\right)^2 + c - \frac{b^2}{4a}.

Note that when you 'undo' the added term, you multiply by aa since the inside is multiplied by aa.

Solving a Quadratic Equation

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

  1. Complete the square to get a(xh)2+k=0a(x - h)^2 + k = 0.
  2. Isolate the squared term: (xh)2=k/a(x - h)^2 = -k/a.
  3. Take square roots: xh=±k/ax - h = \pm\sqrt{-k/a}.
  4. Solve: x=h±k/ax = h \pm \sqrt{-k/a}.

This is essentially what the quadratic formula does in a single compact expression.

Common Mistakes to Avoid

  • Forgetting to balance: When you add (b/2)2(b/2)^2, you must subtract it too. Otherwise you've changed the expression.
  • Wrong coefficient handling: If a1a \neq 1, you must factor aa out of the first two terms before completing the square, then multiply your correction by aa when distributing back.
  • Sign errors with ±\pm: After taking square roots, both branches must be kept. Dropping the ±\pm loses a solution.
  • Half of bb vs b/2ab/2a: When the leading coefficient is 1, take half of bb. When it's not, factor first — then take half of the new coefficient.
  • Forgetting to simplify the constant: After completing the square, combine the leftover constants into a single kk.

Examples

Step 1: Half of 6 is 3; squared is 9
Step 2: Add and subtract 9: x2+6x+99+5x^2 + 6x + 9 - 9 + 5
Step 3: Group: (x+3)2+(9+5)(x + 3)^2 + (-9 + 5)
Step 4: Simplify: (x+3)24(x + 3)^2 - 4
Answer: (x+3)24(x + 3)^2 - 4, vertex at (3,4)(-3, -4)

Step 1: Factor 2 from first two terms: 2(x24x)+32(x^2 - 4x) + 3
Step 2: Half of 4-4 is 2-2; squared is 44
Step 3: Add and subtract 4 inside: 2(x24x+44)+3=2[(x2)24]+32(x^2 - 4x + 4 - 4) + 3 = 2[(x - 2)^2 - 4] + 3
Step 4: Distribute: 2(x2)28+32(x - 2)^2 - 8 + 3
Step 5: Simplify: 2(x2)252(x - 2)^2 - 5
Answer: 2(x2)252(x - 2)^2 - 5, vertex at (2,5)(2, -5)

Step 1: Move constant: x2+4x=5x^2 + 4x = 5
Step 2: Complete the square: half of 4 is 2, squared is 4. Add 4 to both sides: x2+4x+4=9x^2 + 4x + 4 = 9
Step 3: Factor: (x+2)2=9(x + 2)^2 = 9
Step 4: Take square roots: x+2=±3x + 2 = \pm 3
Step 5: Solve: x=2+3=1x = -2 + 3 = 1 or x=23=5x = -2 - 3 = -5
Answer: x=1x = 1 or x=5x = -5

Frequently Asked Questions

Use completing the square when you need the vertex form of a parabola, when integrating rational expressions of the form 1/(x² + bx + c), or when deriving the quadratic formula. For just finding roots, the quadratic formula is usually faster.

The quadratic formula is literally what you get when you complete the square on a generic ax² + bx + c = 0 and solve for x. Every quadratic-formula calculation is a packaged completing-the-square in disguise.

Vertex form a(x - h)² + k makes the vertex (h, k) and the direction (opens up if a > 0, down if a < 0) immediately visible. It's the natural form for graphing, finding min/max, and many calculus problems.

Yes. It works on every quadratic ax² + bx + c with a ≠ 0, including ones with no real roots (where the constant k after completing the square has the wrong sign for x to be real).

Related Solvers

Quadratic Equation CalculatorFactoring CalculatorEquation Solver
Try AI-Math for Free

Get step-by-step solutions to any math problem. Upload a photo or type your question.

Start Solving