Formula

Quadratic formula

Also written: quadratic equation formula · solving quadratics formula

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

The quadratic formula gives both solutions of any equation in the form ax² + bx + c = 0, whether or not it factors.

What each part means

aa
the coefficient of x², and never zero
bb
the coefficient of x
cc
the constant term
±\pm
read the formula twice, once with plus and once with minus

When to use it

The equation is quadratic and either does not factor or would take too long to try. It always works, so it is the fallback when factoring stalls.

Before you use it

Rearrange the equation so one side is zero. The formula reads aa, bb and cc off the standard arrangement ax2+bx+c=0ax^2 + bx + c = 0, and reading them off anything else gives the wrong answer.

Keep the signs with the numbers. In 2x25x+3=02x^2 - 5x + 3 = 0, the value of bb is 5-5.

Where the formula comes from

It is completing the square, done once on the general equation instead of every time on numbers.

Start from ax2+bx+c=0ax^2 + bx + c = 0, divide by aa, then move the constant across:

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

Add the square of half the xx coefficient to both sides:

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, and the right side goes over a common denominator:

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

Take the square root of both sides, which is where ±\pm appears, and subtract b2a\tfrac{b}{2a}:

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

Full walkthrough in completing the square.

Worked examples

Solve x25x+6=0x^2 - 5x + 6 = 0.

Here a=1a = 1, b=5b = -5, c=6c = 6.

x=5±25242=5±12x = \frac{5 \pm \sqrt{25 - 24}}{2} = \frac{5 \pm 1}{2}

So x=3x = 3 or x=2x = 2.

Solve 2x2+3x1=02x^2 + 3x - 1 = 0.

Here a=2a = 2, b=3b = 3, c=1c = -1.

x=3±9+84=3±174x = \frac{-3 \pm \sqrt{9 + 8}}{4} = \frac{-3 \pm \sqrt{17}}{4}

This one does not factor over the whole numbers, which is exactly when the formula earns its place.

The part under the root

b24acb^2 - 4ac is the discriminant. Computing it first tells you how many real solutions to expect, and warns you before you take the root of a negative.

Lessons that teach this

Related