Quadratic Equation Solver with Steps & Graph

Enter a, b and c to solve ax² + bx + c = 0. See the discriminant, exact roots (real or complex), full working and the parabola. Free, no signup.

Equation: \(a x^2 + b x + c = 0\)
Try an example:

Enter whole numbers, decimals (0.5) or fractions (1/2). Use the ± button to make a number negative.

In plain words: type the three numbers from your equation, press Solve, and this page shows the answer first — then how it got there, plus a graph of the parabola. If the equation has no real-number answer, it will tell you and show the complex-number answer instead.

What is the quadratic formula?

The quadratic formula solves any equation ax² + bx + c = 0 (a ≠ 0): x = (−b ± √(b² − 4ac)) / (2a). Substitute a, b and c, find the discriminant b² − 4ac, then evaluate the plus and minus cases to get both roots.

What this quadratic equation solver does

This free quadratic solver (also used as a quadratic equation calculator or quadratic formula calculator) solves any quadratic equation \(ax^2 + bx + c = 0\) with \(a \neq 0\). It finds the discriminant, tells you whether the roots are two real numbers, one repeated real number or a pair of complex numbers, and applies the quadratic formula step by step. Roots are given in exact form (fractions and simplified radicals such as \(1 \pm \sqrt{2}\)) next to their decimal values. For each equation it also shows the parabola's vertex, axis of symmetry, y-intercept, factored form and vertex form, and it checks the answer with Vieta's formulas. It suits high school algebra, college algebra and quick homework checks.

How to use it

  1. Write your equation in standard form, with everything on one side: \(ax^2 + bx + c = 0\). For example, rewrite \(x^2 = 5x - 6\) as \(x^2 - 5x + 6 = 0\).
  2. Enter \(a\), \(b\) and \(c\). Missing terms are zero: for \(x^2 - 9 = 0\), use \(b = 0\).
  3. Use whole numbers, decimals or fractions, and tap ± to flip a sign.
  4. Press Solve equation. The solutions appear first, followed by the graph, the working and the parabola facts. Use Copy answer to copy just the roots.

If your equation has no \(x^2\) term, it is linear, so use the linear equation solver. If you have two equations with two unknowns, try the simultaneous equations solver. When the roots describe a segment or a line, the distance between two points calculator, the slope calculator and the midpoint calculator handle the coordinate-geometry side of the same chapter.

What is a quadratic equation?

A quadratic equation is a polynomial equation of degree two. Its standard form is \(ax^2 + bx + c = 0\), where \(a\), \(b\) and \(c\) are numbers and \(a \neq 0\). If \(a\) were \(0\), the \(x^2\) term would vanish and the equation would be linear. The solutions are called the roots of the equation, and the graph of \(y = ax^2 + bx + c\) is a parabola. A quadratic has exactly two roots when you count repeated and complex roots.

Quadratic formula and discriminant

