Quadratic Formula Calculator
Solve ax²+bx+c=0 with the quadratic formula. Enter coefficients a, b, and c to get the discriminant, root type, and both roots — real or complex.
How It's Calculated
Formula
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\text{Discriminant: } D = b^2 - 4acAny quadratic equation in the form ax² + bx + c = 0 (with a not equal to 0) can be solved directly with the quadratic formula: x = (-b ± √(b² - 4ac)) / 2a. The expression under the square root, b² - 4ac, is called the discriminant (D), and its sign alone tells you what kind of roots the equation has before you even finish the calculation. When D is positive, the square root is a real number and the ± produces two distinct real roots. When D is exactly zero, the square root is zero, so the ± collapses to a single value — one repeated real root, meaning the parabola just touches the x-axis at one point instead of crossing it twice. When D is negative, the square root of a negative number isn't a real number, so the two roots become a complex conjugate pair: the same real part (-b/2a) combined with equal and opposite imaginary parts (±√(-D)/2a times i). This calculator computes the discriminant first, then reports the root(s) in whichever form matches that case.
Worked Examples
Two real roots: a=1, b=-3, c=2
- Discriminant: D = b² - 4ac = (-3)² - 4(1)(2) = 9 - 8 = 1
- Since D > 0, there are two distinct real roots.
- √D = √1 = 1
- x = (-b ± √D) / 2a = (3 ± 1) / 2
- Root 1 = (3 + 1) / 2 = 2. Root 2 = (3 - 1) / 2 = 1.
- Check: 1(2)² - 3(2) + 2 = 4 - 6 + 2 = 0. 1(1)² - 3(1) + 2 = 1 - 3 + 2 = 0. Both roots confirmed.
Two complex conjugate roots: a=1, b=2, c=5
- Discriminant: D = b² - 4ac = (2)² - 4(1)(5) = 4 - 20 = -16
- Since D < 0, the roots are a complex conjugate pair, not real numbers.
- Real part = -b / 2a = -2 / 2 = -1
- Imaginary part magnitude = √(-D) / 2a = √16 / 2 = 4 / 2 = 2
- Root 1 = -1 + 2i. Root 2 = -1 - 2i.
Frequently Asked Questions
What does a negative discriminant mean?
A negative discriminant (D < 0) means the equation has no real roots — the parabola described by y = ax² + bx + c never crosses or touches the x-axis. Instead, the two solutions are a complex conjugate pair: the same real part with equal and opposite imaginary parts, e.g. -1 + 2i and -1 - 2i. These are still valid mathematical solutions to the equation, just not real numbers.
What if a = 0?
If a = 0, the x² term disappears and the equation reduces to bx + c = 0, which is linear, not quadratic — it has at most one solution and isn't solved by the quadratic formula (which divides by 2a, undefined when a = 0). This calculator requires a nonzero a and reports a=0 as invalid input rather than silently solving it as a linear equation.
What does the discriminant being exactly zero mean?
A discriminant of exactly 0 means the equation has one repeated real root — the parabola's vertex sits exactly on the x-axis, touching it at a single point rather than crossing it at two distinct points. The quadratic formula still applies; the ±√D term just contributes 0, so both branches of the formula produce the same value.
Why are the complex roots shown as text like "-1 + 2i" instead of a decimal?
Complex numbers have two independent parts — a real part and an imaginary part — that can't be represented as a single decimal number the way a real root can. Writing them as "real ± imaginary·i" is the standard mathematical notation, so this calculator formats them as text in that form rather than trying to force them into a numeric field.
Can the two roots ever be the same number without the discriminant being zero?
No. The two roots are only ever identical (a single repeated root) exactly when the discriminant is 0. Any nonzero discriminant — positive or negative — produces two genuinely distinct roots (two different real numbers for D > 0, or two different complex numbers for D < 0).