How the quadratic formula calculator works
The calculator solves equations in standard form, ax² + bx + c = 0, using real coefficients. A solution, also called a root, is a value of x that makes the equation true. The coefficient a must be nonzero for the equation to be quadratic.
- 1Enter the coefficients. Enter a for the x² term, b for the x term and c for the constant, keeping their signs. Fractions and decimals are accepted. An empty a counts as 1; an empty b or c counts as 0.
- 2Use standard form or enter the equation. Move every term to one side before identifying the coefficients. Alternatively, turn on Type the whole equation to expand and rearrange an equation such as 3x² = 12x − 5.
- 3Read the roots and working. The results show exact roots and their decimal values, followed by the discriminant, vertex, axis of symmetry, factored form when available and vertex form. The graph shows the corresponding parabola.
Complex answers displays roots containing i when there are no real roots. Decimal places controls decimal rounding. The step-by-step working covers the quadratic formula and completing the square, with factoring steps when the roots are rational.
The quadratic formula
For ax² + bx + c = 0 with real coefficients and a ≠ 0. Divide the entire numerator by 2a.
The ± means evaluate the expression twice: once with addition and once with subtraction. These give two distinct roots unless the discriminant is zero. Calculate the discriminant first, then simplify its square root and the resulting fractions.
Worked example: 2x² − 3x − 5 = 0
Enter a = 2, b = −3 and c = −5. The discriminant is (−3)² − 4 × 2 × (−5) = 9 + 40 = 49. Since √49 = 7 and 2a = 4, the roots are (3 + 7)/4 = 5/2 and (3 − 7)/4 = −1.
Check by substitution: at x = 2.5, the left side is 12.5 − 7.5 − 5 = 0. At x = −1, it is 2 + 3 − 5 = 0. Both values satisfy the original equation.
What the discriminant tells you
The discriminant determines the number and type of roots before you calculate them. Its sign also tells you how many times the parabola meets the x-axis.
| Discriminant | Roots | Parabola |
|---|---|---|
| Positive perfect square | Two distinct rational roots | Crosses the x-axis twice |
| Positive, not a perfect square | Two distinct irrational roots | Crosses the x-axis twice |
| Zero | One distinct real root, repeated twice | Touches the x-axis at its vertex |
| Negative | Two nonreal complex conjugate roots | Does not meet the x-axis |
For fractional or terminating-decimal coefficients, you can first multiply the equation by a common denominator to obtain integer coefficients. This preserves the roots, although it changes the numerical value of the discriminant. For arbitrary real coefficients, use the discriminant's sign without applying the integer perfect-square test.
Exact, decimal and complex answers
An exact answer retains fractions and square roots instead of rounding them. For 2x² + 10x + 11 = 0, the discriminant is 12. Simplifying √12 to 2√3 gives x = (−5 ± √3)/2, approximately −1.634 and −3.366 to three decimal places.
When the discriminant is negative, use i² = −1 and replace √D with i√(−D). For x² + 4 = 0, the discriminant is −16 and the roots are 2i and −2i. These are valid complex solutions, but they are not x-intercepts on the real-coordinate graph.
The vertex, axis and graph
The vertex is (h, k), and the axis of symmetry is x = h.
The parabola opens upward when a > 0, so its vertex is a minimum. It opens downward when a < 0, so its vertex is a maximum. Distinct real roots sit equally far from the axis of symmetry.
For the worked example, the vertex is (0.75, −6.125). The factored form, (2x − 5)(x + 1), makes the roots visible by setting each factor to zero. Vertex form makes the turning point visible instead.
Completing the square
Completing the square gives the same roots by turning the variable terms into a squared bracket. In the worked example, divide by 2 to get x² − (3/2)x = 5/2. Add 9/16 to both sides: (x − 3/4)² = 49/16. Taking both square roots gives x = 3/4 ± 7/4, so x = 5/2 or −1.
Tips for avoiding common errors
- 1Keep negative signs with coefficients. In 2x² − 3x − 5 = 0, b is −3 and c is −5. Use parentheses when squaring a negative coefficient.
- 2Divide the whole numerator. Both −b and the square-root term are divided by 2a. Writing the calculation as one fraction prevents an order-of-operations mistake.
- 3Keep exact values until the end. Use fractions or radicals in later calculations. Rounded decimal roots may give a small nonzero result when substituted back into the equation.
Quadratic formula FAQ
Does the quadratic formula work for every quadratic equation?
Yes, provided a ≠ 0. It gives real or complex roots even when simple factoring is not possible.
What happens when a = 0?
The quadratic formula is undefined, and the equation reduces to bx + c = 0. If b ≠ 0, its solution is −c/b. If b = 0 as well, there are no solutions when c ≠ 0 and infinitely many when c = 0.
Can b or c be zero?
Yes, only a must be nonzero. For x² − 9 = 0, b = 0 and the roots are ±3; for x² + 4x = 0, c = 0 and the roots are 0 and −4.
Why does the calculator sometimes give only one root?
When the discriminant is zero, the plus and minus branches give the same value, −b/(2a). This is one distinct root with multiplicity two, also called a double root.
Can a quadratic with irrational roots be factored?
Yes, if irrational coefficients are allowed in the factors. For example, x² − 2 = (x − √2)(x + √2). It cannot be factored into linear factors with rational coefficients.
Are x₁ and x₂ always listed from largest to smallest?
No. If x₁ uses the plus branch and x₂ uses the minus branch, a negative denominator reverses their numerical order. The labels identify the two roots, not their size.
Sources
- 19.3 Solve Quadratic Equations Using the Quadratic Formula · OpenStax, Rice University · Accessed November 2026
- 29.2 Solve Quadratic Equations by Completing the Square · OpenStax, Rice University · Accessed November 2026
- 39.6 Graph Quadratic Functions Using Properties · OpenStax, Rice University · Accessed November 2026
- 4Quadratic equations · Australian Mathematical Sciences Institute · Accessed November 2026