Math

How to Solve a Quadratic Equation: Formula, Discriminant, and Examples

Learn the quadratic formula, how the discriminant shows real or complex roots, and solve equations step by step with examples.

Numveta EditorialPublished Oct 6, 2026Updated Oct 6, 2026

The quadratic formula

For an equation in the form ax² + bx + c = 0, where a is not zero:

  • x = (-b ± √(b² - 4ac)) / (2a)
  • The expression b² - 4ac is called the discriminant, often written D.

What the discriminant tells you

Checking D first tells you what kind of answer to expect.

DiscriminantRoots
D > 0Two different real roots
D = 0One repeated real root
D < 0Two complex roots

Example 1: x² - 5x + 6 = 0

Here a = 1, b = -5, and c = 6. The discriminant is 25 - 24 = 1. So x = (5 ± 1) / 2, which gives x = 3 and x = 2.

Example 2: complex roots

For x² + 2x + 5 = 0, D = 4 - 20 = -16. The square root of -16 is 4i, so x = (-2 ± 4i) / 2, which gives x = -1 ± 2i.

Common mistakes

The Quadratic Equation Calculator shows real or complex roots and the discriminant automatically.

  • Forgetting that b is negative when the equation has - bx.
  • Dropping the 2a in the denominator.
  • Using the formula when a = 0, which makes the equation linear, not quadratic.

FAQ

What if a equals zero?

Then the equation is linear, not quadratic, and you solve it as bx + c = 0.

Can a quadratic equation have no solution?

It always has two solutions in the complex numbers. It may have no real solutions when the discriminant is negative.

Is factoring better than the formula?

Factoring is faster when the numbers are simple, but the formula works for every quadratic equation.