Quadratic Equation Solver

Solve any quadratic ax² + bx + c = 0 for real or complex roots, with the exact radical form, discriminant, vertex, factored form and quadratic-formula steps.

How we test our calculators
Roots —
Type of roots —
Exact form —
Discriminant (b² − 4ac) —
Vertex (h, k) —
Axis of symmetry —
y-intercept —
Vertex and factored forms —
Step-by-step (quadratic formula) —

What is a quadratic equation solver?

A quadratic equation is an equation that can be written as ax² + bx + c = 0, where a, b and c are numbers and a is not 0. This quadratic equation solver takes the three coefficients and solves the equation with the quadratic formula, so it works for every quadratic, including the many that cannot be factored over the integers.

For each equation it reports the Roots as decimals and the Type of roots: two distinct real roots, one repeated real root, or two complex conjugate roots written as a ± bi. When a, b and c are whole numbers, it also gives the Exact form with the square root simplified, such as x = 2 ± √3, the form usually asked for when an answer must be exact. It also describes the parabola y = ax² + bx + c: the discriminant, the vertex, the axis of symmetry, the y-intercept, and the equation rewritten in vertex form and, when the roots are real, factored form. A Step-by-step line shows the quadratic formula worked through with your numbers.

Solving quadratics by inspection, square roots, completing the square, factoring and the quadratic formula, and recognizing when the formula gives complex solutions, are part of the Common Core high school algebra standard A-REI.B.4. That makes this tool useful for checking algebra homework, as long as you also practice the steps yourself.

Formula

The quadratic formula solves ax² + bx + c = 0 for any a ≠ 0:

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

The expression under the square root, D = b² − 4ac, is the discriminant. Its sign tells you what kind of roots to expect:

DiscriminantRootsGraph of y = ax² + bx + c
D > 0Two distinct real rootsCrosses the x-axis twice
D = 0One repeated (double) real rootTouches the x-axis at the vertex
D < 0Two complex conjugate roots, a ± biNever meets the x-axis

When D is negative, √D = i√(−D), so the roots are x = −b ÷ (2a) ± (√(−D) ÷ |2a|)i.

The parabola

  • Vertex (h, k): h = −b ÷ (2a) and k = c − b² ÷ (4a), which is the same as the value of ax² + bx + c at x = h.
  • Axis of symmetry: the vertical line x = h. Real roots always sit the same distance either side of it.
  • y-intercept: c, because y = c when x = 0.
  • Vertex form: y = a(x − h)² + k. Factored form: y = a(x − x₁)(x − x₂), where x₁ and x₂ are the real roots.

Exact form

For whole-number coefficients, the calculator simplifies √D by taking out square factors (√12 = √(4 × 3) = 2√3) and then cancels any factor shared by −b, the number in front of the root and 2a. If D is a perfect square such as 25, the roots are rational and the calculator gives them as fractions in lowest terms, for example x = 1/2 or x = -2. The formula itself comes from completing the square on ax² + bx + c = 0; see where the quadratic formula comes from.

Worked example

Example 1: irrational roots in exact form

Solve x² − 4x + 1 = 0, so a = 1, b = −4 and c = 1.

  1. Discriminant: D = (−4)² − 4 × 1 × 1 = 16 − 4 = 12. It is positive but not a perfect square, so there are two irrational real roots.
  2. Simplify the root: √12 = 2√3 ≈ 3.4641.
  3. Apply the formula: x = (4 ± 2√3) ÷ 2 = 2 ± √3.
  4. As decimals: x₁ ≈ 3.7321 and x₂ ≈ 0.2679.

The vertex is at h = 4 ÷ 2 = 2 and k = 1 − 16 ÷ 4 = −3, so it is (2, −3), the axis of symmetry is x = 2, and the y-intercept is 1. In vertex form the equation is y = (x − 2)² − 3. Its factored form, y = (x − 3.7321)(x − 0.2679), uses rounded roots, so it is approximate.

Example 2: a ≠ 1 with rational roots

Solve 2x² + 3x − 2 = 0, so a = 2, b = 3 and c = −2.

  1. D = 3² − 4 × 2 × (−2) = 9 + 16 = 25, a perfect square, so the roots are rational: Exact form shows x = 1/2 or x = -2.
  2. √25 = 5, so x = (−3 ± 5) ÷ 4.
  3. x₁ = 2 ÷ 4 = 0.5 and x₂ = −8 ÷ 4 = −2.

The factored form is y = 2(x − 0.5)(x + 2), which is the same as (2x − 1)(x + 2). The vertex is (−0.75, −3.125), so the vertex form is y = 2(x + 0.75)² − 3.125. A common error here is dividing by 2 instead of 2a = 4.

Example 3: complex roots

Solve x² + 2x + 5 = 0, so a = 1, b = 2 and c = 5.

  1. D = 2² − 4 × 1 × 5 = 4 − 20 = −16. A negative discriminant means no real roots.
  2. √(−16) = 4i.
  3. x = (−2 ± 4i) ÷ 2 = −1 ± 2i.

