A quadratic equation is any equation that can be written in the standard form ax² + bx + c = 0, where x is the unknown and a, b, c are constants. This calculator solves it for you step by step: it computes the discriminant, tells you whether the roots are real or complex, prints both roots, and then verifies the answer with Vieta's formulas (the sum and product of the roots) plus the factored form. Whether you are checking algebra homework, optimizing a business break-even point, or sketching a projectile's flight path, every result updates instantly as you type.
How to Use
- Enter Coefficient a (x²) — the number in front of x². It must not be zero; if a = 0 the equation collapses into a linear one and the calculator will warn you.
- Enter Coefficient b (x) — the number in front of x. This one may be positive or negative.
- Enter the Constant c — the term with no x. It may be positive, negative, or zero.
- Read the Discriminant line first. Its sign tells you everything before you see the roots: positive means two distinct real roots, zero means a single repeated root, negative means a complex pair.
- Read Root 1 and Root 2. When the discriminant is negative the roots are printed as real + imaginary parts (for example 0 ± 1i).
- Cross-check with Sum of Roots (−b/a) and Product of Roots (c/a). Vieta's formulas let you confirm you did not mis-copied a sign.
- Copy the Factored Form (x − root1)(x − root2) when you need to write the polynomial back as a product of linear factors.
The Quadratic Formula
The whole solver runs on the formula every algebra student memorizes:
x = (−b ± √(b² − 4ac)) / (2a)
The expression under the square root, D = b² − 4ac, is the discriminant. Because a square root of a negative number is not real, the sign of D decides the shape of the answer:
- D > 0 — two distinct real roots. The parabola crosses the x-axis twice.
- D = 0 — one repeated real root. The parabola touches the x-axis at exactly one point (its vertex sits on the axis).
- D < 0 — no real roots; instead two complex conjugate roots a ± bi. The parabola never touches the x-axis.
Worked example: x² − 5x + 6 = 0 gives a = 1, b = −5, c = 6. D = (−5)² − 4·1·6 = 25 − 24 = 1. Then x = (5 ± 1)/2, which is x = 3 and x = 2. Vieta checks out: 3 + 2 = 5 = −(−5)/1, and 3 × 2 = 6 = 6/1.
Why the Discriminant Matters
The discriminant is the fastest diagnostic in all of algebra. Suppose a small business models its monthly profit as P = −0.02x² + 40x − 1000, where x is units sold. The break-even points are the roots of −0.02x² + 40x − 1000 = 0. D = 1600 − 4(−0.02)(−1000) = 1600 − 80 = 1520, a positive number, so there are two break-even quantities — a lower one and an upper one — and the profit is positive only between them. Without computing the roots you already know the business turns a profit over a continuous interval rather than for every sale.
When the discriminant is negative in a profit model, the parabola never crosses zero: either the business is always profitable or always losing money, depending on the sign of a. That single sign-flip tells management whether the problem is pricing or unit economics.
Real and Complex Roots
For equations like x² + 1 = 0 (a = 1, b = 0, c = 1), D = 0 − 4 = −4. The square root of −4 is 2i, so the roots are x = 0 ± 1i, written ±i. Complex roots always arrive as a conjugate pair a + bi and a − bi, which is why Vieta's sum (−b/a) is always a real number even when the roots themselves are not.
Examples
Example 1 — The textbook case. Solve x² − 5x + 6 = 0. Enter a = 1, b = −5, c = 6. The discriminant is 1, root type is "two distinct real roots," and the roots are 3 and 2. The factored form is (x − 3)(x − 2), and Vieta confirms the sum is 5 and the product is 6.
Example 2 — A break-even revenue problem. A café models its monthly profit as P = −0.01x² + 300x − $1,000,000, where x is cups of coffee sold per month and P is in dollars. Setting P = 0 gives a = −0.01, b = 300, c = −1,000,000. The discriminant is 90,000 − 16,000 = 74,000, so the two break-even points sit roughly at 3,918 and 26,082 cups per month. Between those volumes the café makes money; below the lower one it loses money, and above the upper one the rising marginal cost squeezes profit back below zero.
Example 3 — A repeated root. Solve x² − 4x + 4 = 0. a = 1, b = −4, c = 4. D = 16 − 16 = 0, so the single repeated root is x = 2, and the factored form collapses to (x − 2)².
Example 4 — A complex-root case. Solve x² + 1 = 0. a = 1, b = 0, c = 1. D = −4, so the roots are x = i and x = −i. The parabola y = x² + 1 never dips below y = 1, which matches the "no real roots" verdict.
Example 5 — A large-coefficient sanity check. With a = 1,000,000, b = 2,000,000, c = 1,000,000 the expression is (1,000x + 1,000)² = 0. D = 4×10¹² − 4×10¹² = 0 and the repeated root is x = −1, exactly as factoring by eye predicts.
FAQ
What is the quadratic formula?
The quadratic formula solves ax² + bx + c = 0 as x = (−b ± √(b² − 4ac)) / (2a). The ± sign produces two roots, one using the plus and one using the minus. It works for every quadratic equation, real or complex, as long as a is not zero.
What does the discriminant tell me?
The discriminant is D = b² − 4ac. If D > 0 there are two distinct real roots; if D = 0 there is one repeated real root; if D < 0 there are no real roots and instead two complex conjugate roots a ± bi. Checking D first lets you predict the shape of the answer before you compute the square root.
Can a be zero?
No. If a = 0, the x² term disappears and you are left with the linear equation bx + c = 0, which has the single solution x = −c/b. This calculator detects a = 0 and asks you to enter a non-zero leading coefficient; use a linear equation solver instead.
What are complex roots?
When the discriminant is negative, √D is imaginary. The roots come as a conjugate pair a + bi and a − bi, where i = √(−1). For example, x² + 1 = 0 has roots i and −i. The parabola never crosses the x-axis; the complex roots describe where it would cross in the complex plane.
How do I write a quadratic equation from its roots?
Use Vieta's formulas. If the roots are r1 and r2, then b = −a·(r1 + r2) and c = a·r1·r2. The monic equation (a = 1) is x² − (r1 + r2)x + (r1·r2) = 0. For roots 2 and 3 that is x² − 5x + 6 = 0.
What is the factored form?
If the roots are r1 and r2, the polynomial factors as a(x − r1)(x − r2). Setting each factor to zero recovers the roots. This is the fastest way to check your work: expand (x − r1)(x − r2) and confirm it reproduces the original ax² + bx + c.
Why do my roots come out swapped?
The "plus" root is always computed first: root1 = (−b + √D)/(2a). If a is negative the ordering flips. Addition and multiplication are commutative, so the two roots are mathematically interchangeable — the order on screen does not matter.
Disclaimer
This quadratic equation calculator is provided for informational purposes only and does not constitute mathematical, engineering, financial, or academic advice. Results are based on the standard quadratic formula and the coefficients you enter; rounding to a few decimal places may introduce small errors, and complex roots are reported with their real and imaginary parts separated. Always verify critical calculations by hand or with an independent tool before relying on them in homework, business, or engineering decisions.