Quadratic Formula Calculator
For x^2 - 3x + 2 = 0, the roots are x = 2 and x = 1. This quadratic formula calculator solves any equation in the form ax^2 + bx + c = 0. Enter the three coefficients a, b, and c to get both roots, the discriminant, and whether the answers are real or complex. The value of a must be nonzero, otherwise the equation is linear rather than quadratic.
Quick answer
A quadratic equation has the form ax^2 + bx + c = 0, where a is not zero.
What this tells you
- •A quadratic equation has the form ax^2 + bx + c = 0, where a is not zero.
- •The quadratic formula finds both roots using the coefficients a, b, and c.
- •The discriminant b^2 - 4ac tells you whether the roots are real or complex.
- •Numeric roots are rounded to 4 decimal places, and complex roots are shown as a + bi.
How to Use
- 1Enter the coefficient a, the number in front of x squared, and keep it nonzero.
- 2Enter the coefficient b, the number in front of x.
- 3Enter the constant term c.
- 4Click Calculate to see both roots, the discriminant, and the nature of the solutions.
How It Works
Formula
x = (-b +/- sqrt(b^2 - 4ac)) / 2aThe quadratic formula gives both roots of ax^2 + bx + c = 0. The part under the square root, b^2 - 4ac, is the discriminant. When it is positive there are two real roots, when it is zero there is one repeated real root, and when it is negative the two roots are complex conjugates.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Two distinct real roots
The discriminant is (-3)^2 - 4(1)(2) = 1, which is positive, so there are two real roots. The formula gives (3 + 1) / 2 = 2 and (3 - 1) / 2 = 1.
One repeated root
The discriminant is (-2)^2 - 4(1)(1) = 0, so the square root term vanishes and both roots collapse to -(-2) / 2 = 1.
Complex roots
The discriminant is 0 - 4(1)(1) = -4, which is negative, so the roots are complex. The real part is 0 and the imaginary part is sqrt(4) / 2 = 1, giving 0 + 1i and 0 - 1i.
Discriminant and the Nature of the Roots
How the sign of b^2 - 4ac decides what kind of roots you get.
| Discriminant | Roots |
|---|---|
| Greater than 0 | Two distinct real roots |
| Equal to 0 | One repeated real root |
| Less than 0 | Two complex conjugate roots |
Common mistakes
- Getting the sign of b wrong. The formula uses -b, so a negative b becomes positive, and for x^2 - 3x + 2 the -b term is +3, not -3.
- Dividing only part of the expression by 2a. The whole numerator -b +/- sqrt(b^2 - 4ac) is divided by 2a, not just the square root term.
- Ignoring complex roots when the discriminant is negative. A negative discriminant still has two roots, but they are complex numbers of the form a + bi rather than real numbers.