Gpakit
Your equation: = 0
Quick examples
Discriminant (b² − 4ac)
Vertex (h, k)

How the quadratic equation solver works

Every quadratic equation can be written in the standard form ax² + bx + c = 0, where a ≠ 0. The quadratic formula — x = (−b ± √(b² − 4ac)) / 2a — gives both solutions directly from the three coefficients, without factoring or completing the square. This tool evaluates the formula and also reports the discriminant, the vertex of the parabola, and whether the roots are real or complex.

The formula, written out

The plus-minus sign in the formula generates two solutions. The core of the formula is the discriminant, D = b² − 4ac, which sits under the square root. Its sign tells you everything about the nature of the roots:

  • D > 0: two distinct real roots. The parabola crosses the x-axis at two points.
  • D = 0: one repeated real root. The parabola touches the x-axis at its vertex.
  • D < 0: two complex conjugate roots. The parabola does not cross the x-axis at all. The roots are p + qi and p − qi, where p = −b/(2a) and q = √(−D)/(2a).

Worked example

Solve x² − 5x + 6 = 0. Here a = 1, b = −5, c = 6.

  • Discriminant: D = (−5)² − 4(1)(6) = 25 − 24 = 1. Positive, so two real roots.
  • Square root of discriminant: √1 = 1.
  • Roots: x = (5 ± 1) / 2 = 3 or 2.

The equation factors as (x − 2)(x − 3) = 0, which agrees. The vertex of the parabola y = x² − 5x + 6 is at (h, k) where h = −b/(2a) = 2.5 and k = c − b²/(4a) = 6 − 6.25 = −0.25.

A complex-roots example

Solve x² + 2x + 5 = 0. Here a = 1, b = 2, c = 5.

  • Discriminant: D = 4 − 20 = −16. Negative, so complex roots.
  • p = −b/(2a) = −1. q = √16/(2·1) = 2.
  • Roots: −1 + 2i and −1 − 2i.

These are complex conjugates — a pair of numbers that mirror each other across the real axis in the complex plane. Every quadratic with real coefficients has roots that come either as two reals or as a conjugate pair.

The vertex

The vertex is the maximum or minimum point of the parabola y = ax² + bx + c. Its x-coordinate is always −b/(2a) — the midpoint of the two roots when they are real. Its y-coordinate is c − b²/(4a), obtained by substituting the x back into the equation. If a > 0 the parabola opens upward and the vertex is the minimum; if a < 0 it opens downward and the vertex is the maximum.

The vertex appears in the completed-square form of the equation: y = a(x − h)² + k, where (h, k) is the vertex. This form makes it visually obvious where the parabola's turning point is.

Edge cases

a = 0. Not a quadratic. The equation becomes bx + c = 0, a linear equation with root x = −c/b. This calculator flags a = 0 rather than dividing by zero.

Very small coefficients. Floating-point rounding can make the discriminant appear slightly non-zero when it should be exactly zero. Roots may come out as, say, 2.0000001 instead of 2. This is numerical noise, not a different answer. If you need exact symbolic roots, use a computer algebra system.

Non-real coefficients. This solver handles real a, b, c. Quadratics with complex coefficients require more general techniques.

What this calculator is not

This tool solves one quadratic at a time. It does not factor polynomials of higher degree, solve systems of equations, or handle inequalities. It also does not show symbolic steps — it gives numerical answers only. For symbolic manipulation or step-by-step algebra, a computer algebra system is more appropriate.

Frequently asked questions

What does the quadratic formula do?
The quadratic formula solves any equation of the form ax² + bx + c = 0 for x. It is x = (−b ± √(b² − 4ac)) / 2a. The ± produces up to two solutions, which may be real or complex depending on the sign of the discriminant b² − 4ac.
What is the discriminant?
The discriminant is the expression under the square root: D = b² − 4ac. Its sign tells you the nature of the roots without solving the full equation. If D > 0 there are two distinct real roots. If D = 0 there is one repeated real root. If D < 0 there are two complex conjugate roots, which appear as a pair p ± qi.
What are complex roots?
Complex roots occur when the discriminant is negative — the square root of a negative number is imaginary. The two roots come as a conjugate pair: p + qi and p − qi, where p = −b/(2a) and q = √(−D)/(2a), and i is the imaginary unit (√−1). The graph of the parabola in this case does not cross the x-axis.
What is the vertex of the parabola?
The vertex is the maximum or minimum point of the parabola defined by y = ax² + bx + c. Its x-coordinate is −b/(2a), and its y-coordinate can be computed by substituting that x back into the equation — equivalently c − b²/(4a). If a > 0 the vertex is the minimum; if a < 0 it is the maximum.
Why must a be non-zero?
If a = 0, the x² term disappears and the equation is linear (bx + c = 0), not quadratic. A linear equation has at most one root: x = −c/b. This calculator requires a ≠ 0 so the quadratic formula is defined — otherwise the denominator 2a is zero and the formula breaks.
Can I use this for completing the square?
The quadratic formula is derived from completing the square on the general form. This tool skips the intermediate step and gives you the roots directly. If you want to see the completed-square form y = a(x − h)² + k, note that h = −b/(2a) is the vertex x, and k = c − b²/(4a) is the vertex y — the same numbers this calculator outputs as the vertex.
How does this handle decimal coefficients?
The solver accepts any real-valued coefficients with up to two decimal places by default, though finer precision is allowed. Floating-point rounding can make the discriminant appear slightly non-zero when it should be exactly zero — if a root comes out as, say, 2.0000001 instead of 2, that is floating-point error, not a different answer.