Skip to main content
MathFree · no sign-up

Quadratic Formula Calculator

Roots, discriminant and vertex — including the complex roots most calculators refuse.

Updated

x² term

x term

constant

Roots of ax² + bx + c = 0

x = 2 or 1

Discriminant b² − 4ac = 1, so there are two distinct real roots.

Discriminant
1
Vertex
(1.5000, -0.2500)
Axis of symmetry
x = 1.5000
Sum of the roots
3
Product of the roots
2

The sum and product lines are a free check on the answer: for any quadratic the roots must add to −b/a and multiply to c/a. If your own working gives roots that fail those two, the slip is in the working rather than in the formula.

Advertisement

In short

What does the discriminant tell you?

The sign of b² − 4ac decides how many real roots exist. Positive gives two, zero gives one repeated root, and negative gives none — the two roots are complex conjugates instead. For x² − 3x + 2 the discriminant is 1, so there are two: x = 2 and x = 1.

A negative discriminant means no REAL roots. It does not mean the equation has no solutions.

How to use the quadratic formula calculator

A quadratic equation is any equation of the form ax² + bx + c = 0 where a is not zero. The quadratic formula solves all of them: x equals minus b, plus or minus the square root of b squared minus four a c, all over two a. It works regardless of whether the expression factorises neatly, which is why it is worth having when factoring stalls.

The part under the square root is called the discriminant, and it is the number to read first. It decides the entire character of the answer before you have computed a single root. Positive means the parabola crosses the x axis twice. Zero means it touches at exactly one point. Negative means it never reaches the axis at all.

b² − 4ac

The discriminant

read its sign first

−b/a

The roots always sum to

Vieta's first formula

c/a

And always multiply to

Vieta's second

Advertisement

Those last two are a free check on any answer, however it was obtained. For 2x² − 10x + 12 = 0 the roots must add to 5 and multiply to 6, which points at 2 and 3 before the formula has been touched. If your own working produces roots that fail either test, the mistake is in the working rather than in the formula.

The vertex is the other thing worth taking from the same coefficients. Its x coordinate is −b divided by 2a, which is also the axis of symmetry, and substituting that back gives the y coordinate. The vertex is the turning point: the lowest point when a is positive and the highest when a is negative.

What the discriminant decides
b² − 4ac > 0
two distinct real roots
b² − 4ac = 0
one repeated real root, at the vertex
b² − 4ac < 0
two complex conjugate roots, no real ones
a = 0
not a quadratic — the formula divides by 2a
A perfect square discriminant
the roots are rational and it factorises

That last row is a useful practical test. If the discriminant comes out as 1, 4, 9, 16 or any other perfect square, the expression factorises with whole numbers and factoring will be quicker than the formula.

The square root inside the formula

Where the discriminant is not a perfect square, the roots stay irrational. Simplified radical form gives them exactly rather than as a rounded decimal.

Open the square root calculator

Quadratics covering all three discriminant cases, with the vertex and the root sum shown so each answer can be checked two independent ways.

EquationDiscriminantRoots
x² − 3x + 2 = 012 and 1
x² − 5x + 6 = 013 and 2
x² − 4x + 4 = 002, repeated
x² + 1 = 0−4i and −i
x² + 2x + 5 = 0−16−1 ± 2i
2x² − 10x + 12 = 043 and 2
x² − 2 = 08±1.4142
3x² + 5x − 2 = 0490.3333 and −2
x² − 6x + 9 = 003, repeated
4x² + 4x + 1 = 00−0.5, repeated
Roots are exact where they are rational and rounded to four decimal places otherwise. Vieta holds for the complex rows as well as the real ones.

The three cases, and what the parabola is doing

Every quadratic draws a parabola, and the roots are wherever it meets the x axis. That is the picture behind the discriminant: a parabola sitting low enough crosses the axis twice, one resting exactly on it touches once, and one floating entirely above or below never reaches it. The algebra and the geometry are saying the same thing.

One equation from each case
x² − 3x + 2
discriminant 1 → roots 2 and 1
x² − 4x + 4
discriminant 0 → root 2, twice
x² + 1
discriminant −4 → roots i and −i
The middle one
has its vertex on the axis
Same formula
three different kinds of answer

The repeated root is the boundary between the other two. Nudge the constant term of x² − 4x + 4 down and two real roots appear; nudge it up and they become complex. The single root is the exact moment of transition, which is why it is counted twice rather than once.

When the roots are complex they are always a conjugate pair, provided a, b and c are real numbers. That follows directly from the formula: the only difference between the two roots is the plus or minus in front of the square root, so their real parts are identical and their imaginary parts are opposite.

When factoring beats the formula

The formula always works, which does not make it always the fastest route. If the discriminant is a perfect square the roots are rational and the expression factorises with whole numbers — spotting that x² − 5x + 6 is (x − 2)(x − 3) takes seconds, while the formula takes a line of arithmetic and a square root.

Do

  • Read the discriminant before computing anything else
  • Check the roots against −b/a and c/a
  • Try factoring first when the coefficients are small whole numbers
  • Say "no real roots" rather than "no solutions"

Don't

  • Apply the formula when a is zero — it divides by 2a
  • Report −b/(2a) as the vertex; it is only the x coordinate
  • Forget the minus sign in front of b
  • Assume a negative discriminant means the calculation failed

When a is zero there is no parabola at all. The equation collapses to bx + c = 0, a straight line with a single root at −c/b, and the quadratic formula cannot be applied because it divides by 2a. This page detects that case and solves the linear equation instead of returning an error.

