Skip to the calculator
Rule Calculator

Quadratic Formula Calculator

With a (x² coefficient) 1, b (x coefficient) -3, c (constant) 2, quadratic formula comes to 2.0000 — first root. It is reached in 6 steps, the last of which is (-b + root_disc) / (2 * a), and each one is printed on the page with its numbers filled in. The formula is the one published by Wolfram MathWorld, not an approximation fitted to it.

Both roots of ax² + bx + c = 0 from the quadratic formula, with the discriminant that says in advance how many real roots there are.

By Alex Seote, Built and maintains Rule Calculator · Formula and sources checked · How we check

a (x² coefficient) 1, b (x coefficient) -3, c (constant) 2

2.0000

First root for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.

It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.

First root
2.0000
Discriminant, b² − 4ac
b^2 - 4 * a * c1
Square root of the discriminant
sqrt(max(discriminant, 0))1
First root, (−b + √D) / 2a
(-b + root_disc) / (2 * a)2
Second root, (−b − √D) / 2a
(-b - root_disc) / (2 * a)1
Vertex, x = −b / 2a
-b / (2 * a)1.5
Number of real roots
discriminant > 0 ? 2 : (discriminant == 0 ? 1 : 0)2

Ask about this in the chat

Worked example

x² − 3x + 2 has discriminant 9 − 8 = 1, so √D is 1 and the roots are (3 + 1)/2 = 2 and (3 − 1)/2 = 1. A positive discriminant always means two real roots; check it before doing the rest and you know what you are looking for.

How to work it out yourself

  1. 1.Write the equation as ax² + bx + c = 0 first. A term on the wrong side of the equals sign is the commonest cause of a wrong answer here, not the arithmetic.
  2. 2.Work out the discriminant, b² − 4ac. Positive means two real roots, zero means one repeated root, negative means none that are real.
  3. 3.Take the square root of the discriminant and apply it both ways: (−b + √D) / 2a and (−b − √D) / 2a. The two roots sit either side of −b/2a, which is the vertex of the parabola.

The formula

  1. Discriminant, b² − 4acb^2 - 4 * a * c
  2. Square root of the discriminantsqrt(max(discriminant, 0))
  3. First root, (−b + √D) / 2a(-b + root_disc) / (2 * a)
  4. Second root, (−b − √D) / 2a(-b - root_disc) / (2 * a)
  5. Vertex, x = −b / 2a-b / (2 * a)
  6. Number of real rootsdiscriminant > 0 ? 2 : (discriminant == 0 ? 1 : 0)

Source: Wolfram MathWorld — quadratic formula, NIST Digital Library of Mathematical Functions

Questions people actually ask

What does a negative discriminant mean?
The parabola never crosses the x-axis, so there is no real solution. The roots exist as a complex conjugate pair — −b/2a ± i√(−D)/2a — and this calculator reports zero real roots rather than printing a complex number that most people entering a quadratic did not want.
Why does a = 0 not work?
Because the formula divides by 2a. With no x² term the equation is bx + c = 0, a straight line with the single solution −c/b, and the quadratic formula is the wrong tool rather than a failing one.
Where is the vertex?
At x = −b/2a, exactly halfway between the two roots. That is why the roots are symmetric about it: the ± in the formula moves the same distance either side, and the distance is √D divided by 2a.
Can I just factorise instead?
When the roots are whole numbers, yes, and it is faster. The formula is what you reach for when they are not — and the discriminant tells you which case you are in before you waste time hunting for factors that do not exist.

Related

Put this calculator on your site

Free, no attribution required beyond the link.

<iframe src="https://rulecalculators.com/embed/quadratic-formula" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Quadratic Formula Calculator"></iframe>
Did this answer your question?