Check one root: (−1 + 2i)² + 2(−1 + 2i) + 5 = (1 − 4i − 4) + (−2 + 4i) + 5 = 0. The vertex is (−1, 4) and the parabola opens upward, so its lowest point is 4 units above the x-axis and it never crosses it. The vertex form is y = (x + 1)² + 4; no factored form with real numbers exists, so the calculator shows only the vertex form.

How to use this calculator

  1. Rewrite your equation in standard form, with every term on one side and 0 on the other. For example, x² = 4x − 1 becomes x² − 4x + 1 = 0.
  2. Enter a, b and c, including their signs. In x² − 4x + 1 = 0, b is −4. If a term is missing, its coefficient is 0; a blank b or c box is treated as 0.
  3. Read Roots and Type of roots, then Exact form if your teacher wants the answer in radical form.
  4. Use Vertex (h, k), Axis of symmetry, y-intercept and Vertex and factored forms to sketch or rewrite the parabola.
  5. Compare Step-by-step (quadratic formula) with your own working to find where an answer went wrong.

Common mistakes

  • Dropping a sign. When b is negative, −b is positive: for b = −4, −b = 4.
  • Squaring a negative b. (−4)² = 16, but by the order of operations −4² means −(4²) = −16, so use parentheses when you type it.
  • Dividing only part of the top. The whole numerator, −b ± √D, is divided by 2a.
  • Not starting from standard form. The coefficients are only a, b and c once the right side is 0.
  • Rounding too early. Keep the exact form until the last step.

What the tool does and does not show

  • The Roots line rounds to 4 decimal places, so a rational root such as 1/3 appears there as 0.3333 (for example, in 3x² − 4x + 1 = 0); Exact form shows it as 1/3.
  • Exact form needs whole-number coefficients. For 0.5x² − x − 1.5 = 0, multiply every term by 2 to get x² − 2x − 3 = 0, which has the same roots, 3 and −1.
  • If a = 0, the equation is linear and the calculator solves bx + c = 0 instead.

Related help: completing the square, simplified radicals and the square root calculator. For linear equations and two-equation systems, use the algebra equation solver.

Sources

Frequently asked questions

What happens if a = 0?

Then there is no x² term and the equation is linear, not quadratic. The calculator solves bx + c = 0 directly: for 0x² + 2x − 8 = 0 it gives x = 4. If a and b are both 0, the equation reduces to c = 0, which is either always true (c = 0, so every x is a solution) or never true (any other c, so there is no solution).

What does it mean when the roots are complex?

The discriminant is negative, so the formula needs the square root of a negative number and the parabola never crosses the x-axis. The two roots are complex conjugates, written a ± bi, where i = √(−1). In Example 3, x² + 2x + 5 = 0 has roots −1 + 2i and −1 − 2i. The Common Core high school standards (A-REI.B.4b and N-CN.C.7) include recognizing these solutions and writing them as a ± bi.

What is a double root?

When the discriminant is exactly 0, both roots are the same number. For x² − 6x + 9 = 0, D = 36 − 36 = 0, so x = 6 ÷ 2 = 3 is a double root. The vertex is (3, 0), which means the parabola just touches the x-axis there, and the quadratic factors as a perfect square, (x − 3)².

Is the vertex a minimum or a maximum?

It depends on the sign of a. If a is positive, the parabola opens upward and the vertex is its lowest point. If a is negative, it opens downward and the vertex is the highest point. For −x² + 4x + 5 = 0 the roots are 5 and −1, and the vertex (2, 9) is the maximum: no point on y = −x² + 4x + 5 is higher than 9.

Why does the exact form sometimes show fractions instead of a square root?

When the discriminant is a perfect square (1, 4, 9, 16, 25 and so on), its square root is a whole number, so the roots are fractions with no radical left to simplify. Exact form then gives them in lowest terms: for 3x² − 4x + 1 = 0 it shows x = 1 or x = 1/3, while Roots shows 1 and 0.3333. A double root is shown as one exact value (x² − 6x + 9 = 0 gives x = 3). Exact form shows a dash when the coefficients are not all whole numbers.

Can I enter fractions or decimals?

Enter decimals directly; the roots, vertex and steps are calculated the same way. Type a fraction as a decimal, or better, multiply every term by the common denominator first. For example, ½x² − x − 3/2 = 0 becomes x² − 2x − 3 = 0 after multiplying by 2. The roots stay the same, and you also get the exact form.

Should I factor or use the quadratic formula?

Factoring is faster when the roots are rational and the numbers are small, as in Example 2, (2x − 1)(x + 2) = 0. The quadratic formula always works, including for equations like x² − 4x + 1 = 0 that do not factor over the integers. A quick test: if the discriminant is a perfect square and the coefficients are integers, the quadratic factors over the integers.

Can this calculator solve cubic or higher-degree equations?

No. It solves degree-2 equations, plus the linear case when a = 0. Equations with x³ or higher powers need other methods.