Skip to content

Quadratic Equation Solver

Enter a, b and c to solve ax² + bx + c = 0. You get the roots (real or complex, exact where possible), what the discriminant tells you, the vertex and axis of the parabola, the factored form and the quadratic formula worked through with your numbers, which a general scientific calculator does not show.

Solves ax² + bx + c = 0. Type a minus sign or use ± for negative numbers. If a is 0 the equation is linear and is solved as bx + c = 0.

Result

Solutions of 2x² − 3x − 2 = 0

x₁ = −1/2, x₂ = 2

As decimals: −0.5, 2

Discriminant b² − 4acPositive: two different real roots
25
Factored form
(2x + 1)(x − 2)
Vertex (h, k)
(0.75, −3.125)
Axis of symmetry
x = 0.75
y-intercept
(0, −2)
Parabola opens
Upward (a > 0), vertex is the minimum
Show the working
  1. Discriminantb² − 4ac = (−3)² − 4 × 2 × (−2) = 25
  2. Square root of the discriminant√25 = 5
  3. Quadratic formula x = (−b ± √D) ÷ 2a(−b ± √D) ÷ 2a = (3 ± 5) ÷ 4
  4. Root with +(3 + 5) ÷ 4 = 2
  5. Root with −(3 − 5) ÷ 4 = −1/2
  6. Vertex x (axis of symmetry)h = −b ÷ 2a = 3 ÷ 4 = 0.75
  7. Vertex yk = c − b² ÷ 4a = −2 − (−3)² ÷ 8 = −3.125

Rational roots are exact; others are rounded to about 10 digits. The discriminant is computed exactly from the numbers you typed, and irrational roots use a rearranged formula that stays accurate when b² is much larger than 4ac.

How the solver works

A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its solutions, called roots, are the x-values where the parabola y = ax² + bx + c crosses the x-axis. The solver reads your a, b and c and returns:

  • the discriminant D = b² − 4ac and what its sign means;
  • the roots: as exact fractions when they are rational, in simplified square-root form and as decimals when they are not, or as a complex pair p ± qi when D is negative;
  • the vertex (turning point), the axis of symmetry and the y-intercept;
  • the factored form whenever the roots are rational, such as (2x + 1)(x − 2);
  • each step of the quadratic formula with your numbers filled in, and a small sketch of the parabola.

Decimal coefficients are taken exactly as typed, so 0.1 means one tenth, not the nearest binary fraction. If a is 0 the equation has no x² term; the solver says so and solves the linear equation bx + c = 0 instead.

The quadratic formula and the discriminant

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

a, b, c
the coefficients of x², x and the constant term
D = b² − 4ac
the discriminant
±
one root uses +, the other −

The discriminant decides what kind of roots there are:

  • D > 0: two different real roots. If D is a perfect square (of a rational number) they are rational and the quadratic factors neatly.
  • D = 0: one repeated root, x = −b ÷ 2a. The parabola just touches the x-axis at its vertex.
  • D < 0: no real roots. The square root of a negative number is imaginary (√−1 = i), so the roots are the complex pair −b/2a ± (√|D|/2a)i. The parabola never meets the x-axis.

The vertex sits halfway between the roots, at h = −b ÷ 2a, and its height is k = c − b² ÷ 4a. The vertical line x = h is the axis of symmetry, and the curve crosses the y-axis at (0, c).

Accuracy. When b² is much larger than 4ac, √D is almost equal to |b|, and the root that computes −b + √D (or −b − √D when b is negative) subtracts two nearly equal numbers, losing most of its digits. The solver computes the root of larger size first as q ÷ a, with q = −½(b + sign(b)·√D), and the other as c ÷ q, which is algebraically the same but has no such subtraction. For x² + 100,000,000x + 1 = 0 the textbook formula in ordinary double-precision arithmetic gives the small root about 25% wrong; the rearranged one gives −0.00000001 to full precision.

Worked example: 2x² − 3x − 2 = 0

Here a = 2, b = −3 and c = −2.

  1. Discriminant: D = (−3)² − 4 × 2 × (−2) = 9 + 16 = 25. It is positive, so there are two real roots.
  2. √25 = 5, a whole number, so the roots are rational.
  3. x = (3 ± 5) ÷ 4, so x₁ = (3 − 5) ÷ 4 = −1/2 and x₂ = (3 + 5) ÷ 4 = 2.
  4. Factored form: each root p/q gives a factor (qx − p), so 2x² − 3x − 2 = (2x + 1)(x − 2). Multiply it out to check: 2x² − 4x + x − 2.
  5. Vertex: h = 3 ÷ 4 = 0.75 and k = −2 − 9 ÷ 8 = −3.125, so the lowest point of the parabola is (0.75, −3.125). The y-intercept is (0, −2).

Irrational roots. For x² − 2x − 1 = 0, D = 4 + 4 = 8 = 2² × 2, so x = (2 ± 2√2) ÷ 2 = 1 ± √2, about −0.4142135624 and 2.4142135624.

Complex roots. For x² + 2x + 5 = 0, D = 4 − 20 = −16 and √−16 = 4i, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

Tips and common mistakes

  • Move everything to one side first. For 3x² = 5x − 2, rewrite it as 3x² − 5x + 2 = 0 before reading off a = 3, b = −5, c = 2.
  • Keep the signs. The most common slip is squaring a negative b without brackets: (−3)² is 9, not −9.
  • Divide by 2a, not just 2. The whole numerator −b ± √D is divided by 2a.
  • Check with the roots. The two roots always add up to −b ÷ a and multiply to c ÷ a. For the example: −1/2 + 2 = 3/2 and −1/2 × 2 = −1 = −2 ÷ 2.
  • Fractions in the answer can be worked with in the fraction calculator, and powers, roots and other functions in the scientific calculator.

Limits

Coefficients can be any numbers from −10¹⁵ to 10¹⁵, including decimals. Irrational roots are shown to about 10 digits, and their simplified square-root form is given when the discriminant, scaled to whole numbers, is below about 9 × 10¹⁵; above that only the decimals are shown. The sketch of the parabola is a rough picture for orientation, not a scaled graph.

Frequently asked questions

What does the discriminant tell you?

Its sign gives the number of real roots. Positive: two real roots; zero: one repeated root; negative: no real roots, only a pair of complex roots. If it is a perfect square, the roots are rational and the quadratic factors over the integers or fractions.

What happens if a is 0?

Then there is no x² term and the equation is linear, bx + c = 0, with the single solution x = −c ÷ b. The solver tells you this and solves it that way. If b is also 0 there is either no solution or every x works.

How do I write complex roots?

As p ± qi, where p = −b ÷ 2a is the real part, q = √|D| ÷ |2a| is the imaginary part and i is the square root of −1. For x² + 2x + 5 = 0 the roots are −1 + 2i and −1 − 2i.

How do I find the vertex of a parabola?

The x-coordinate is h = −b ÷ 2a and the y-coordinate is k = c − b² ÷ 4a (or just plug h into the equation). For y = 2x² − 3x − 2 the vertex is (0.75, −3.125).

When can a quadratic be factored?

Over the rational numbers, exactly when the discriminant is a perfect square of a rational number, which makes both roots rational. Each root p/q then gives a factor (qx − p), as in 2x² − 3x − 2 = (2x + 1)(x − 2).

Sources

Last reviewed September 19, 2026