Quadratic Formula

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

The quadratic formula gives the solutions to any quadratic equation ax2+bx+c=0ax^2 + bx + c = 0 where a0a \neq 0:

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

The discriminant

The expression under the square root, Δ=b24ac\Delta = b^2 - 4ac, is called the discriminant:

  • Δ>0\Delta > 0: two distinct real roots
  • Δ=0\Delta = 0: one repeated real root
  • Δ<0\Delta < 0: two complex conjugate roots

Derivation by completing the square

Starting from ax2+bx+c=0ax^2 + bx + c = 0:

  1. Divide by aa: x2+bax+ca=0x^2 + \frac{b}{a}x + \frac{c}{a} = 0
  2. Move constant: x2+bax=cax^2 + \frac{b}{a}x = -\frac{c}{a}
  3. Complete the square: (x+b2a)2=b24ac4a2\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}
  4. Take square root: x+b2a=±b24ac2ax + \frac{b}{2a} = \pm\frac{\sqrt{b^2 - 4ac}}{2a}
  5. Solve for xx: x=b±b24ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Vieta's formulas

For roots x1,x2x_1, x_2:

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