Advertisement

The corner the formula adds The formula is one missing corner Divide by a and the left side is x² + (b/a)x, which is a square with a corner missing. (b/2a)x (b/2a)x (b/2a)² Add that corner to both sides: (x + b/2a)² = (b² − 4ac) / 4a² Take the square root of both sides, subtract b/2a, and the formula is written. x = (−b ± √(b² − 4ac)) / 2a The discriminant is not a separate fact to memorise. It is what landed under the root. Every step is reversible, which is why the formula holds for every quadratic rather than for the ones in the exercise set.
Completing the square: the missing corner has area (b/2a) squared, and the formula is what falls out.

The formula, worked line by line

One formula, one number sitting inside it that decides everything about the answer, and two further identities that check the result for free once you have it.

Read the discriminant first. It tells you what kind of answer exists before you have worked out what the answer is.
The habit that makes the formula easy

It also prevents the commonest misreading. A calculator returning "no real roots" has not failed; it has told you the parabola never crosses the axis, which is a fact about the equation rather than about the arithmetic.

x = (−b ± √(b² − 4ac)) ÷ 2a
discriminant D = b² − 4ac
vertex x = −b ÷ 2a, and y = a·x² + b·x + c at that point
sum of roots = −b ÷ a
product of roots = c ÷ a
The discriminant decides the crossingsA positive discriminant of 1 crosses the axis twice, a zero discriminant touches once, and a negative discriminant of -4 never reaches it.WHERE THE PARABOLA MEETS THE X AXISx² − 3x + 2D = 1two real rootsx² − 4x + 4D = 0one, repeatedx² + 1D = -4none real
Three parabolas showing what a positive, zero and negative discriminant look like.
Two x squared minus ten x plus twelve
a, b, c
2, −10, 12
Discriminant
100 − 96 = 4
Square root of it
2
Roots
(10 ± 2) ÷ 4
Which is
3 and 2
Check
3 + 2 = 5 = −b/a, and 3 × 2 = 6 = c/a

The discriminant being 4, a perfect square, was the signal that the roots would be rational. Dividing through by 2 first would have given x² − 5x + 6, which factors on sight as (x − 3)(x − 2) — the same answer with no square root at all.

Where the formula comes from

Completing the square on ax² + bx + c = 0 produces it directly, which is why the formula is not something to be taken on trust. Divide through by a, move the constant across, add the square of half the x coefficient to both sides, and take the square root. The discriminant appears naturally as whatever ends up under that root.

A note on the history

What can actually be said
Old Babylonian tablets
procedures equivalent to specific quadratic problems
Brahmagupta, 628 CE
an explicit rule for solving the quadratic
Al-Khwarizmi, 9th century
a systematic classification of the cases
Modern symbolic form
much later, once algebraic notation existed
Negative and complex roots
accepted later still

The tidy claim that "the Babylonians knew the quadratic formula" reads a modern symbolic identity back into procedures that were written as recipes for particular problems. The procedures are real; the formula as we write it is not what they had.

That distinction matters more than it might seem, because it also explains why the negative and complex cases arrived so late: a method built around geometric areas has no room for a negative length, and the general formula only becomes possible once the notation stops describing shapes.

Advertisement

Questions people ask

What is the quadratic formula?

For ax² + bx + c = 0 with a not zero, x equals minus b, plus or minus the square root of b² − 4ac, all divided by 2a. It solves every quadratic equation with real coefficients, whether or not the expression factorises, and produces complex roots when the discriminant is negative.

Covered in depth in Why the Quadratic Formula Loses Accuracy on One of Its Two Roots

What does a negative discriminant mean?

That the parabola never crosses the x axis, so there are no real roots. The equation still has two roots and they are complex conjugates — the same real part with opposite imaginary parts. Calling this "no solution" is a common shorthand and it is inaccurate; "no real roots" is the correct description.

How do I check my roots are right?

Add them and multiply them. For any quadratic the roots must sum to −b/a and multiply to c/a, which are Vieta's formulas. For 2x² − 10x + 12 the roots must add to 5 and multiply to 6, and 3 and 2 satisfy both. A sign error in the formula almost always breaks one of the two tests.

What happens if a is zero?

It is not a quadratic and the formula cannot be used, because the formula divides by 2a. The equation becomes bx + c = 0, a straight line with a single root at −c/b. If b is zero as well, there is no equation left to solve — just a constant that is either always true or never true.

Should I factor or use the formula?

Compute the discriminant first. If it is a perfect square — 1, 4, 9, 16 and so on — the roots are rational and the expression factorises with whole numbers, which is usually faster. If it is not, factoring will not work neatly and the formula is the direct route.

Where is the vertex of a quadratic?

Its x coordinate is −b divided by 2a, which is also the axis of symmetry. Substitute that value back into the equation to get the y coordinate. Note that −b/(2a) is only half the answer: the vertex is a point, and quoting the x value alone is a common slip.

Sources

Where the constants and formulas on this page come from. Each line names the figure it backs.

  1. The discriminant b² − 4ac determines whether a quadratic with real coefficients has two distinct real roots, one repeated real root, or two complex conjugate roots.

    Quadratic FormulaWolfram MathWorld

  2. Vieta's formulas relate the sum and product of the roots of a polynomial to its coefficients.

    Vieta's FormulasWolfram MathWorld

  3. Brahmagupta gave an explicit rule for solving quadratic equations in the seventh century.

    BrahmaguptaMacTutor History of Mathematics Archive, University of St Andrews