The Quadratic Formula

\(x = \dfrac{-b \pm \sqrt{b^2-4ac}}{2a}\) solves every quadratic \(ax^2+bx+c=0\) — even the ones factoring can't touch — and the discriminant \(D = b^2-4ac\) tells you what kind of roots you'll get before you finish the arithmetic.

By the end you'll be able to solve any quadratic with the formula and read the number and type of roots — two real, one repeated, or a complex conjugate pair — straight off the sign of \(D\).

Predict: how many real roots does the quadratic have once D turns negative? Raise c until \(D < 0\), then check the diagram below.

This plots the roots of \(ax^2+bx+c=0\) from \(x=\dfrac{-b\pm\sqrt{b^2-4ac}}{2a}\). Drag a, b, and c and watch the roots move: two real roots sit on a number line when \(D>0\), they merge into one repeated root right when \(D=0\), and once \(D<0\) they become a complex conjugate pair plotted on the complex plane. Hover or focus a root for its exact value.

D = 16 (positive) → two real roots: x = -1.0, 3.0

ax² + bx + c = 0 — roots plotted from the sign of D
two real roots (D>0) one repeated root (D=0) complex conjugate pair (D<0)

The quadratic formula solves \(ax^2+bx+c=0\) no matter what a, b, and c are, and its discriminant \(D=b^2-4ac\) previews the roots' nature before you finish the calculation.

Formal

\(x = \dfrac{-b \pm \sqrt{b^2-4ac}}{2a}\), valid for any \(a \neq 0\). It isn't magic — it's what you get from completing the square on the general equation, so the \(\pm\) and the square root are the exact same \(\pm\) and root you'd produce by hand every time.

The discriminant \(D=b^2-4ac\) — the part under the root — decides the outcome:

  • D > 0: two distinct real roots — the parabola crosses the x-axis twice.
  • D = 0: one repeated real root — the vertex sits exactly on the x-axis.
  • D < 0: a complex conjugate pair — the parabola never touches the x-axis.
Procedural

Read off a, b, c, plug them straight into \(x = \dfrac{-b \pm \sqrt{b^2-4ac}}{2a}\), and simplify — no factoring hunt required. Compute D first: if it's negative, write \(\sqrt{D} = \sqrt{-D}\cdot i\) and finish with a complex answer instead of stopping short.

Applied

A projectile's height model, a bridge cable's tension curve, a profit function you're maximizing — whenever the model is quadratic and factoring doesn't cooperate, the formula guarantees an answer, and the discriminant tells you up front whether that answer is a real solution you can act on or a complex one signaling the scenario never actually happens (e.g., a projectile that never reaches a given height).

Worked example

Solve \(2x^2 - 4x + 5 = 0\). Here \(a=2, b=-4, c=5\). Discriminant: \(D = (-4)^2 - 4(2)(5) = 16-40=-24\) — negative, so expect a complex conjugate pair. Apply the formula: \(x = \dfrac{4 \pm \sqrt{-24}}{4}\). Simplify the root: \(\sqrt{-24} = \sqrt{24}\cdot i = 2\sqrt{6}\,i\). So \(x = \dfrac{4 \pm 2\sqrt{6}\,i}{4} = \) \(1 \pm \tfrac{\sqrt6}{2}i\) — a conjugate pair, exactly as D's sign predicted.

Your turn

Solve \(x^2 - 5x + 4 = 0\). Here \(a=1, b=-5, c=4\). Discriminant: \(D = (-5)^2 - 4(1)(4) = 25-16=9\) — positive, so expect two distinct real roots. Apply the formula: \(x = \dfrac{5 \pm \sqrt{9}}{2} = \dfrac{5\pm3}{2}\). Now finish it: the two roots are \(x = \) ____ and \(x = \) ____.

Reveal the answer

\(x = \dfrac{5+3}{2} = 4\) and \(x = \dfrac{5-3}{2} = 1\) — two real roots, matching \(D=9>0\). Set a = 1, b = -5, c = 4 on the sliders above and check both roots against the tooltips.

More info — where the formula comes from

Starting from \(ax^2+bx+c=0\), divide by a, move \(c/a\) to the other side, and add \((b/(2a))^2\) to both sides. The left side becomes the perfect square \((x+b/(2a))^2\); the right side becomes \((b^2-4ac)/(4a^2)\). Taking square roots of both sides gives \(x+b/(2a) = \pm\sqrt{b^2-4ac}/(2a)\), and isolating x yields the formula above — the same completing-the-square move you already know, just run once on the general equation instead of on specific numbers. See the OpenStax link in Dive deeper for the full worked derivation.

Check your understanding

Question 1 of 3

Solve \(3x^2 + 5x - 2 = 0\) using the quadratic formula.

Question 2 of 3

For \(x^2 + 4x + 7 = 0\), what does the discriminant tell you about the roots — without solving further?

Question 3 of 3

The \(\pm\sqrt{b^2-4ac}\) in the quadratic formula comes directly from which step of completing the square on \(ax^2+bx+c=0\)?

Recap

  • The quadratic formula \(x = \dfrac{-b\pm\sqrt{b^2-4ac}}{2a}\) solves every quadratic \(ax^2+bx+c=0\) with \(a\neq0\) — it comes from completing the square on the general equation.
  • The discriminant is \(D=b^2-4ac\), the quantity under the square root.
  • \(D>0\): two distinct real roots. \(D=0\): one repeated real root.
  • \(D<0\): a complex conjugate pair (no real x-intercepts) — write \(\sqrt{D}\) as \(\sqrt{-D}\cdot i\) to finish.

Dive deeper

Sources

  • The Quadratic Formula and Discriminant