letx=

Algebra

Quadratic formula

Solves any quadratic equation ax2+bx+c=0 from its three coefficients, including the cases with one root or complex roots.

x=−b±b2−4ac2a

Calculator

The live calculator needs JavaScript. The worked example below shows the same steps it would.

See it move

−8−6−4−22468−8−6−4−22468vertex
  • Vertex (1, −8); axis of symmetry x = 1
  • D = 64 > 0: two real roots, x = −1 and x = 3

What the symbols mean

x
the solutions (roots) of the equation: the x-values where ax2+bx+c equals 0
a
the coefficient of x2; it must not be 0, or the equation is not quadratic
b
the coefficient of x (use 0 if there is no x term)
c
the constant term (use 0 if there is none)
±
"plus or minus": take + for one root and − for the other

When to use it

Use it for any equation that can be rearranged into the form ax2+bx+c=0, especially when it does not factorise neatly. First move every term to one side and make the other side 0; then read off a, b and c with their signs. If the equation factorises easily (like x2−5x+6=0), factorising is quicker, but the formula always works.

Worked example

Solve 2x² − 4x − 6 = 0. Here a = 2, b = −4 and c = −6.

  1. Use the quadratic formula with a=2, b=−4, c=−6.

    x=−b±b2−4ac2a
  2. Work out the discriminant, the part under the square root.

    D=b2−4⁢a⁢c
    =(−4)2−4·2·(−6)
    =16−8·(−6)
    =16−(−48)
    =64
  3. D is positive, so there are two different real roots.

  4. Take the + sign:

    x1=−b+D2⁢a
    =−(−4)+642·2
    =4+84
    =124
    =3
  5. Take the − sign:

    x2=−b−D2⁢a
    =−(−4)−642·2
    =4−84
    =−44
    =−1

Answer x = 3 or x = −1

Why it works

It comes from completing the square on ax2+bx+c=0: divide by a, move c/a across, add (b/2a)2 to both sides so the left side becomes (x+b/2a)2, then take the square root of both sides. The ± appears because both the positive and the negative square root square to the same number.

Common mistakes

  • Dropping the sign of b: with b = −4, the top starts −b=−(−4)=+4, and b2=(−4)2=16, not −16.
  • Dividing only the square root by 2a. The whole numerator, −b±b2−4ac, is over 2a.
  • Using the formula before the equation equals 0. x2+3x=10 must first become x2+3x−10=0, so c = −10.
  • Stopping at "no solution" when the discriminant is negative: there are no real roots, but there are two complex ones.