quadratic equation solver
A quadratic equation ax² + bx + c = 0 has the solutions x = (−b ± √(b² − 4ac)) / (2a). When the roots are whole numbers or fractions it's quicker to factor. Type your equation and the solver picks the right method and shows each step.
Enter solves · Shift+Enter for a new line · put systems on separate lines or separate them with commas
✓ checked: substituting each answer back into the equation makes both sides equal.
step-by-step working
Factor: find two numbers that multiply to 6 and add to −5. They are −2 and −3.
So the equation factors as:
(x − 2)(x − 3) = 0Set each factor equal to zero: x − 2 = 0 or x − 3 = 0.
x = 2 or x = 3
Which method to use
- No x term (like 3x² − 12 = 0): get x² on its own and take the square root, remembering ±.
- No number term (like x² − 2x = 0): take out the common factor x, so x = 0 is one root.
- Whole-number roots: factor. For x² + bx + c, find two numbers that multiply to c and add to b. If a ≠ 1, use the AC method.
- Anything else: use the quadratic formula.
Worked examples
x² − 5x + 6 = 0
✓ checked: substituting each answer back into the equation makes both sides equal.
step-by-step working
Factor: find two numbers that multiply to 6 and add to −5. They are −2 and −3.
So the equation factors as:
(x − 2)(x − 3) = 0Set each factor equal to zero: x − 2 = 0 or x − 3 = 0.
x = 2 or x = 3
x² + 2x − 1 = 0
✓ checked: substituting each answer back into the equation makes both sides equal.
step-by-step working
It doesn't factor nicely, so use the quadratic formula x = (−b ± √(b² − 4ac)) / (2a) with a = 1, b = 2, c = −1.
Work out the discriminant: b² − 4ac = (2)² − 4·1·(−1) = 8. It is positive, so there are two real roots.
Simplify the square root: √8 = 2√2.
Substitute and simplify:
x = −1 ± √2
x² + x + 1 = 0
✓ checked: substituting each answer back into the equation makes both sides equal.
No real solutions: the two solutions are complex conjugates.
step-by-step working
It doesn't factor nicely, so use the quadratic formula x = (−b ± √(b² − 4ac)) / (2a) with a = 1, b = 1, c = 1.
Work out the discriminant: b² − 4ac = (1)² − 4·1·1 = −3. It is negative, so there are no real roots, only two complex roots.
Substitute and simplify:
x = (−1 ± i√3)/2
The discriminant tells you what to expect
| b² − 4ac | Roots | Graph |
|---|---|---|
| positive, a perfect square | two rational roots (it factors) | crosses the x-axis twice |
| positive, not a perfect square | two irrational roots, like 1 ± √2 | crosses the x-axis twice |
| zero | one repeated root | touches the x-axis once |
| negative | two complex roots, like 3 ± 2i | never meets the x-axis |
Common mistakes
- Forgetting the ± and giving only one root.
- Dropping the sign of b: with b = −5, −b is +5, and b² is 25, not −25.
- Dividing only part of the top by 2a: the whole of −b ± √(b² − 4ac) is divided.
- Not moving everything to one side first: x² = 2x must become x² − 2x = 0 before you factor. Dividing both sides by x loses the root x = 0.
Solved equations
- solve x² − 5x + 6 = 0
- solve x² + 5x + 6 = 0
- solve x² − 4 = 0
- solve 2x + 3 = 11
- solve x² + x − 6 = 0
- solve x² − 2x − 8 = 0
- solve x² + 4x + 4 = 0
- solve 3x² − 12 = 0
- solve x² + 1 = 0
- solve x² − 9 = 0
- solve x² − x − 6 = 0
- solve x² + 2x − 3 = 0
- solve x² − 3x − 4 = 0
- solve x² − 6x + 9 = 0
- solve x² − 16 = 0
- solve 2x² + 3x − 2 = 0
- solve x² + 2x − 1 = 0
- solve x² − 2 = 0
- solve x² + x + 1 = 0
- solve x² − 7x + 12 = 0
- solve x² + 3x − 10 = 0
- solve 3x + 5 = 20
- solve 5x − 7 = 3x + 9
- solve 2(x + 3) = 14
- solve x/2 + 3 = 7
- solve x² = 16
- solve x³ = 8
- solve x² − 5x = 0
- solve 4x² − 1 = 0
- solve 6x² − 7x + 2 = 0
- solve x² + 6x + 5 = 0
- solve x² − 6x + 13 = 0
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0, x = (−b ± √(b² − 4ac)) / (2a). The ± gives the two roots. It always works, even when the equation doesn't factor.
What if the discriminant is negative?
There are no real solutions: the parabola never crosses the x-axis. In complex numbers there are two roots, written with i = √−1. For example x² − 6x + 13 = 0 has x = 3 ± 2i.
Why does it sometimes factor and sometimes use the formula?
Factoring is shorter and is the method most teachers expect when the roots are whole numbers or fractions. The solver checks the discriminant first: if it's a perfect square, the quadratic factors; otherwise it uses the formula.
Does it give exact answers or decimals?
Both. Roots are shown exactly, with square roots simplified (√8 = 2√2), and irrational roots also come with a decimal approximation.