How to solve quadratic equations: the formula, the discriminant and three other methods
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
x = (−b ± √(b² − 4ac)) / (2a)Δ = b² − 4ac(h, k) = (−b/(2a), c − b²/(4a))x₁ + x₂ = −b/a · x₁ · x₂ = c/aa(x − x₁)(x − x₂)Worked examples
Solve 2x² − 7x + 3 = 0.
- a = 2, b = −7, c = 3.
- Δ = 49 − 24 = 25, a perfect square, so the roots are rational.
- x = (7 ± 5) / 4 → x₁ = 3, x₂ = 1/2.
- Factored: (x − 3)(2x − 1).
Solve x² − 2x − 4 = 0.
- Δ = 4 + 16 = 20 = 4 × 5, so √Δ = 2√5.
- x = (2 ± 2√5) / 2 = 1 ± √5.
Solve x² + 2x + 5 = 0.
- Δ = 4 − 20 = −16.
- √−16 = 4i.
- x = (−2 ± 4i) / 2 = −1 ± 2i.
Solve x² + 6x − 7 = 0 without the formula.
- Move the constant: x² + 6x = 7.
- Add (6/2)² = 9 to both sides: x² + 6x + 9 = 16.
- (x + 3)² = 16 → x + 3 = ±4.
A ball's height is h(t) = −4.9t² + 14.7t + 2 meters. When does it hit the ground?
- Solve −4.9t² + 14.7t + 2 = 0.
- Δ = 14.7² + 4·4.9·2 = 216.09 + 39.2 = 255.29.
- 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).
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?
What if a = 0?
Can I enter fractions or decimals?
How do I solve cubic or higher equations?
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.