Quadratic Formula and the Discriminant

Solves ax² + bx + c = 0 with the discriminant D = b² − 4ac and the quadratic formula x = (−b ± √D) ÷ 2a.

A quadratic equation ax2+bx+c=0ax^2 + bx + c = 0 is solved by the quadratic formula. Supply the three coefficients and the real roots drop out.

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

The quantity under the square root, D=b24acD = b^2 - 4ac, is the discriminant, and its sign alone decides how many real solutions exist.

Example

Take a=1a = 1, b=5b = -5, c=6c = 6, that is x25x+6=0x^2 - 5x + 6 = 0. The discriminant is

D=(5)24×1×6=2524=1D = (-5)^2 - 4 \times 1 \times 6 = 25 - 24 = 1

Positive, so there are two real roots:

x=5±12=5±12x = \dfrac{5 \pm \sqrt{1}}{2} = \dfrac{5 \pm 1}{2}

giving x1=3x_1 = 3 and x2=2x_2 = 2. The factorisation x25x+6=(x2)(x3)x^2 - 5x + 6 = (x - 2)(x - 3) confirms it.

Notes