Quadratic Formula

The quadratic formula gives the roots of any second-degree polynomial in one variable in closed form. It is the fundamental algebraic tool for solving ax2+bx+c=0ax^2 + bx + c = 0 when factoring by inspection isn’t practical.

The Formula

For real coefficients a,b,cRa, b, c \in \mathbb{R} with a0a \neq 0, the quadratic formula gives the solutions of the quadratic equation ax2+bx+c=0ax^2 + bx + c = 0:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

The ±\pm produces the two roots x1,x2x_1, x_2 — one for each sign.

The formula always works as long as a0a \neq 0; otherwise the equation isn’t quadratic but linear (bx+c=0bx + c = 0, with the single root x=c/bx = -c/b). The expression under the square root has its own name and controls how many real roots exist.

The Discriminant

The discriminant of the quadratic ax2+bx+cax^2 + bx + c is the quantity

Δ=b24ac\Delta = b^2 - 4ac

It governs the nature of the roots:

  • Δ>0\Delta > 0: two distinct real roots
  • Δ=0\Delta = 0: one repeated real root (also called a double root), x=b2ax = -\dfrac{b}{2a}
  • Δ<0\Delta < 0: two complex-conjugate roots, no real solutions

Geometrically, the graph of y=ax2+bx+cy = ax^2 + bx + c is a parabola, and the real roots are the points where it crosses the xx-axis. The three discriminant cases correspond to the parabola crossing the axis at two points, touching it at exactly one point (the vertex sits on the axis), or floating entirely above or below it.

For x25x+6=0x^2 - 5x + 6 = 0: Δ=2524=1>0\Delta = 25 - 24 = 1 > 0, giving roots x=5±12=3,2x = \dfrac{5 \pm 1}{2} = 3, 2.

For x24x+4=0x^2 - 4x + 4 = 0: Δ=1616=0\Delta = 16 - 16 = 0, giving the repeated root x=2x = 2.

For x2+x+1=0x^2 + x + 1 = 0: Δ=14=3<0\Delta = 1 - 4 = -3 < 0, no real roots — the parabola never crosses the xx-axis.

Derivation by Completing the Square

The formula isn’t pulled from thin air — it follows from a single algebraic manoeuvre: rewriting the quadratic so that xx appears inside one squared term, then taking square roots.

Derive by completing the square

Start from ax2+bx+c=0ax^2 + bx + c = 0 with a0a \neq 0. Divide through by aa:

x2+bax+ca=0x^2 + \frac{b}{a} x + \frac{c}{a} = 0

Move the constant to the right-hand side:

x2+bax=cax^2 + \frac{b}{a} x = -\frac{c}{a}

Add (b2a)2\left(\dfrac{b}{2a}\right)^2 to both sides so the left side becomes a perfect square:

x2+bax+(b2a)2=(b2a)2cax^2 + \frac{b}{a} x + \left(\frac{b}{2a}\right)^2 = \left(\frac{b}{2a}\right)^2 - \frac{c}{a}

The left side now factors as (x+b2a)2\left(x + \dfrac{b}{2a}\right)^2. Combine the right side over the common denominator 4a24a^2:

(x+b2a)2=b24ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}

Take square roots of both sides:

x+b2a=±b24ac2ax + \frac{b}{2a} = \pm \frac{\sqrt{b^2 - 4ac}}{2a}

Solve for xx:

x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Vieta’s Formulas

The sum and product of the two roots can be read off directly from the coefficients — without going through the quadratic formula and its square root.

For the quadratic ax2+bx+c=0ax^2 + bx + c = 0 with roots x1,x2x_1, x_2, Vieta’s formulas relate the roots to the coefficients:

x1+x2=ba,x1x2=cax_1 + x_2 = -\frac{b}{a}, \qquad x_1 \cdot x_2 = \frac{c}{a}

Equivalently, the polynomial factors as

ax2+bx+c=a(xx1)(xx2)ax^2 + bx + c = a(x - x_1)(x - x_2)

These are useful as a quick sanity check after solving — the sum and product of the roots you found should match b/a-b/a and c/ac/a — and as a way to construct a quadratic with prescribed roots without going through the full formula.

A quadratic with roots x1=3,x2=2x_1 = 3, x_2 = 2 and leading coefficient a=1a = 1:

x2(3+2)x+(32)=x25x+6x^2 - (3 + 2) x + (3 \cdot 2) = x^2 - 5x + 6

which matches the first example above.