PocketCalc

Quadratic Equation Solver

Free quadratic equation solver — enter a, b, c and get both roots using the quadratic formula (Bhaskara). Handles real, repeated and complex roots.

x₁ = 3, x₂ = 2

Type the three coefficients a, b, c of ax² + bx + c = 0. The calculator returns both roots — real, repeated or complex.

The formula

x = (−b ± √Δ) ÷ (2a) with Δ = b² − 4ac

The plus / minus gives the two roots. The discriminant Δ tells you which case you’re in:

ΔRoots
> 0Two distinct real numbers
= 0One repeated real root (parabola touches x-axis)
< 0A pair of complex conjugates

Why a ≠ 0

If a were zero the x² term would vanish and the equation would be linear: bx + c = 0, with a single solution x = −c/b. That’s a different problem — this solver insists on a genuine quadratic.

Complex case

When Δ < 0 there are still two solutions, just not real-valued:

x = (−b ± √|Δ| · i) ÷ (2a) = (−b)/(2a) ± (√|Δ|)/(2a) · i

We report the real part and the imaginary magnitude separately (r ± mi).

Worked examples

  • x² − 5x + 6 = 0

    x₁ = 3, x₂ = 2

  • x² − 4x + 4 = 0 (perfect square)

    Double root: x = 2

  • x² + 1 = 0 (no real roots)

    No real roots — complex: 0 ± 1i

Frequently asked questions

What is the quadratic formula?

x = (−b ± √(b² − 4ac)) ÷ (2a). The expression under the square root, b² − 4ac, is called the *discriminant* (Δ). It tells you whether the roots are real and distinct, repeated, or complex.

What does the discriminant tell me?

Δ > 0: two distinct real roots. Δ = 0: one repeated real root (the parabola just touches the x-axis). Δ < 0: a conjugate pair of complex roots — the parabola never crosses the x-axis.

Why must a be non-zero?

If a = 0 the x² term vanishes and the equation is linear (bx + c = 0), not quadratic. This calculator only solves second-degree equations.

Is this the same as Bhaskara's formula?

Yes. In Brazil and a few other countries the same formula is taught under Bhaskara's name. The derivation completes the square on ax² + bx + c = 0 and isolates x.

How precise are the roots?

Standard double-precision arithmetic — about 15 significant digits. For coefficients with very different magnitudes the formula can lose precision; in that case the so-called *citardauq* form (multiplying numerator and denominator by the conjugate) is more stable, but for everyday inputs the displayed result is well within tolerance.