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
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.
- 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.
- Enter the three coefficients in the inputs above. The calculator updates in real time as you type — there is no submit button.
- 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.
- 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.
- 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.
- 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.
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.
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.
Frequently asked questions.
What is the quadratic formula?
What is the discriminant of a quadratic equation?
What does it mean when a quadratic has complex roots?
Who invented the quadratic formula?
How do I solve a quadratic equation by factoring instead of by formula?
Why does the quadratic formula sometimes give wrong answers in a spreadsheet?
Where do quadratic equations show up in real life?
What is the relationship between the roots of a quadratic and its graph?
Can a quadratic equation have only one solution?
Why can't a be zero in the quadratic formula?
References& sources.
- [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]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]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]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]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]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]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