Math

Quadratic Formula: How to Solve Any Quadratic Equation Step by Step

Learn the quadratic formula, understand the discriminant, and solve quadratic equations with worked examples and visual explanations.

By Editorial Team 2026-03-25

The Quadratic Formula

Every quadratic equation of the form

ax2+bx+c=0(a0)ax^2 + bx + c = 0 \quad (a \neq 0)

has solutions given by the quadratic formula:

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

This single formula works for every quadratic equation — whether it has two real roots, one repeated root, or two complex roots.

Understanding the Discriminant

The expression under the square root is called the discriminant:

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

The discriminant tells you the nature of the roots before you even solve:

  • Δ>0\Delta > 0 — Two distinct real roots
  • Δ=0\Delta = 0 — One repeated real root (a perfect square)
  • Δ<0\Delta < 0 — Two complex conjugate roots

Worked Examples

Example 1: Two Real Roots

Solve 2x27x+3=02x^2 - 7x + 3 = 0.

Here a=2a = 2, b=7b = -7, c=3c = 3. First, compute the discriminant:

Δ=(7)24(2)(3)=4924=25\Delta = (-7)^2 - 4(2)(3) = 49 - 24 = 25

Since Δ=25>0\Delta = 25 > 0, we get two distinct real roots:

x=(7)±2522=7±54x = \frac{-(-7) \pm \sqrt{25}}{2 \cdot 2} = \frac{7 \pm 5}{4} x1=7+54=3,x2=754=12x_1 = \frac{7 + 5}{4} = 3, \qquad x_2 = \frac{7 - 5}{4} = \frac{1}{2}

Example 2: Repeated Root

Solve x26x+9=0x^2 - 6x + 9 = 0.

Δ=(6)24(1)(9)=3636=0\Delta = (-6)^2 - 4(1)(9) = 36 - 36 = 0

One repeated root:

x=62=3x = \frac{6}{2} = 3

This makes sense because x26x+9=(x3)2x^2 - 6x + 9 = (x - 3)^2.

Example 3: Complex Roots

Solve x2+2x+5=0x^2 + 2x + 5 = 0.

Δ=420=16\Delta = 4 - 20 = -16

Since Δ<0\Delta < 0:

x=2±162=2±4i2=1±2ix = \frac{-2 \pm \sqrt{-16}}{2} = \frac{-2 \pm 4i}{2} = -1 \pm 2i

The roots are x=1+2ix = -1 + 2i and x=12ix = -1 - 2i.

Deriving the Formula: Completing the Square

Where does the quadratic formula come from? Start with the general equation and complete the square:

ax2+bx+c=0ax^2 + bx + c = 0

Divide both sides by aa:

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

Move the constant term:

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

Add (b2a)2\left(\frac{b}{2a}\right)^2 to both sides to complete the square:

x2+bax+b24a2=b24a2cax^2 + \frac{b}{a}x + \frac{b^2}{4a^2} = \frac{b^2}{4a^2} - \frac{c}{a}

The left side is now a perfect square:

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

Take the square root 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

For a quadratic ax2+bx+c=0ax^2 + bx + c = 0 with roots x1x_1 and x2x_2:

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

These relationships are useful for checking your answers. For Example 1 above: 3+12=72=723 + \frac{1}{2} = \frac{7}{2} = -\frac{-7}{2} and 312=32=323 \cdot \frac{1}{2} = \frac{3}{2} = \frac{3}{2}. Both check out.

Vertex Form and the Parabola

A quadratic function f(x)=ax2+bx+cf(x) = ax^2 + bx + c graphs as a parabola. The vertex is at:

(b2a,  f ⁣(b2a))\left(-\frac{b}{2a},\; f\!\left(-\frac{b}{2a}\right)\right)

Notice that b2a-\frac{b}{2a} is exactly the midpoint of the two roots — the axis of symmetry of the parabola passes right between them.

When to Use the Quadratic Formula

The quadratic formula always works, but it’s not always the fastest method:

  • Factoring is quicker when the roots are “nice” integers or simple fractions.
  • Completing the square is useful when you need the vertex form.
  • The quadratic formula is the reliable fallback when factoring isn’t obvious.

Quick Reference

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