Quadratic Equation Solver
Solve ax² + bx + c = 0 including complex roots.
Was this tool helpful?
Thanks for the feedback!
Enter the coefficients a, b and c of an equation in the form ax² + bx + c = 0, and this solver returns both roots, real or complex, along with the discriminant. It is useful for checking textbook answers and for quick physics or engineering calculations.
The quadratic formula and the discriminant
x = (−b ± √(b² − 4ac)) ÷ 2a Discriminant D = b² − 4ac
- D > 0: two different real roots.
- D = 0: one repeated real root, which the solver lists twice, for example "3 and 3".
- D < 0: no real roots. The solver shows a complex pair in the form p ± qi, where i = √−1.
Three worked examples
x² − 5x + 6 = 0
Enter a = 1, b = −5, c = 6. D = 25 − 24 = 1, so x = (5 ± 1) ÷ 2, giving roots 3 and 2. You can confirm it factorises as (x − 2)(x − 3).
2x² + 4x + 5 = 0
D = 16 − 40 = −24. The real part is −4 ÷ 4 = −1 and the imaginary part is √24 ÷ 4 ≈ 1.2247, so the result is −1 ± 1.2247i.
x² − 6x + 9 = 0
D = 36 − 36 = 0, so the only root is 3, shown as "3 and 3". The equation is the perfect square (x − 3)².
Getting the equation into standard form
The solver needs everything on one side with zero on the other. For 3x² = 7x − 2, move the terms across to get 3x² − 7x + 2 = 0, then enter a = 3, b = −7, c = 2. The roots are 2 and 0.3333, which is 1/3; the fraction to decimal calculator helps you recognise decimals like that.
- Enter 0 for a missing term: x² − 9 = 0 means b = 0, and the roots are 3 and −3.
- Keep the signs. Forgetting that b is negative is the most common reason for a wrong answer.
- a cannot be 0. Without the x² term the equation is linear, and the solver shows an error.
A physics application: when does the ball land?
A ball thrown upwards at 20 m/s from a height of 1.5 m follows h = −4.9t² + 20t + 1.5, taking g as 9.8 m/s². Setting h = 0 and entering a = −4.9, b = 20, c = 1.5 gives roots −0.0737 and 4.1553. Time cannot be negative, so the ball hits the ground after about 4.16 seconds. The same approach finds break-even points in simple profit models and the dimensions of a rectangle from its area and perimeter.
Precision notes
Roots and the discriminant are rounded to four decimal places. When b is huge compared with a and c, the smaller root can round to 0: for x² + 100000000x + 1 = 0 the solver shows 0 and −100000000, while the true small root is about −0.00000001. When a is negative and the roots are complex, the imaginary part may carry a minus sign, as in "1 ± -2i"; that is the same pair of roots as 1 ± 2i.