Quadratic Formula Calculator

Solves the quadratic equation ax² + bx + c = 0 with the quadratic formula x = (−b ± √(b² − 4ac)) ÷ 2a. From the three coefficient inputs a, b and c it returns two distinct real roots, one repeated root, or a complex conjugate pair, along with the discriminant b² − 4ac and the vertex of the parabola at x = −b/2a. The formula is evaluated in its numerically stable rearrangement, q = −(b + sign(b)√(b² − 4ac)) ÷ 2 with the roots taken as q/a and c/q, so the smaller root keeps its digits when b² dwarfs 4ac. When a is 0 it reports the single linear solution x = −c/b.

Solutions
Discriminant
Vertex

Enter the three coefficients of ax² + bx + c = 0 and the calculator returns the solutions, the discriminant, and the vertex of the parabola. It covers every case the formula can produce — two distinct real roots, one repeated root, or a complex conjugate pair — and if you set a to 0 it tells you the equation is linear and hands you the single solution x = −c/b instead.

How the formula works

x = ( −b ± √(b2 − 4ac) ) ÷ 2a

The formula is what completing the square on the general quadratic produces, so it solves every equation of this shape with no special cases. Divide through by a, move the constant across, add (b/2a)² to both sides so the left side becomes a perfect square, then take the root of each side. The ± appears because a square root has two signs. The expression under the root, b² − 4ac, is the discriminant, written D below and Δ in many European textbooks. The −b ÷ 2a part in front of the ± is the x-coordinate of the vertex, which is why the two roots always sit symmetrically around it.

Two practical points are worth knowing. The first is display: every root rounds to six decimal places, real and complex parts alike, and a root smaller than that prints in exponential form, as -1e-8 rather than a rounded-away 0. The second is that the calculator does not evaluate the formula in the arrangement printed above, because that arrangement fails. When b² dwarfs 4ac the square root comes out almost exactly equal to the size of b, so one of the two numerators is a subtraction of near-equal numbers and the smaller root loses every significant digit it had. For x² + 10⁸x + 1 = 0 the textbook arrangement returns 0, and 0 is not a root: substituting it leaves y = c = 1. What this calculator computes instead is q = −(b + sign(b)√D) ÷ 2, with the sign of 0 counted as positive — an addition of two numbers that always carry the same sign, so nothing cancels — and then reads the roots off as q/a and c/q, the second of those following from the fact that the two roots multiply to c/a. For that equation it returns -1e-8 and -100000000, which match the true roots −1.0000000000000001e-8 and −99999999.99999999 to sixteen significant figures. Double precision still sets a floor. The discriminant is itself a subtraction, so coefficients whose b² and 4ac agree to sixteen digits get reported as a repeated root when the true roots are merely very close, and coefficients large enough for b² to overflow are rejected rather than answered.

A problem people have solved for four thousand years

The quadratic is one of the oldest problems in mathematics that still looks the same today. Old Babylonian clay tablets from around 2000 BC record a step-by-step recipe for finding the side of a rectangle from its area and its semi-perimeter: halve a number, square it, subtract a known value, take a square root, and recombine. Written in modern symbols that recipe is the quadratic formula, though the scribes worked without symbols and accepted only positive answers. An Egyptian document, Berlin Papyrus 6619 from the Middle Kingdom — roughly 2050 to 1650 BC — carries a two-term quadratic of its own: divide a square of area 100 into two squares whose sides stand in the ratio 3 to 4, which comes out at 6 and 8.

Greek mathematicians recast the problem as geometry. Euclid, around 300 BC, set out an abstract construction for these lengths in the Elements, and Apollonius of Perga, born around 240 BC, gave the parabola its name, borrowed from the Greek word for application because the construction fits an area exactly onto a given line. That curve is the graph of y = ax² + bx + c. Diophantus, in the Arithmetica around 250 AD, worked far closer to algebra than to Euclid's geometry, yet he reported only a single root even when two positive ones existed.

The first explicit general rule came from India. In 628 AD the astronomer Brahmagupta, in the Brāhmasphuṭasiddhānta, described in words a procedure equivalent to the modern formula. Unusually for his time he also treated zero and negative numbers as legitimate quantities in the same work, which is what let one rule cover cases the Greeks had kept apart. Around 820 AD, working in Baghdad, Muḥammad ibn Mūsā al-Khwārizmī laid out the method of completing the square in a treatise whose title gives us the word algebra, from al-jabr, the restoring or reunion of broken parts. He still split quadratics into six separate types so that every coefficient stayed positive, and he justified each rule with a geometric construction. A generation later Abū Kāmil accepted irrational quantities as coefficients and as answers, which widened the formula's reach, though negative roots stayed outside the tradition and had to wait for Europe.

The full solution reached Europe through Abraham bar Hiyya, a twelfth-century scholar in Spain also known as Savasorda, whose book was the first there to include the general quadratic solution. Symbolic algebra then caught up with the ideas. The Flemish mathematician Simon Stevin gave the first version covering all cases in 1594, and René Descartes published the formula in notation close to ours in La Géométrie in 1637. The name for the quantity that governs the whole thing arrived last: the British mathematician James Joseph Sylvester coined the term discriminant in 1851, in a paper on canonical forms and hyperdeterminants. Before that it had usually been called the determinant of the function, following Gauss.

