Skip to content
Math & Statisticsalgebra

Quadratic Equation Solver

A quadratic solved with the discriminant, the vertex and both roots, including complex ones. A negative discriminant is a conjugate pair rather than an error, and reporting it as no solution is simply wrong.

Also called: quadratic formula calculator, solve ax2+bx+c.

Roots
x = 3 and x = 2

The discriminant is 1, so there are two real roots: x = 3 and x = 2. The parabola turns at (2.5, -0.25).

Discriminant
1
Nature of the roots
two real roots
Vertex x
2.5
Vertex y
-0.25
Sum of the roots
5
Product of the roots
6
Method and background

How this is calculated

The discriminant, b squared minus four a c, decides everything before any root is computed. Positive means the parabola crosses the axis twice; zero means it touches once; negative means it never crosses and the roots are a complex conjugate pair. Vieta gives a free check: the roots must sum to minus b over a and multiply to c over a, and both are shown so the answer can be verified without redoing the arithmetic.

x = (-b +/- sqrt(b^2 - 4ac)) / 2a
a
Coefficient of x squared
b
Coefficient of x
c
The constant

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

two clean real roots

a (coefficient of x squared)
1
b (coefficient of x)
-5
c (constant)
6

Rootsx = 3 and x = 2

Roots 2 and 3, checked against Vieta's formulas

Open this example

a negative discriminant is complex, not impossible

a (coefficient of x squared)
1
b (coefficient of x)
0
c (constant)
1

Rootsx = 0 + 1i and x = 0 - 1i

The case most calculators report wrongly as no solution

Open this example

a perfect square has one repeated root

a (coefficient of x squared)
1
b (coefficient of x)
-4
c (constant)
4

Rootsx = 2 and x = 2

boundary: the discriminant is exactly zero

Open this example

Method and limits

What it assumes

  • Real coefficients.

What it deliberately does not model

  • With a equal to zero the equation is linear rather than quadratic and is declined; use the linear solver.

Formula version 1.0.0 · definition 1.0.0 · India · Report a problem with this calculator

Frequently asked questions

What does a negative discriminant mean?
The parabola never crosses the x axis, so there are no real roots. There are still two complex roots, a conjugate pair, and they are shown here rather than reported as no solution.
How can I check the roots quickly?
Vieta's formulas. The roots must add to minus b over a and multiply to c over a. Both are on this page for exactly that reason.