Audited 25 May 2026·Last updated 27 Jul 2026·7 citations·Tier 1·0 uses

Quadratic Equation Solver

Free quadratic equation solver for ax² + bx + c = 0: real and complex roots, discriminant, vertex form, and worked steps using the quadratic formula.

Quadratic Equation Solver

The coefficient of the squared term. Cannot be zero — a zero leading coefficient collapses the equation to a linear one, bx + c = 0, which has at most one root.
The coefficient of the linear term. May be positive, negative, or zero. When b = 0 the equation is purely a difference (or sum) of a square and a constant, with roots symmetric about the origin.
The constant term — the value of the polynomial at x = 0, and also the product of its roots times a (Vieta's formula c/a = product of roots).
Root x₁
2
The first root of ax² + bx + c = 0. When the discriminant is positive this is the larger real root, (−b + √Δ) / 2a. When the discriminant is zero both roots collapse to −b/2a. When the discriminant is negative both roots become the same real part of a complex conjugate pair, and the imaginary magnitude appears below.
Root x₂
1
Discriminant (Δ = b² − 4ac)
1
Real part
2
Imaginary part
0

Background.

The Quanta quadratic equation solver finds every solution of ax² + bx + c = 0 — real or complex — using the standard quadratic formula x = (−b ± √(b² − 4ac)) / 2a, and shows the discriminant, vertex (real part), and imaginary magnitude alongside the two roots so you can read off the geometry of the parabola as well as its zeros. Quadratic equations are the second-simplest polynomial equations after linear ones, and they are arguably the single most-taught equation type in secondary mathematics worldwide, but their reach is much wider than algebra class suggests. The same formula that finds where a parabola crosses the x-axis also tells a physicist when a thrown ball lands, an optical engineer where to place a parabolic mirror's focal point, a finance analyst at what unit volume a product breaks even, a statistician where a regression's confidence ellipse intersects an axis, and a structural engineer how a parabolic arch distributes load.

The history of the solution stretches back four thousand years. Babylonian scribes on clay tablets from roughly 2000 BCE solved problems equivalent to quadratics using a geometric procedure called "completing the square" — they did not have algebraic notation, so the problems were posed as "I have added the area and the side of my square: 0;45" and solved by a recipe that, written in modern symbols, is exactly the quadratic formula. Around 300 BCE, Euclid's Elements treated quadratics geometrically in Book II using rectangles and gnomons. The Indian mathematician Brahmagupta gave the first general algebraic solution that explicitly admitted negative numbers in 628 CE. In 820 CE the Persian polymath Muhammad ibn Musa al-Khwarizmi — from whose name we get the word "algorithm" and from whose book Al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala we get the word "algebra" — gave a systematic classification of quadratic equations into six canonical types and a complete geometric proof of each solution. The fully general formula, including complex roots, in the symbolic form modern students learn was crystallised over the 16th and 17th centuries by Bombelli, Viète, and Descartes, and complex numbers themselves were finally given a rigorous footing by Gauss and Argand in the early 1800s.

The discriminant Δ = b² − 4ac is the single most useful diagnostic in the whole story: its sign tells you, without computing the roots at all, whether the parabola y = ax² + bx + c crosses the x-axis twice (Δ > 0), touches it at exactly one point (Δ = 0), or misses it entirely and floats above or below (Δ < 0). Those three cases correspond physically to a projectile that lands at two different times (going up and coming down), one that just grazes the ground at its peak, and one that never reaches the ground at all under the model.

This page walks you through the formula and three independent derivations of it (completing the square, the substitution x = y − b/2a, and Vieta's formulas), the four most common real-world applications, the numerical pitfalls (loss of significance when b is large and 4ac is small) that even production code gets wrong, the connection to the discriminant of higher-degree polynomials and to Galois theory, and a worked example you can step through yourself.

What is quadratic equation solver?

A quadratic equation is any polynomial equation of degree two — an equation in which the highest power of the unknown is exactly 2. In standard form it is written ax² + bx + c = 0 where a, b, c are real (or sometimes complex) coefficients and a is non-zero. The word "quadratic" comes from the Latin quadratum, meaning "square," because the leading term is a squared quantity; the equation describes the relationship between a quantity and its square. Every quadratic equation has exactly two roots when counted with multiplicity over the complex numbers — this is the simplest case of the Fundamental Theorem of Algebra (Gauss, 1799), which states that every degree-n polynomial has exactly n roots in the complex plane. The roots may be two distinct real numbers, one repeated real number (a "double root"), or a complex conjugate pair p ± qi where the imaginary parts cancel any non-real residue when the original coefficients are real. The graph of y = ax² + bx + c is a parabola — opening upward if a > 0, downward if a < 0 — whose vertex sits at x = −b/2a and whose roots are precisely the x-values where the parabola intersects the horizontal axis. The discriminant Δ = b² − 4ac classifies the three geometric cases at a glance: Δ > 0 means two crossings, Δ = 0 means tangency, and Δ < 0 means no real intersection. Quadratics are the bridge between linear equations (which are trivial to solve) and higher-degree polynomials (which become progressively harder — cubics and quartics have explicit formulas, but the Abel–Ruffini theorem proved in 1824 that no general algebraic formula exists for degree five or higher). They are also the simplest non-trivial dynamical system, the simplest non-trivial optimization problem, and the simplest non-trivial differential-equation solution — which is why they appear everywhere in physics and engineering.

How to use this calculator.

  1. Identify a, b, and c by writing your equation in standard form ax² + bx + c = 0. If your equation looks like 2x² = 5x − 3, rearrange it to 2x² − 5x + 3 = 0 first, so a = 2, b = −5, c = 3.
  2. Enter the three coefficients in the inputs above. The calculator updates in real time as you type — there is no submit button.
  3. Read the discriminant first. If Δ > 0 you will see two distinct real roots in root1 and root2. If Δ = 0 you will see a single repeated real root (root1 = root2). If Δ < 0 you will see a complex conjugate pair, with the same real part in both root fields and a non-zero imaginary magnitude.
  4. For complex roots, interpret the output as realPart + imaginaryPart·i and realPart − imaginaryPart·i — the two roots are mirror images across the real axis of the complex plane.
  5. Use the real part as a quick sanity check on the vertex of the parabola y = ax² + bx + c, which always sits at x = −b/2a regardless of whether the roots are real or complex. The vertex is the axis of symmetry; the two real roots, when they exist, are equidistant from it on either side.
  6. If you entered a = 0 the calculator will refuse to solve, because the equation is no longer quadratic — it has collapsed to the linear equation bx + c = 0, which the linear-equation solver handles instead.

The formula.

x = [ −b ± √(b² − 4ac) ] ⁄ 2a

The quadratic formula is x = (−b ± √(b² − 4ac)) / 2a. The expression under the square root, Δ = b² − 4ac, is the discriminant. There are three standard derivations of the formula worth knowing. Completing the square (al-Khwarizmi's method, 820 CE): start from ax² + bx + c = 0, divide through by a (allowed because a ≠ 0) to get x² + (b/a)x + (c/a) = 0, move the constant: x² + (b/a)x = −c/a, then add (b/2a)² to both sides to make the left a perfect square: x² + (b/a)x + (b/2a)² = (b/2a)² − c/a, which factors as (x + b/2a)² = (b² − 4ac) / 4a². Taking square roots gives x + b/2a = ±√(b² − 4ac) / 2a, and rearranging produces the formula. Substitution x = y − b/2a: this is Viète's trick — substitute to eliminate the linear term. ax² + bx + c becomes a(y − b/2a)² + b(y − b/2a) + c = ay² − by + b²/4a + by − b²/2a + c = ay² + c − b²/4a, so the depressed equation is y² = (b² − 4ac) / 4a², whose solutions y = ±√(b² − 4ac) / 2a give x = −b/2a ± √(b² − 4ac) / 2a directly. Vieta's formulas (sum-and-product): the two roots r₁ and r₂ satisfy r₁ + r₂ = −b/a and r₁ · r₂ = c/a, which together pin down both values once you know either sum or product alone is insufficient — but combined with the symmetry r₁,₂ = (sum ± √(sum² − 4·product)) / 2 you recover the formula. The discriminant's geometric meaning: Δ is, up to a factor of 4a², the squared difference of the two roots, (r₁ − r₂)² = Δ/a². So Δ > 0 forces r₁ ≠ r₂ (two crossings of the x-axis), Δ = 0 forces r₁ = r₂ (a double root, the parabola is tangent to the x-axis at its vertex), and Δ < 0 forces (r₁ − r₂)² < 0, which is impossible for real numbers — hence the roots must be a complex conjugate pair. A subtle numerical pitfall: when 4ac is much smaller than b², the subtraction b² − 4ac is fine, but the formula (−b ± √Δ) / 2a suffers catastrophic cancellation in whichever root has a numerator that is the difference of two nearly equal quantities. Production code (and the Quanta engine) avoids this by computing the well-conditioned root first using the sign of b, then deriving the second root from Vieta's product r₁·r₂ = c/a. The result is identical in exact arithmetic but several orders of magnitude more accurate in floating point.

A worked example.

Example

Solve x² − 3x + 2 = 0. Here a = 1, b = −3, c = 2. Compute the discriminant first: Δ = b² − 4ac = (−3)² − 4·1·2 = 9 − 8 = 1. Because Δ > 0 there are two distinct real roots. Plug into the formula: x = (−(−3) ± √1) / (2·1) = (3 ± 1) / 2, giving root1 = (3 + 1)/2 = 2 and root2 = (3 − 1)/2 = 1. The real part is −b/2a = 3/2 = 1.5, the axis of symmetry of the parabola, which sits exactly halfway between the two roots. The imaginary part is 0. Verification by Vieta's formulas: the sum of the roots is 2 + 1 = 3, which matches −b/a = 3; the product is 2 × 1 = 2, which matches c/a = 2. You can also verify by factoring: x² − 3x + 2 = (x − 1)(x − 2), which is zero exactly when x = 1 or x = 2. Now change c to 5 and re-solve x² − 3x + 5 = 0. The discriminant becomes 9 − 20 = −11, which is negative, so the roots are complex. The real part stays at 3/2 = 1.5, the imaginary part is √11 / 2 ≈ 1.658, and the two roots are 1.5 + 1.658i and 1.5 − 1.658i — a complex conjugate pair, as required for a polynomial with real coefficients.

a1
b-3
c2

Frequently asked questions.

What is the quadratic formula?
The quadratic formula is x = (−b ± √(b² − 4ac)) / 2a. It gives the two solutions of any quadratic equation written in standard form ax² + bx + c = 0, where a, b, c are known coefficients and a ≠ 0. The ± sign produces two roots: one using addition (typically the larger root) and one using subtraction. The expression b² − 4ac inside the square root is called the discriminant, and its sign tells you whether the roots are real and distinct (positive), real and repeated (zero), or a complex conjugate pair (negative). The formula was put into its modern symbolic form during the European algebraic revolution of the 16th and 17th centuries, but the underlying method — completing the square — was used by Babylonian scribes around 2000 BCE and given a systematic algebraic treatment by al-Khwarizmi in 820 CE.
What is the discriminant of a quadratic equation?
The discriminant is Δ = b² − 4ac, the expression under the square root in the quadratic formula. It tells you what kind of roots a quadratic has without forcing you to compute them. If Δ > 0, the equation has two distinct real roots and the parabola crosses the x-axis at two different points. If Δ = 0, the equation has one repeated real root (a double root) and the parabola is tangent to the x-axis at its vertex. If Δ < 0, the equation has no real roots — instead it has two complex conjugate roots of the form p + qi and p − qi, and the parabola lies entirely above or entirely below the x-axis. The same quantity, up to a factor of 4a², equals the squared difference of the roots (r₁ − r₂)² = Δ/a², which is why a zero discriminant produces equal roots and a negative discriminant forces non-real roots.
What does it mean when a quadratic has complex roots?
A quadratic with real coefficients has complex roots whenever the discriminant b² − 4ac is negative. The roots come in a conjugate pair: if one root is p + qi (where i = √(−1) and p, q are real), the other root is automatically p − qi. Geometrically this means the parabola y = ax² + bx + c never crosses the x-axis — it either floats entirely above it (if a > 0 and the vertex's y-coordinate is positive) or hangs entirely below it (if a < 0 and the vertex's y-coordinate is negative). Physically, complex roots often signal that the model has no solution under the assumed conditions: a projectile that never reaches a certain height, a circuit that has no resonant frequency under a given damping, a business that breaks even at no positive volume. Complex numbers were viewed with suspicion for centuries — Cardano in 1545 called them "as subtle as they are useless," Descartes coined the dismissive term "imaginary" in 1637 — and only became respectable mathematics after Gauss, Argand, and Wessel gave them a geometric interpretation in the complex plane around 1800.
Who invented the quadratic formula?
There is no single inventor. The Babylonians solved problems equivalent to quadratic equations using geometric "completing the square" methods on clay tablets dating to around 2000 BCE — they did not write the formula symbolically because they had no symbolic algebra, but their procedural recipe is mathematically identical to the modern formula. Around 300 BCE, Euclid's Elements treated quadratic relationships geometrically using rectangles and gnomons. The Indian mathematician Brahmagupta gave the first general algebraic solution that accepted negative numbers in his Brahmasphutasiddhanta in 628 CE. In 820 CE the Persian polymath Muhammad ibn Musa al-Khwarizmi, working at the House of Wisdom in Baghdad, published Al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala ("The Compendious Book on Calculation by Completion and Balancing"), which gave a systematic classification of quadratic equations into six standard forms and a complete geometric proof of each solution; from this book's title we get the word "algebra," and from his name we get the word "algorithm." The fully general symbolic formula that students learn today was crystallised over the 1500s and 1600s by European algebraists including Bombelli (who first worked seriously with complex numbers), Viète (who introduced symbolic variables), and Descartes (who standardised the notation we still use).
How do I solve a quadratic equation by factoring instead of by formula?
If the roots happen to be rational, the quadratic factors as a(x − r₁)(x − r₂), and you can sometimes spot the factorisation by inspection. The trick is to find two numbers that multiply to a·c and add to b. For x² − 5x + 6 = 0, two numbers that multiply to 6 and add to −5 are −2 and −3, so the equation factors as (x − 2)(x − 3) = 0, giving roots x = 2 and x = 3. Factoring is faster than the formula when it works, but it only works when the discriminant is a perfect square (and ideally a small one) — otherwise the roots are irrational and there is no clean factorisation over the integers. Vieta's formulas formalise this: the sum of the roots equals −b/a and the product equals c/a, so factoring is just guess-and-check informed by those two constraints. When factoring fails, the quadratic formula always succeeds.
Why does the quadratic formula sometimes give wrong answers in a spreadsheet?
Floating-point cancellation. When b² is much larger than 4ac, the expression −b + √(b² − 4ac) becomes the difference of two nearly equal numbers (if b > 0) or the sum of two same-sign numbers (if b < 0). The subtraction loses significant digits — a phenomenon called "catastrophic cancellation." For example, with a = 1, b = 100000, c = 1, the naive formula gives one root that is wildly inaccurate because 100000 and √(100000² − 4) are nearly indistinguishable in 64-bit floating point. The fix, used by every well-written numerical library and by the Quanta engine, is to compute the well-conditioned root first — pick the sign that makes the numerator a sum of same-sign numbers — and then derive the other root using Vieta's product, r₂ = c / (a · r₁). The two roots are mathematically equivalent expressions, but numerically the Vieta-derived second root is far more accurate. This is one of the canonical examples in introductory numerical-analysis courses (see Press et al., Numerical Recipes, §5.6).
Where do quadratic equations show up in real life?
Constantly. Projectile motion: the height of an object thrown straight up at velocity v₀ from height h₀ is y(t) = h₀ + v₀t − ½gt², a quadratic in t whose roots are the times it leaves and reaches the ground. Optics: a parabolic mirror or satellite-dish reflector focuses all incoming parallel rays through a single focal point because its cross-section satisfies a quadratic equation, and finding the focal length means finding the vertex of that parabola. Finance: break-even analysis — when fixed costs F, variable cost v, and price p combine into a profit function that includes a quadratic demand term, the break-even units are the roots of a quadratic in volume. Engineering: the moment-of-area calculations for a parabolic arch, the deflection of a simply-supported beam under uniformly distributed load, and the trajectory of a thrown ball or a shell all reduce to quadratic equations. Statistics: the roots of the characteristic polynomial of a 2×2 covariance matrix — the eigenvalues — are the solutions of a quadratic, and they define the major and minor axes of a confidence ellipse. Computer graphics: ray-sphere intersection tests, which are at the heart of every ray tracer, reduce to solving a quadratic for the parameter t along the ray.
What is the relationship between the roots of a quadratic and its graph?
The roots of ax² + bx + c = 0 are exactly the x-intercepts of the parabola y = ax² + bx + c — the points where the curve crosses the horizontal axis. The vertex of the parabola sits at x = −b/2a (the real part output by this calculator), and the parabola is symmetric about the vertical line through the vertex. When the discriminant is positive, the two real roots are equidistant from the vertex on either side, spaced by √Δ / |a|. When the discriminant is zero, the parabola touches the x-axis at a single point — the vertex itself is the double root. When the discriminant is negative, the parabola does not touch the x-axis at all and the roots are complex; the real part of the complex roots still equals the vertex's x-coordinate, but the imaginary part measures (in a precise sense involving analytic continuation into the complex plane) the vertical distance from the vertex down to the axis.
Can a quadratic equation have only one solution?
Yes — when the discriminant is exactly zero. In that case the quadratic formula collapses to x = −b/2a, a single value that is technically a "double root" or "root of multiplicity two." Counted with multiplicity it is still two roots, so the Fundamental Theorem of Algebra is satisfied; counted as distinct values it is one. Geometrically this is the case where the parabola y = ax² + bx + c is tangent to the x-axis at its vertex — the curve touches the axis but does not cross it. The classic example is x² − 4x + 4 = 0, whose discriminant is 16 − 16 = 0 and whose only root is x = 2. The polynomial factors as (x − 2)², which is why the root is repeated: it appears twice in the factorisation. Physically, double roots show up in critically damped oscillators, in projectile motion problems where the object just barely reaches a target height, and in optimisation problems at the boundary between feasible and infeasible.
Why can't a be zero in the quadratic formula?
Because if a = 0 the equation is no longer quadratic — it is linear, bx + c = 0, with a single solution x = −c/b (assuming b ≠ 0) or no solution at all (if b = 0 and c ≠ 0) or infinitely many solutions (if both b and c are zero). The quadratic formula has 2a in the denominator, so dividing by zero is the immediate symptom; the deeper reason is that the formula is derived under the assumption that you can divide through by a in the first step of completing the square. The Quanta solver rejects a = 0 with an explicit error message rather than returning ∞ or NaN, so you know to switch to a linear solver. If you have an equation that sometimes has a = 0 (for example, a coefficient that depends on another variable and can vanish), the well-behaved generalisation is to write the equation as a polynomial of the appropriate degree and solve it with the matching tool — never paper over the singularity by ignoring it.

References& sources.

  1. [1]Abramowitz, M. and Stegun, I. A. (eds.) Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. National Bureau of Standards Applied Mathematics Series 55, 1964 — §3.8.1 gives the quadratic formula and the numerically stable variant used to avoid catastrophic cancellation.
  2. [2]al-Khwarizmi, Muhammad ibn Musa. Al-Kitab al-mukhtasar fi hisab al-jabr wa'l-muqabala ("The Compendious Book on Calculation by Completion and Balancing"), Baghdad, c. 820 CE — the first systematic algebraic treatment of quadratic equations, classifying them into six canonical types and proving each solution geometrically. (Rosen translation, 1831.)
  3. [3]Euclid, Elements, Book II, Propositions 5–6 and Book VI, Proposition 28 — geometric treatment of quadratic relationships using rectangles, gnomons, and area equivalences, written c. 300 BCE. (Heath translation, Cambridge University Press, 1908.)
  4. [4]Coxeter, H. S. M. Introduction to Geometry, 2nd edition. Wiley, 1969 — classical-geometry reference covering parabolas, the discriminant's geometric meaning, and the relationship between the roots of a quadratic and the axis of symmetry.
  5. [5]NIST Digital Library of Mathematical Functions, §1.11 — Zeros of Polynomials. Definitive modern reference for root-finding formulae, discriminants, and Vieta's formulas, including numerically stable evaluation strategies for the quadratic case.
  6. [6]Katz, Victor J. A History of Mathematics: An Introduction, 3rd edition. Pearson, 2008 — peer-reviewed historical survey covering the development of the quadratic formula from Babylonian tablets (c. 2000 BCE) through Brahmagupta (628 CE), al-Khwarizmi (820 CE), Bombelli, and Viète.
  7. [7]Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P. Numerical Recipes: The Art of Scientific Computing, 3rd edition. Cambridge University Press, 2007 — §5.6 ("Quadratic and Cubic Equations") documents the catastrophic-cancellation pitfall in the naive quadratic formula and the standard Vieta-product workaround.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon