HomeMath › Quadratic Equation Solver

Quadratic Equation Solver

Solves ax² + bx + c = 0 with the quadratic formula, reporting the discriminant, both roots (real, or complex conjugates written as strings), the vertex of the parabola and the sum and product of the roots.

When to use

You need the solutions of a second-degree polynomial equation, or the vertex and discriminant of a parabola y = ax² + bx + c.

Do not use when: The coefficient a is 0 (the equation is linear: x = −c / b), or you need roots of x^n = c for other powers (use nth-root).

Formula

Δ = b² − 4ac; x = (−b ± √Δ) / (2a); for Δ < 0: x = −b/(2a) ± i·√(−Δ)/(2|a|); vertex = (−b/(2a), c − b²/(4a))

Inputs

ParameterTypeUnitRequiredDescription
anumberyesCoefficient of x². Must not be 0.
bnumberyesCoefficient of x.
cnumberyesConstant term.

Outputs

OutputTypeUnitDescription
discriminantnumberΔ = b² − 4ac; positive → two real roots, zero → one repeated root, negative → complex roots.
naturestringPlain-language classification of the roots from the sign of the discriminant.
root1number(−b + √Δ) / (2a). Only when the roots are real.
root2number(−b − √Δ) / (2a). Only when the roots are real.
rootsstringBoth roots as text; complex roots are written like '-1+2i, -1-2i'.
vertex_xnumberx-coordinate of the parabola's vertex, −b / (2a) (also the axis of symmetry).
vertex_ynumbery-coordinate of the vertex, c − b² / (4a) (the minimum for a > 0, maximum for a < 0).
sum_of_rootsnumber−b / a (Vieta's formula).
product_of_rootsnumberc / a (Vieta's formula).

Example

x² − 5x + 6 = 0: {"a":1,"b":-5,"c":6}{"discriminant":1,"nature":"Two distinct real roots","root1":3,"root2":2,"roots":"3, 2","vertex_x":2.5,"vertex_y":-0.25,"sum_of_roots":5,"product_of_roots":6}

x² + 2x + 5 = 0: {"a":1,"b":2,"c":5}{"discriminant":-16,"nature":"Two complex conjugate roots (no real roots)","roots":"-1+2i, -1-2i","vertex_x":-1,"vertex_y":4}

GET https://tttkmbb.com/api/v1/calculate/quadratic-equation?a=1&b=-5&c=6

Machine access

Sources

FAQ

What does a negative discriminant mean?

The parabola never crosses the x-axis, so there are no real solutions. The two complex conjugate roots are still reported as strings such as '-1+2i, -1-2i'.

Which root is root1?

root1 uses the + sign in the quadratic formula and root2 the − sign, so for a > 0 root1 is the larger root.

Related calculators