Quadratic Equation Solver
Solve ax² + bx + c = 0 for real or complex roots, with the discriminant, vertex and full step-by-step working.
Step-by-step working
- D = b² − 4ac = (-3)² − 4·(1)·(2) = 1
- √D = 1
- x = (−b ± √D) / 2a = (3 ± 1) / 2
Mathematical Formula
Overview & Explanation
The quadratic formula gives the roots of any second-degree polynomial. The solver uses a numerically stable form to avoid cancellation errors when b² ≫ 4ac.
How It Works
- Compute the discriminant D.
- Classify the roots by the sign of D.
- Apply the formula (stable variant q = −½(b + sign(b)√D), x₁ = q/a, x₂ = c/q).
- Report the vertex of the parabola.
Practical Applications
- Algebra homework and exam checks.
- Projectile and optimisation problems.
How the quadratic formula works
A quadratic equation has the form ax² + bx + c = 0 with a ≠ 0. Its solutions are x = (−b ± √(b² − 4ac)) ÷ 2a. The expression under the square root, D = b² − 4ac, is the discriminant, and it decides what kind of roots you get: D > 0 gives two different real roots, D = 0 gives one repeated real root, and D < 0 gives two complex conjugate roots.
The formula comes from completing the square, so it always works, even when the equation does not factor neatly.
Worked examples
For 2x² − 7x + 3 = 0: D = 49 − 24 = 25, √D = 5, so x = (7 ± 5) ÷ 4, giving x = 3 and x = 0.5. Check: 2(9) − 21 + 3 = 0. For x² + 2x + 5 = 0: D = 4 − 20 = −16, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i.
Useful checks
The roots always satisfy x₁ + x₂ = −b/a and x₁ × x₂ = c/a, which is a fast way to check an answer. The vertex of the parabola y = ax² + bx + c lies at x = −b/2a, exactly halfway between the two roots.
Example 1: x² − 3x + 2 = 0
Two real roots.
Inputs
Coefficient a: 1 · Coefficient b: -3 · Coefficient c: 2
Step 1
D = b² − 4ac = (-3)² − 4·(1)·(2) = 1
Step 2
√D = 1
Step 3
x = (−b ± √D) / 2a = (3 ± 1) / 2
Roots
Result
Example 2: x² + 2x + 5 = 0
Complex roots.
Inputs
Coefficient a: 1 · Coefficient b: 2 · Coefficient c: 5
Step 1
D = b² − 4ac = (2)² − 4·(1)·(5) = -16
Step 2
D < 0 → complex roots, √|D| = 4
Step 3
x = (−b ± √D) / 2a = (-2 ± 4i) / 2
Roots
Result
How it's calculated & sources
x = (−b ± √(b² − 4ac)) / 2a. D = b² − 4ac: D > 0 two real roots, D = 0 one double root, D < 0 complex conjugate roots. Vertex h = −b/2a, k = f(h).
Frequently Asked Questions
What does the discriminant tell me?
What if a = 0?
Why use the “stable” formula?
Related Calculators
Slope Calculator (Two Points)
Find the slope, line equation, distance and angle between two points.
Logarithm Calculator (Any Base)
Compute log of any number to any base, plus natural log, log₁₀ and log₂, using the change-of-base rule.
Square Root Calculator
Calculate principal square roots sqrt(x) and nth roots of positive numbers.
Percentage Calculator
Calculate percentages, percentage change, and percentage of a number instantly.