Quadratic Equation Solver

Solve ax² + bx + c = 0 with real or complex roots, the discriminant and the vertex of the parabola.

Enter the values to see the result here.

Formula

For ax2+bx+c=0ax^2 + bx + c = 0 with a≠0a \ne 0, the discriminant is Δ=b2−4ac\Delta = b^2 - 4ac and

x=−b±Δ2ax = \frac{-b \pm \sqrt{\Delta}}{2a}

If Δ<0\Delta < 0, the roots are −b2a±−Δ2∣a∣ i-\dfrac{b}{2a} \pm \dfrac{\sqrt{-\Delta}}{2|a|}\,i. The vertex of the parabola is at

(−b2a, c−b24a)\left(-\frac{b}{2a},\ c - \frac{b^2}{4a}\right)

and the roots satisfy x1+x2=−b/ax_1 + x_2 = -b/a and x1x2=c/ax_1 x_2 = c/a.

Worked example

Solve x2−5x+6=0x^2 - 5x + 6 = 0.

  • a=1a = 1, b=−5b = -5, c=6c = 6, so Δ=25−24=1\Delta = 25 - 24 = 1.
  • x=5±12x = \dfrac{5 \pm 1}{2}, giving x1=2x_1 = 2 and x2=3x_2 = 3.
  • Check: sum is 5=−b/a5 = -b/a and product is 6=c/a6 = c/a.
  • Vertex: x=2.5x = 2.5, y=6−25/4=−0.25y = 6 - 25/4 = -0.25.

For x2+2x+5=0x^2 + 2x + 5 = 0 the discriminant is 4−20=−164 - 20 = -16, so x=−1±2ix = -1 \pm 2i.

Common mistakes

  • Forgetting the sign of bb: with b=−5b = -5, the formula starts with −b=+5-b = +5.
  • Dividing only part of the numerator by 2a2a.
  • Treating a negative discriminant as “no solution”. There are no real solutions, but there are two complex ones.
  • Entering the equation not in standard form. Move every term to one side so the right side is zero.

Frequently asked questions

What does the discriminant tell me?

Its sign decides the roots. Positive gives two different real roots, zero gives one repeated root where the parabola just touches the x-axis, and negative gives two complex roots with no x-axis crossing.

What are complex roots?

When Δ is negative the square root is imaginary, so the roots are a ± bi with i² = −1. They always come as a conjugate pair, and the graph never reaches the x-axis.

What if a is zero?

Then there is no x² term and the equation is linear, bx + c = 0, with the single solution x = −c/b. The tool switches to that automatically.

Why not just use the textbook formula?

When b is large and ac is small, one root of the textbook formula subtracts two nearly equal numbers and loses digits. The tool computes the larger root first and gets the other from c/(a·x₁), which keeps full precision.

Related calculators