Solving Quadratic Equations by Completing the Square

By: Calculator Grid

Solving by Completing the Square Calculator

Transform a quadratic into completed-square form, classify its real solutions, and follow every algebraic step.

Quadratic equation 2 real roots Discriminant: 16

The startup example is ready to export as a validated XLSX workbook.

Quadratic coefficients

x² + 6x + 5 = 0

Required. Any finite real number except 0.

Required. The coefficient of x.

Required. The constant term.

Controls displayed rounding only; calculations keep full precision.

Live result

Real solutions

x = – 1 or x = – 5

Two distinct real roots

Completed-square form

(x + 3)² = 4

Discriminant

16

Vertex

( – 3, – 4)

Two real solutions: negative one and negative five.

Completing-the-square steps

The table follows the normalized equation and applies the same operation to both sides.

Step Operation Result

Displayed values follow the selected Precision, while the solution and exported workbook use the full finite model values.

How to use the solving by completing the square calculator

What this calculator does

This calculator solves a real-coefficient quadratic equation in standard form, ax² + bx + c = 0, by rewriting it as a perfect-square equation. It reports the real solution set, the completed-square form, the discriminant, the parabola's vertex, and a step table showing the algebra. It is useful for checking homework, studying the method, confirming a hand calculation, or comparing completing the square with factoring or the quadratic formula. It does not decide which algebraic method is fastest for a particular exercise, and “no real roots” does not mean the equation lacks complex-number solutions.

How to calculate

The calculator opens with the complete demonstration equation x² + 6x + 5 = 0, so its results and validated example XLSX are immediately available.

  1. Replace Coefficient a, Coefficient b, and Coefficient c with the coefficients from your equation.
  2. Choose Precision from 0 to 10 decimal places. This changes displayed rounding, not the underlying calculation.
  3. Read Real solutions first, then use Completed-square form, Discriminant, Vertex, and the step table to verify the method.
  4. Select Download Excel to export the current inputs and outputs as a real Office Open XML workbook. Reset clears the demonstration values and results; Excel export remains unavailable until all required coefficients again form a valid quadratic.

Input guide

Coefficient a is the required real coefficient multiplying x². Enter a plain US-style decimal such as 1, 2.5, or – 3; commas, scientific notation, and unit symbols are rejected. It cannot equal zero, because then the equation is not quadratic. Changing a affects the normalization, vertex, discriminant, and roots.

Coefficient b is the required real coefficient multiplying x. A value such as 6 is valid, including zero or a negative decimal. Its normalized half, b/(2a), becomes the number added inside the square. A common error is forgetting to divide b by a before halving when a is not 1.

Coefficient c is the required real constant term, such as 5. It may be positive, negative, or zero. Changing c shifts the parabola vertically and can change the equation from two real roots to one repeated root or no real roots.

Precision is a required display setting from 0 through 10 decimal places. The startup value is 4. It affects the text shown in result cards and table cells, but the model and XLSX numeric cells retain full JavaScript number precision.

Output guide

Real solutions lists two distinct roots, one repeated root, or “No real roots.” These are exact mathematical identities subject only to displayed decimal rounding. Completed-square form shows the normalized equation as (x + b/(2a))² = Δ/(4a²). A zero right side means a repeated root; a negative right side means no real solution.

Discriminant is Δ = b² – 4ac. A positive value gives two real roots, zero gives one repeated real root, and a negative value gives no real roots. Vertex is the turning point ( – b/(2a), – Δ/(4a)); it is driven by all three coefficients. The summary pills repeat the equation status, root count, and discriminant. In the step table, Step is the sequence number, Operation states the algebraic action, and Result shows the resulting equation.

Worked example

For the startup inputs a = 1, b = 6, and c = 5, first move the constant: x² + 6x = – 5. Half of 6 is 3, and 3² = 9, so add 9 to both sides: x² + 6x + 9 = 4. The left side becomes (x + 3)², giving (x + 3)² = 4. Taking square roots gives x + 3 = ±2, so the displayed real solutions are x = – 1 or x = – 5. The discriminant is 6² – 4(1)(5) = 16, and the vertex is ( – 3, – 4).

Learn more

For a textbook treatment of the square-root property and completing-square procedure, see the OpenStax section on quadratic equations. A second guided explanation is available in Khan Academy's completing-the-square lesson.

Why the method works

After dividing by a, the quadratic is x² + (b/a)x + c/a = 0. The identity (x + d)² = x² + 2dx + d² shows that choosing d = b/(2a) creates the matching x-term. Adding d² to both sides produces a perfect square:

(x + b/(2a))² = (b² – 4ac)/(4a²)

The right-hand side is the discriminant divided by a positive square, so its sign is controlled entirely by Δ. This is why the discriminant classification and the completing-the-square result always agree. For a concise reference on the identity itself, consult Wolfram MathWorld's completing-the-square entry.

Common mistakes

  • Completing the square before dividing every term by a when a is not 1.
  • Adding (b/a)² instead of the required square of half the normalized x-coefficient.
  • Adding a value to only one side of the equation.
  • Dropping the ± symbol when taking the square root, which loses one real solution.
  • Treating a negative completed-square right side as a real number instead of recognizing that no real square can be negative.