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 |
Reading the roots and discriminant
Put the equation in standard form before choosing coefficients. Terms may need to move across the equals sign, which changes their signs. Combine like terms first. In 2x squared + 5 = 3x, standard form is 2x squared - 3x + 5 = 0, so a is 2, b is -3, and c is 5.
A positive discriminant produces two distinct real numbers. A zero discriminant produces the same real root twice, which is also called a repeated or double root. A negative discriminant produces two complex conjugates. Their real parts match and their imaginary parts have opposite signs, so coefficients from a real quadratic still come in a paired pattern.
The roots are x-intercepts only when they are real and the equation is viewed as the graph y = ax squared + bx + c. Two real roots mean two x-intercepts. A repeated root touches the axis once at the vertex. Complex roots solve the algebraic equation but do not appear as x-intercepts on a standard real coordinate graph.
The calculator rounds the discriminant and numeric root components to four decimal places. A displayed value such as 1.4142 is an approximation to an irrational number, not its exact form. Substitute a rounded root back into the equation and the result may be close to zero rather than exactly zero. Keep more precision or use symbolic algebra when an assignment requires radicals or exact fractions.
Very large coefficients or a discriminant close to zero can expose floating-point limits. The implementation compares the computed discriminant directly with zero. A value that is theoretically zero may be represented as a tiny positive or negative number after decimal input arithmetic, which can change the reported branch. Scaling coefficients or using an exact symbolic method can help with sensitive cases.
The usual formula can also lose numerical accuracy for one root when b squared is much larger than 4ac because subtracting nearly equal values discards significant digits. This calculator applies the familiar textbook formula, not a specialized stable numerical algorithm. Use higher-precision software for scientific or engineering calculations where small root errors matter.
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.
- Reading a rounded decimal as an exact radical or fraction.
- Entering an equation before moving every term to one side so the other side equals zero.
- Dropping a zero coefficient, such as forgetting that x squared plus 2 equals zero has b = 0.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="quadratic-formula-calculator" async></script>Preview the embed at /embed/quadratic-formula-calculator/.