Quadratic equations: formula, roots and worked examples
Enter all three coefficients, including zeros. Use decimals, integer fractions or decimal scientific notation. A zero quadratic coefficient is handled as a linear equation.
Write the equation in standard form
Move every term to the left so the equation is ax² + bx + c = 0. Enter a, b and c with their signs: 2x² = 5x + 3 becomes a = 2, b = -5, c = -3. Enter 0 for a missing term rather than leaving it blank. A genuine quadratic has a ≠ 0. If a = 0 and b ≠ 0, this tool solves the linear equation bx + c = 0. If both are zero, c = 0 gives every real number; otherwise there is no solution.
Derive and use the quadratic formula
For a ≠ 0, divide by a, move c/a to the right and complete the square by adding (b/2a)² to both sides. This gives (x + b/2a)² = (b² − 4ac)/(4a²). Taking both square-root signs and rearranging gives x = (−b ± √(b² − 4ac))/(2a). The denominator covers the complete numerator. The ± is essential: a quadratic generally has two roots, which coincide for a repeated root.
Worked examples and root checks
For x² − 3x + 2 = 0, Δ = 9 − 8 = 1 and x = (3 ± 1)/2, so the roots are 1 and 2. Substitution gives zero for both. Their sum is 3 = −b/a and product is 2 = c/a. For x² + 1 = 0, Δ = -4 and the roots are -i and i, where i² = -1; these are not real-axis crossings. Fractional coefficients are kept exact, so they need not first be rounded to decimals.
Discriminant, symmetry and vertex
The discriminant Δ = b² − 4ac classifies the roots: positive gives two distinct real roots, zero one repeated real root, and negative a complex conjugate pair. For y = ax² + bx + c, the symmetry axis is x = h = −b/(2a), and the vertex height is k = c − b²/(4a). It opens upward for a > 0 and downward for a < 0. Complex roots are valid algebraic solutions even though the real parabola has no x-axis intersection.
Exact values and stable numerical roots
Decimal inputs are exact rational coefficients. The discriminant and its sign are computed using exact integer fractions. Perfect-square rational discriminants give exact rational roots. Otherwise an exact radical expression is retained; it is not always reduced to a square-free radical. Numerical real roots use a cancellation-resistant quadratic evaluation, important when |b| is much larger than the other coefficients. Irrational values are compared at 90 and 120 significant digits and must agree to 25 digits; this checks consistency, not a formal error bound. Display 3–15 significant digits; ≈ identifies approximations.
Input limits and reports
Use up to 40 digits per fraction component, or 40 decimal digits including at most 20 after the separator. Decimal scientific notation such as 1.2e3 allows exponents within ±1000. Numerical result exponents must be within ±4095. No expressions, grouped numbers or complex coefficients are accepted. Roots are ordered from smaller to larger when real. Copy, CSV and Print / Save as PDF retain inputs, root classification, exact values and working. The vertex is provided for interpretation; no plotted graph is implied.
Use Fraction Calculator to simplify rational coefficients, Exponent Calculator to explore squares and powers, and Scientific Calculator to evaluate a broader expression after identifying its domain.
OpenStax — Quadratic Formula derives the formula and explains the discriminant. ISO 80000-2:2019 is a reference for mathematical notation, not a certification of this calculator. The exact-versus-approximate rules and numerical limits are stated here.
Common questions
Can a be zero?
Yes. The calculator explicitly switches to the linear or constant equation case instead of dividing by zero.
What if the discriminant is negative?
It returns the complex conjugate roots. There are no real roots or real x-axis crossings.
Are decimal coefficients exact?
They are interpreted as exact rational inputs. Rational roots and exact radical expressions are retained, while numerical approximations carry ≈.
Why can direct use of the formula lose a small root?
Subtracting nearly equal floating-point numbers loses precision. A stable q-based evaluation computes one root and obtains the other through their product c/a.
Explore related tools
- Right Triangle Calculator
- Pythagorean Theorem Calculator
- Surface Area Calculator
- Circle Calculator
- Distance Calculator
- Area Calculator
- Slope Calculator
- Volume Calculator
- Triangle Calculator
- Confidence Interval Calculator
- Z-score Calculator
- Permutation and Combination Calculator
- Mean, Median, Mode & Range Calculator
- Statistics Calculator
- Probability Calculator
- Sample Size Calculator
- Number Sequence Calculator
- Standard Deviation Calculator
- Random Number Generator
- Scientific Notation Calculator
- Big Number Calculator
- Root Calculator
- Log Calculator
- Matrix Calculator
- Rounding Calculator
- Exponent Calculator
- Fraction Calculator
- Scientific Calculator
- Percentage Calculator
- Percent Error Calculator
- Least Common Multiple Calculator
- Greatest Common Factor Calculator
- Factor Calculator
- Ratio Calculator