Math

Quadratic Equation Solver

Solve ax² + bx + c = 0 and see the roots and discriminant.

Solve any quadratic equation ax² + bx + c = 0 by entering the coefficients a, b, and c. The solver shows both roots (or the double root), plus the discriminant so you can see at a glance whether the roots are real.

Introduction

A quadratic equation has the form ax^2 + bx + c = 0, where a is not zero. Its solutions — the x values that make the equation true — are the points where the parabola y = ax^2 + bx + c crosses the x-axis. The quadratic formula, x = (-b +/- sqrt(b^2 - 4ac)) / 2a, always finds them. The part under the square root, b^2 - 4ac, is called the discriminant, and it tells you in advance what to expect: a positive discriminant means two distinct real solutions (the parabola crosses twice), zero means one repeated solution (it just touches the axis), and a negative discriminant means no real solutions (it never reaches the axis — the solutions are complex numbers). Quadratics model anything with acceleration or area: projectile motion, profit maximization, and the shape of satellite dishes.

Before reaching for the formula, check whether the equation factors — x^2 - 5x + 6 = (x - 2)(x - 3) is faster by hand, and factoring builds number sense. Completing the square is the third method and the one that actually derives the formula. The formula itself is the fallback that never fails, including when the roots are fractions or irrational numbers that no factoring attempt would find. The common errors are sign slips on -b (if b is -5, then -b is +5), forgetting to divide the entire numerator by 2a rather than just the square-root term, and miscalculating the discriminant — so write each step out in full.

How it's calculated

Roots come from the quadratic formula x = (−b ± √(b²−4ac)) / 2a. The discriminant b²−4ac tells the story: positive means two real roots, zero means one double root, negative means no real roots.

Worked examples

x^2 - 5x + 6 = 0

Here a = 1, b = -5, c = 6. Discriminant: b^2 - 4ac = 25 - 24 = 1 — positive, so two real solutions. Apply the formula: x = (5 +/- sqrt(1)) / 2 = (5 +/- 1) / 2, giving x = 6/2 = 3 and x = 4/2 = 2. Verify by substitution: 3^2 - 5(3) + 6 = 9 - 15 + 6 = 0, and 2^2 - 5(2) + 6 = 4 - 10 + 6 = 0. Both work. Factoring check: (x - 2)(x - 3) expands to x^2 - 5x + 6 — consistent.

x^2 + 4x + 4 = 0

Here a = 1, b = 4, c = 4. Discriminant: 16 - 16 = 0, so exactly one repeated solution. x = -4 / 2 = -2. Verify: (-2)^2 + 4(-2) + 4 = 4 - 8 + 4 = 0. The parabola y = x^2 + 4x + 4 just touches the x-axis at x = -2 — it never crosses. This is (x + 2)^2 = 0 in disguise, a perfect square trinomial, which is always the case when the discriminant is zero.

Frequently asked questions

How do I solve x² − 5x + 6 = 0?

Enter a=1, b=−5, c=6. The roots are x = 2 and x = 3, because (x−2)(x−3) expands to x² − 5x + 6.

What does the discriminant tell me?

The discriminant b²−4ac predicts the roots before you compute them: if it's positive there are two real roots, if zero there's one repeated root, and if negative there are no real roots.

What if a is zero?

Then it's not quadratic — it's the linear equation bx + c = 0, and the solver gives the single root x = −c/b.

Related calculators

References