Skip to main content
Online
Algebra · step-by-step

Quadratic Equation Solver

Enter a, b and c to solve ax² + bx + c = 0. You get every step — discriminant, exact roots in simplest radical form (or complex roots), vertex, factored form and a graph.

Integers, decimals or fractions such as 3/4 are accepted.

Complete guide

How to solve quadratic equations: the formula, the discriminant and three other methods

4 min read Reviewed By the GetCalcMaster team · Editorial policy

A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its graph is a parabola, and its solutions (roots) are the x-values where that parabola meets the x-axis. Every quadratic has exactly two roots when you count complex and repeated roots, and there are four standard ways to find them: factoring, completing the square, the quadratic formula and graphing.

The solver above uses the quadratic formula with exact integer arithmetic, so answers come out in simplest radical form (like 1 ± √5) rather than as rounded decimals. It also clears fractions first, divides out common factors, reports the vertex and factored form, and checks the result with Vieta's formulas.

Key formulas

Quadratic formula
x = (−b ± √(b² − 4ac)) / (2a)
Works for every quadratic, including those that cannot be factored.
Discriminant
Δ = b² − 4ac
Δ > 0: two real roots; Δ = 0: one repeated root; Δ < 0: two complex conjugate roots. If Δ is a perfect square, the roots are rational.
Vertex
(h, k) = (−b/(2a), c − b²/(4a))
The parabola's turning point; vertex form is y = a(x − h)² + k.
Vieta's formulas
x₁ + x₂ = −b/a · x₁ · x₂ = c/a
A quick check on any pair of roots.
Factored form
a(x − x₁)(x − x₂)
Expanding it must give back the original polynomial.

Worked examples

Example 1: Factorable quadratic

Solve 2x² − 7x + 3 = 0.

  1. a = 2, b = −7, c = 3.
  2. Δ = 49 − 24 = 25, a perfect square, so the roots are rational.
  3. x = (7 ± 5) / 4 → x₁ = 3, x₂ = 1/2.
  4. Factored: (x − 3)(2x − 1).
Answer: x = 3 or x = 1/2.
Example 2: Irrational roots

Solve x² − 2x − 4 = 0.

  1. Δ = 4 + 16 = 20 = 4 × 5, so √Δ = 2√5.
  2. x = (2 ± 2√5) / 2 = 1 ± √5.
Answer: x = 1 + √5 ≈ 3.236 or x = 1 − √5 ≈ −1.236.
Example 3: Complex roots

Solve x² + 2x + 5 = 0.

  1. Δ = 4 − 20 = −16.
  2. √−16 = 4i.
  3. x = (−2 ± 4i) / 2 = −1 ± 2i.
Answer: x = −1 + 2i or x = −1 − 2i. The parabola never touches the x-axis.
Example 4: Completing the square

Solve x² + 6x − 7 = 0 without the formula.

  1. Move the constant: x² + 6x = 7.
  2. Add (6/2)² = 9 to both sides: x² + 6x + 9 = 16.
  3. (x + 3)² = 16 → x + 3 = ±4.
Answer: x = 1 or x = −7.
Example 5: Projectile height

A ball's height is h(t) = −4.9t² + 14.7t + 2 meters. When does it hit the ground?

  1. Solve −4.9t² + 14.7t + 2 = 0.
  2. Δ = 14.7² + 4·4.9·2 = 216.09 + 39.2 = 255.29.
  3. t = (−14.7 − √255.29)/(−9.8) ≈ (−14.7 − 15.978)/(−9.8) ≈ 3.13 s (the other root is negative and has no physical meaning).
Answer: After about 3.13 seconds.

Which method should you use?

Method Best when Watch out for
Factoring Integer roots are easy to spot Not every quadratic factors over the integers
Completing the square b is even and a = 1; deriving vertex form Arithmetic with fractions when b is odd
Quadratic formula Always works Sign errors in −b and in 4ac
Graphing You need a picture or an estimate Only approximate

Where the quadratic formula comes from

Start with ax² + bx + c = 0 and divide by a. Move c/a to the right and add (b/2a)² to both sides to complete the square: (x + b/2a)² = (b² − 4ac)/(4a²). Taking square roots and subtracting b/2a gives the formula. Knowing this derivation makes it easy to remember why the discriminant decides the number of real roots: you can only take a real square root of a non-negative number.

Common mistakes to avoid

  • Dropping the sign of b: with b = −7, −b is +7.
  • Computing b² − 4ac as b² − 4·a + c.
  • Dividing only the √Δ term by 2a instead of the whole numerator.
  • Forgetting that Δ < 0 means complex roots, not 'no solution', if complex numbers are allowed.
  • Not simplifying √Δ (√20 = 2√5).

Frequently asked questions

Can a quadratic have only one solution?
Yes, when Δ = 0. The parabola touches the x-axis at its vertex, and the root is counted twice (a double root).
What if a = 0?
Then the equation is linear, bx + c = 0, with the single solution x = −c/b. The solver detects this automatically.
Can I enter fractions or decimals?
Yes. The solver multiplies through by the least common denominator so the arithmetic stays exact.
How do I solve cubic or higher equations?
Use the symbolic solve() function in the CAS lab or find roots numerically with the numerical methods lab.

Related tools and guides

Educational content. Results are computed in your browser with standard double-precision arithmetic; double-check anything with legal, financial, medical, or safety consequences. Spotted an error? Tell us and we will correct it.