What the discriminant decides

Discriminant Solutions Graph of y = ax² + bx + c
D > 0 two distinct real roots crosses the x-axis twice
D = 0 one repeated root touches the axis at the vertex
D < 0 complex pair p ± qi never reaches the axis

There is one more reading. If the coefficients are integers and D is a perfect square, the roots are rational and the quadratic factors over the integers. D = 25 factors; D = 24 does not. That single number decides the branch before you ever take a square root, which is why the calculator computes it first and reports it alongside the roots.

The default equation, worked by hand

Take 2x² − 7x + 3 = 0, the values loaded when the page opens.

  1. D = (−7)² − 4 × 2 × 3 = 49 − 24 = 25
  2. √25 = 5
  3. x = (7 ± 5) ÷ 4, so x = 12 ÷ 4 = 3 or x = 2 ÷ 4 = 0.5

Because 25 is a perfect square, the equation also factors: (2x − 1)(x − 3) = 2x² − 6x − x + 3 = 2x² − 7x + 3, and setting each bracket to zero recovers x = 0.5 and x = 3. The vertex lands at x = 7 ÷ 4 = 1.75, halfway between the roots, with y = 2(1.75)² − 7(1.75) + 3 = −3.125 — the point (1.75, −3.125) in the results.

Where the same shape turns up

A parabola is the path of anything thrown or fired under gravity when air resistance is ignored, so quadratics answer how long a ball stays up and how far it travels. Setting the height equation to zero to find where the object lands is the discriminant test in disguise: a negative discriminant means the object never reaches that height at all. The same shape sizes a rectangle from its area and perimeter, finds the break-even points where a cost line meets a revenue curve, and appears wherever one quantity depends on the square of another — kinetic energy against speed, braking distance against speed, the area of a circle against its radius. Problems that ask for a largest or smallest value lean on the vertex, since −b/2a marks the single highest or lowest point a quadratic can reach.

The same formula, different classrooms

American students meet this in Algebra 1. Canadian provinces name their courses differently — Ontario introduces quadratics and this formula in the Grade 10 course Principles of Mathematics. UK students reach it at GCSE, on the Higher tier, and Australian students in Year 10. British candidates once had to hold the formula in their heads, but Ofqual has put a formulae sheet inside every GCSE maths paper for the 2025, 2026 and 2027 exam series, and the quadratic formula is printed on the Higher tier sheet. French textbooks build the topic around Δ, computing it first and branching on its sign exactly as this calculator does. German schools teach the Mitternachtsformel — the midnight formula, so called because you should be able to recite it if woken at midnight — alongside the shorter p-q formula x = −p/2 ± √((p/2)² − q) for equations already divided through by a. All are algebraically identical.

Frequently asked questions

What does the discriminant tell you about a quadratic equation?

The discriminant b² − 4ac settles how many real solutions exist before you take a single square root. A positive value means two distinct real roots, zero means one repeated root, and a negative value means a pair of complex conjugates. For the default equation 2x² − 7x + 3 = 0 the discriminant is 49 − 24 = 25, so there are two real roots.

What happens if a is 0 in the quadratic formula?

The formula collapses, because dividing by 2a becomes dividing by zero. With a = 0 the equation bx + c = 0 is linear and has the single solution x = −c/b, so 4x − 2 = 0 gives x = 0.5. This calculator reports exactly that instead of returning nonsense.

How do you know if a quadratic can be factored over the integers?

Check whether the discriminant is a perfect square. For 2x² − 7x + 3 it is 25, which is why the equation factors neatly as (2x − 1)(x − 3). When the discriminant is something like 5 or 13, the roots are irrational and no integer factoring exists.

Can the quadratic formula give complex or imaginary answers?

Yes, whenever the discriminant is negative the square root produces an imaginary number. For x² + 2x + 5 = 0 the discriminant is 4 − 20 = −16, so the roots are −1 ± 2i. Complex roots always arrive as a conjugate pair when a, b and c are real.

Why does the textbook formula go wrong for very large coefficients?

Because −b + √(b² − 4ac) subtracts two nearly equal numbers whenever b² dwarfs 4ac. For x² + 10⁸x + 1 = 0 the root is about −0.00000001, and evaluating the formula as written in double precision loses every digit of it and reports 0 instead, which is not a root at all. This calculator uses the equivalent stable form, q = −(b + sign(b)√(b² − 4ac)) ÷ 2 with roots q/a and c/q, and returns -1e-8 and -100000000.

Is the vertex the same as the minimum of a parabola?

It is the minimum when a is positive and the maximum when a is negative. The vertex sits at x = −b/2a, exactly halfway between the two roots whenever real roots exist. For 2x² − 7x + 3 that is x = 1.75 with y = −3.125, the lowest point on the curve.