←

Quadratic Equation Solver

Solve ax² + bx + c = 0 with the steps

ax² + bx + c = 0

Try
Two real rootsx1 = 2x2 = 3

Factored: (x − 2)(x − 3) = 0

Vertex of the parabola: (2.5, -0.25) · opens upward.

Steps

  1. Equation: x² − 5x + 6 = 0
  2. Discriminant: b² − 4ac = -5² − 4 × 1 × 6 = 1
  3. The discriminant is positive, so there are two real roots.
  4. x = (−b ± √D) / 2a = (5 ± 1) / 2
  5. x₁ = 2, x₂ = 3
More info

How to use it

Write your equation in the form ax² + bx + c = 0, enter the three numbers a, b and c (negative numbers are fine, and so are decimals), and the solutions appear with the working. For example, x² − 5x + 6 = 0 has a = 1, b = −5 and c = 6, and its roots are 2 and 3. If the roots are whole numbers or fractions that come out evenly, the factored form is shown as well: (x − 2)(x − 3). The page also gives the vertex, the highest or lowest point of the parabola, and whether it opens upward (a positive) or downward (a negative).

The quadratic formula and the discriminant

The roots are x = (−b ± √(b² − 4ac)) / 2a. The part under the square root, b² − 4ac, is the discriminant. If it is positive, there are two different real roots, where the parabola crosses the x axis twice. If it is zero, there is one repeated root, where the parabola just touches the axis. If it is negative, the square root of a negative number gives imaginary numbers, so there are no real roots and the two solutions are a pair of complex numbers, written with i (the square root of −1). If a is zero the equation is not quadratic: it is a straight line, and the tool solves it as one.

Questions

Can I solve x² = 9? Move everything to one side first: x² − 9 = 0, so a = 1, b = 0, c = −9. Why are some roots long decimals? When the discriminant is not a perfect square the roots are irrational, so they are shown rounded to nine decimal places. Can it show a graph? Not yet; the vertex and the roots give you the key points to sketch it. For fractions and matrices, see the Fraction Calculator and the Matrix Calculator.