Skip to content

Quadratic Equation Solver

Solve ax^2 + bx + c = 0. Shows discriminant, real or complex roots, vertex, and parabola graph.

Quadratic Equation Solver tool

Loading...

Example

Input: x^2 - 5x + 6 = 0 (a = 1, b = -5, c = 6)

Result: x1 = 3, x2 = 2; discriminant 1; vertex (2.5, -0.25)

D = (-5)^2 - 4 x 1 x 6 = 1, so x = (5 +/- sqrt(1)) / 2, giving 3 and 2; the vertex is at x = 5 / 2 = 2.5.

How the Discriminant Shapes the Roots

EquationDiscriminantRootsVertex
x^2 - 5x + 6 = 013 and 2(2.5, -0.25)
2x^2 + 3x - 2 = 0250.5 and -2(-0.75, -3.125)
x^2 - 2 = 081.4142 and -1.4142(0, -2)
x^2 - 4x + 4 = 002 (repeated)(2, 0)
x^2 + 2x + 5 = 0-16-1 +/- 2i(-1, 4)
-x^2 + 2x + 3 = 0163 and -1(1, 4)

Results from this solver, rounded to 4 decimal places.

  1. Enter the coefficients a, b, and c for the equation ax^2 + bx + c = 0.
  2. View the discriminant value and what it tells you about the nature of the roots.
  3. See both roots displayed - real or complex, depending on the discriminant.
  4. Review the vertex coordinates and axis of symmetry for the parabola.
  5. Examine the parabola graph, which redraws as you edit the coefficients and marks the roots and vertex.
  6. Click the copy button to copy the roots or any other value.

Roots, Discriminant and Vertex of a Quadratic

A quadratic equation has the form ax^2 + bx + c = 0, and it has at most two solutions, called roots. Enter a, b and c, and this solver finds the roots with the quadratic formula. For x^2 - 5x + 6 = 0, the roots are 3 and 2. It also gives the discriminant, vertex, axis of symmetry and y-intercept, and draws the parabola.

The discriminant, b^2 - 4ac, tells you what kind of roots to expect. If it is positive, there are two real roots and the curve crosses the x-axis twice. If it is 0, there is one repeated root and the curve just touches the axis. If it is negative, the curve never meets the axis. The roots are then a complex pair, shown in the form p + qi and p - qi. The table on this page has one of each.

The graph of a quadratic is a parabola. When a is positive it opens upward and the vertex is the lowest point. When a is negative it opens downward and the vertex is the highest point. The vertex sits at x = -b / 2a, on the axis of symmetry. On the graph, roots are marked in one color and the vertex in another.

Quadratics describe anything that rises and falls in a curve. A ball thrown up at 20 m/s from 1.5 m follows h = -4.9t^2 + 20t + 1.5. The solver shows it lands after about 4.16 seconds, with its highest point at 21.91 m after 2.04 seconds.

The solver uses a form of the formula that avoids rounding errors when b is much larger than a and c. Results show up to four decimal places. If a is 0, the equation is not quadratic, and you get a message instead. To check a root, substitute it into the equation with the Math Expression Evaluator.

Formula / How It Works

x = (-b +/- sqrt(b^2 - 4ac)) / 2a | Discriminant: D = b^2 - 4ac | Vertex: (-b/2a, f(-b/2a))

Frequently Asked Questions

The discriminant is D = b^2 - 4ac, the part under the square root in the quadratic formula. If D is positive there are two different real roots. If D is 0 there is one repeated root. If D is negative there are no real roots, only a pair of complex ones.
When the discriminant is negative, the square root in the formula is of a negative number, so the roots involve i, the square root of -1. They come as a pair, p + qi and p - qi. For x^2 + 2x + 5 = 0 the roots are -1 + 2i and -1 - 2i. The parabola never crosses the x-axis in this case.
The x-coordinate is -b / (2a). Put that value back into the equation to get the y-coordinate. For x^2 - 5x + 6, x = 5 / 2 = 2.5 and y = -0.25, so the vertex is (2.5, -0.25). It is the minimum when a is positive and the maximum when a is negative.
If the roots are r1 and r2, the equation factors as a(x - r1)(x - r2). For x^2 - 5x + 6 the roots are 3 and 2, so it factors as (x - 3)(x - 2). Decimal roots such as 1.4142 mean the equation has no neat whole-number factors.
Then there is no x^2 term, so the equation is linear, not quadratic: bx + c = 0. It has one solution, x = -c / b, and its graph is a straight line. The solver shows a message asking for a non-zero value of a.

Related Tools

Triangle Calculator

Solve any triangle from 3 known values. Compute all sides, angles, area, perimeter, and draw diagrams.

Math and Numbers

Square Root and Nth Root Calculator

Calculate square roots, cube roots, and any nth root of a number with precision.

Math and Numbers

Math Expression Evaluator

Evaluate arbitrary math expressions with variables, functions, and operator precedence. Multi-line support.

Math and Numbers

Logarithm Calculator

Calculate logarithms with any base including natural log (ln), log base 10, and log base 2.

Math and Numbers