Standard form
\[ a x^2 + b x + c = 0 \quad (a \neq 0) \]
Discriminant
\[ D = b^2 - 4ac \]
Quadratic formula
\[ x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
Vertex of the parabola \(y = ax^2 + bx + c\)
\[ h = \dfrac{-b}{2a} \qquad k = c - \dfrac{b^2}{4a} \]
Vieta's formulas
\[ x_1 + x_2 = \dfrac{-b}{a} \qquad x_1 \cdot x_2 = \dfrac{c}{a} \]

What the discriminant tells you

  • \(D > 0\): two distinct real roots. The parabola crosses the x-axis at two points. If \(D\) is a perfect square, the roots are rational.
  • \(D = 0\): one repeated real root (a double root). The parabola touches the x-axis at its vertex.
  • \(D < 0\): two complex conjugate roots of the form \(p \pm qi\). The parabola does not cross the x-axis.

How to solve a quadratic equation with the formula

  1. Move every term to one side so the equation reads \(ax^2 + bx + c = 0\).
  2. Read off \(a\), \(b\) and \(c\), keeping their signs.
  3. Compute the discriminant \(D = b^2 - 4ac\) to see what kind of roots to expect.
  4. Substitute into \(x = \dfrac{-b \pm \sqrt{D}}{2a}\) and work out the "+" and "−" versions separately.
  5. Simplify any radical and, if you like, check with \(x_1 + x_2 = -\frac{b}{a}\) and \(x_1 x_2 = \frac{c}{a}\).

Worked examples

Example 1: \(x^2 - 5x + 6 = 0\) (two rational roots)

  1. \(a = 1\), \(b = -5\), \(c = 6\).
  2. \(D = (-5)^2 - 4(1)(6) = 25 - 24 = 1\), so \(D > 0\).
  3. \(x = \frac{5 \pm \sqrt{1}}{2} = \frac{5 \pm 1}{2}\).
  4. \(x = 3\) or \(x = 2\). Check: \(3 + 2 = 5 = -\frac{b}{a}\) and \(3 \times 2 = 6 = \frac{c}{a}\).

Example 2: \(x^2 - 6x + 9 = 0\) (one repeated root)

  1. \(a = 1\), \(b = -6\), \(c = 9\).
  2. \(D = 36 - 36 = 0\).
  3. \(x = \frac{6}{2} = \mathbf{3}\), a double root.
  4. The equation factors as \((x - 3)^2 = 0\), and the parabola touches the x-axis at \((3, 0)\).

Example 3: \(x^2 + 4x + 13 = 0\) (complex roots)

  1. \(a = 1\), \(b = 4\), \(c = 13\).
  2. \(D = 16 - 52 = -36\), so \(D < 0\) and the roots are complex.
  3. \(x = \frac{-4 \pm \sqrt{-36}}{2} = \frac{-4 \pm 6i}{2}\).
  4. \(x = -2 + 3i\) or \(x = -2 - 3i\).

Example 4: \(2x^2 + 7x - 4 = 0\) (rational roots with \(a \neq 1\))

  1. \(a = 2\), \(b = 7\), \(c = -4\).
  2. \(D = 49 - 4(2)(-4) = 49 + 32 = 81\), and \(\sqrt{81} = 9\).
  3. \(x = \frac{-7 \pm 9}{4}\).
  4. \(x = \frac{1}{2}\) or \(x = -4\). Factored form: \((2x - 1)(x + 4)\).

Example 5: \(x^2 - 2x - 1 = 0\) (irrational roots)

  1. \(a = 1\), \(b = -2\), \(c = -1\).
  2. \(D = 4 + 4 = 8\), which is not a perfect square, so the roots are irrational.
  3. \(\sqrt{8} = 2\sqrt{2}\), so \(x = \frac{2 \pm 2\sqrt{2}}{2}\).
  4. \(x = 1 + \sqrt{2} \approx 2.4142\) or \(x = 1 - \sqrt{2} \approx -0.4142\).

Example 6: Vertex and factored form of \(y = x^2 - 4x + 3\)

  1. \(h = -\frac{b}{2a} = \frac{4}{2} = 2\), and \(k = c - \frac{b^2}{4a} = 3 - \frac{16}{4} = -1\).
  2. Vertex \((2, -1)\), axis of symmetry \(x = 2\), y-intercept \((0, 3)\).
  3. \(D = 16 - 12 = 4\), so \(x = \frac{4 \pm 2}{2} = 3\) or \(1\).
  4. Factored form: \((x - 1)(x - 3)\). Vertex form: \((x - 2)^2 - 1\).

Example 7: A ball thrown upward (US units)

  1. The height in feet after \(t\) seconds is \(h = -16t^2 + 64t + 80\). When does it hit the ground? Set \(h = 0\).
  2. Divide by \(-16\): \(t^2 - 4t - 5 = 0\), so \(D = 16 + 20 = 36\) and \(t = \frac{4 \pm 6}{2}\).
  3. \(t = 5\) or \(t = -1\). Time cannot be negative, so the ball lands after 5 seconds.
  4. The vertex is at \(t = 2\), where the height is \(-16(4) + 64(2) + 80 =\) 144 feet, the maximum.

Example 8: A rectangle's dimensions (metric)

  1. A rectangle is 3 m longer than it is wide and has an area of 40 m². Let the width be \(w\): \(w(w + 3) = 40\), so \(w^2 + 3w - 40 = 0\).
  2. \(D = 9 + 160 = 169\) and \(\sqrt{169} = 13\), so \(w = \frac{-3 \pm 13}{2} = 5\) or \(-8\).
  3. A width cannot be negative, so \(w = 5\) m and the length is 8 m (5 × 8 = 40).

Advertisement

Other ways to solve a quadratic

Factoring

Find two numbers that multiply to \(a \times c\) and add to \(b\), split the middle term and factor by grouping. For \(2x^2 + 7x - 4\) the numbers are \(8\) and \(-1\) (\(8 \times -1 = -8 = 2 \times -4\) and \(8 + (-1) = 7\)). Then \(2x^2 + 8x - x - 4 = 2x(x + 4) - 1(x + 4) = (2x - 1)(x + 4)\), so \(x = \frac{1}{2}\) or \(x = -4\). Many quadratics do not factor over the integers, and the quadratic formula always works.

Completing the square

For \(x^2 + 6x + 5 = 0\), move the constant: \(x^2 + 6x = -5\). Add \((\frac{6}{2})^2 = 9\) to both sides: \((x + 3)^2 = 4\). Take square roots: \(x + 3 = \pm 2\), so \(x = -1\) or \(x = -5\). Completing the square is how the quadratic formula is derived, and it also gives the vertex form of a parabola.

Graphing

The real roots are the x-intercepts of \(y = ax^2 + bx + c\). The vertex is at \(x = -\frac{b}{2a}\). The parabola opens up when \(a > 0\) (the vertex is a minimum) and down when \(a < 0\) (the vertex is a maximum). The graph above is drawn from your own coefficients, so you can check that the curve crosses the x-axis at the roots the calculator reports.

Where quadratic equations appear

  • School math: Algebra 1 and Algebra 2 in the US, GCSE and A-level maths in the UK, and pre-calculus everywhere.
  • Standardized tests: quadratics appear on the SAT, ACT and AP exams.
  • Physics: equations of motion such as \(s = ut + \frac{1}{2}at^2\) are quadratic in time, which is why projectile problems use them.
  • Geometry and design: area problems often lead to a quadratic in one side length. Right-triangle side problems can also lead to one; see the Pythagorean Theorem Calculator.
  • Business and economics: profit and revenue models are often quadratic, and the vertex gives the maximum.

Working with radicals in the formula? The Square Root Calculator and the Exponent & Power Calculator help you check \(\sqrt{D}\) and \(b^2\).

Common mistakes to avoid

  • Losing the sign of \(b\). The formula uses \(-b\). If \(b = -5\), then \(-b = +5\). Sign errors are the most common cause of wrong answers.
  • Dividing only part of the numerator. The whole numerator \((-b \pm \sqrt{D})\) is divided by \(2a\).
  • Dropping the \(\pm\). Using only \(+\) gives one root and misses the other.
  • Thinking \(D < 0\) means no solution. It means no real solution. The complex roots are still valid.
  • Misreading \(c\). In \(x^2 + 3x - 5 = 0\), \(c\) is \(-5\), so \(-4ac = +20\).
  • Forgetting to rearrange. Move every term to one side so the right side is \(0\) before reading \(a\), \(b\) and \(c\).
  • Using the formula when \(a = 0\). That equation is linear: solve \(bx + c = 0\) instead.
  • Leaving radicals unsimplified. \(\frac{4 + \sqrt{12}}{2}\) should be simplified to \(2 + \sqrt{3}\).

Advertisement

FAQ

What is the quadratic formula?

For \(ax^2 + bx + c = 0\) with \(a \neq 0\), the solutions are \(x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\). It gives every real or complex root of the equation.

How do I solve ax² + bx + c = 0 step-by-step?

Rearrange the equation so one side is \(0\) and read \(a\), \(b\) and \(c\) with their signs. Compute the discriminant \(D = b^2 - 4ac\). Substitute into \(x = \frac{-b \pm \sqrt{D}}{2a}\) and work out the \(+\) and \(-\) cases separately. Example: \(x^2 - 5x + 6 = 0\) has \(D = 1\), so \(x = \frac{5 \pm 1}{2}\), giving \(x = 3\) or \(x = 2\).

What does the discriminant (D = b² − 4ac) indicate?

The discriminant is \(D = b^2 - 4ac\). If \(D > 0\) there are two distinct real roots, if \(D = 0\) there is one repeated real root, and if \(D < 0\) there are two complex conjugate roots. If \(D\) is a perfect square, the real roots are rational.

How do you find the vertex of a parabola?

For \(y = ax^2 + bx + c\), the vertex is at \(x = -\frac{b}{2a}\). Substitute that \(x\) back into the equation to get the y-coordinate, or use \(k = c - \frac{b^2}{4a}\). For \(y = x^2 - 4x + 3\) the vertex is \((2, -1)\).

What if a is zero?

If \(a = 0\) the equation is linear, \(bx + c = 0\), with the single solution \(x = -\frac{c}{b}\). This calculator asks you to use the linear equation solver in that case.

Can a quadratic have only one solution?

Yes. When \(D = 0\) the equation has one repeated root. For example, \(x^2 - 6x + 9 = (x - 3)^2 = 0\) has the single solution \(x = 3\).

What are complex conjugate roots?

When \(D < 0\), the square root of \(D\) is imaginary, so the roots have the form \(p \pm qi\), where \(i^2 = -1\). For \(x^2 + 4x + 13 = 0\) the roots are \(-2 + 3i\) and \(-2 - 3i\). They always come as a conjugate pair when the coefficients are real.

Are roots, zeros, solutions and x-intercepts the same thing?

They are closely related. The roots (or solutions) of \(ax^2 + bx + c = 0\) are the values of \(x\) that make the expression zero. The zeros of the function and the x-intercepts of its graph are those same real values. Complex roots have no x-intercepts.

How do I enter fractions, decimals and negative numbers?

Type whole numbers, decimals such as \(0.5\), or fractions such as \(\frac{1}{2}\). Tap the \(\pm\) button next to a field to make the number negative, which is useful on phones whose number keypad has no minus key. The calculator clears fractions and decimals before solving so the roots stay exact.

Related tools

Browse all Tools & Calculators