An equation of the form $ax^2 + bx + c = 0$ can be solved using the *quadratic formula*. This is particularly useful when the left hand side cannot be easily factorised.

The quadratic formula is \[x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}\]

We can derive the formula by first multiplying the general quadratic equation $ax^2 + bx + c$ through by $a$ and then completing the square.

\begin{align} a^2x^2 + abx + ac &=a^2\left(x^2+\frac{b}{a}x+\frac{c}{a}\right)\\ &=a^2\left(\left(x+\frac{b}{2a}\right)^2-\left(\frac{b}{2a}\right)^2+\frac{c}{a}\right)\\ &=a^2\left(\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}+\frac{c}{a}\right)\\ &=a^2\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4}+ac\\ \end{align}

So we have to solve \[a^2\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4}+ac = 0\]

Rearranging this and making $x$ the subject will give the quadratic formula.

\begin{align} a^2\left(x+\frac{b}{2a}\right)^2&= \frac{b^2}{4}-ac\\\\ \Rightarrow \left(x+\frac{b}{2a}\right)^2 &=\frac{b^2}{4a^2}-\frac{c}{a} \\\\ \Rightarrow \left(x+\frac{b}{2a}\right)^2 &=\frac{b^2-4ac}{4a^2} \\\\ \Rightarrow x+\frac{b}{2a} &=\pm\sqrt{\frac{b^2-4ac}{4a^2}} \\\\ \Rightarrow x+\frac{b}{2a} &=\pm\frac{\sqrt{b^2-4ac}}{2a}\\\\ \Rightarrow x &=-\frac{b}{2a} \pm \frac{\sqrt{b^2-4ac}}{2a}\\\\ \Rightarrow x &= \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{align}

The *discriminant* is used to find out how many real roots a quadratic has. The formula for the discriminant is \[b^2-4ac\] The quadratic formula uses the square root of the discriminant.

When the discriminant is $\gt 0$, there are **two** real roots.

When the discriminant is $=0$, there is **one** repeated real root.

When the discriminant is $\lt 0$, there are **no** real roots (however, there are two complex roots).

How many real roots does the equation $x^2-2x+3=0$ have?

$ a=1,\;b=-2,\;c=3$.

Calculate the discriminant: \begin{align} b^2-4ac &= (-2)^2-(4 \times1\times 3)\\ &=4-12\\ &=-8 \end{align}

The discriminant is **negative**, so there are **no real roots**.

This is the graph of $f(x) = x^2-2x+3$. The curve intersects the $x$-axis when $x^2-2x+3=0$. As it does not, there is no value of $x$ that satisfies $x^2-2x+3=0$ and the equation has no real roots.

How many real roots does the equation $2x^2+4x-1=0$ have?

$ a=2,\;b=4,\;c=-1 $

\begin{align} b^2-4ac &= 4^2-4 \times2\times (-1)\\ &=16+8\\ &=24\\ \end{align}

The discriminant is **positive**, so the equation has **two real roots**.

This is the graph of $f(x) = 2x^2+4x-1$. The curve intersects the $x$-axis when $2x^2+4x-1=0$. We can see that it crosses the $x$ axis twice, so the equation has two roots.

How many real roots does the equation $3x^2-6x+3=0$ have?

$ a=3,\;b=-6,\;c=3 $

\begin{align} b^2-4ac &= (-6)^2-(4 \times3\times3)\\ &=36-36\\ &=0 \end{align}

The discriminant is **zero**, so the equation has **one repeated root**.

This is the graph of $f(x) = 3x^2-6x+3$. The curve intersects the $x$-axis when $3x^2-6x+3=0$. We can see that it just touches the $x$-axis at its unique minimum and therefore has one repeated root.

Solve the equation $x^2+4x-1=0$.

$ a=1,\;b=4,\;c=-1 $

First of all, the discriminant $b^2-4ac = 4^2 - 4 \times 1 \times (-1) = 20$ is positive, so we can say that the equation has two real roots. Now we use the quadratic formula to find them.

\begin{align} x &= \frac{-b \pm \sqrt{b^2 - 4ac} }{2a}\\\\ &= \frac{-4 \pm \sqrt{4^2 - (4\times1\times(-1))} }{2}\\\\ &= \frac{-4 \pm \sqrt{16+4} }{2}\\\\ &= \frac{-4 \pm \sqrt{20} }{2}\\\\ &= \frac{-4}{2} \pm \frac{2\sqrt{5} }{2}\\\\ &= -2 \pm \sqrt{5} \end{align}

The roots of the equation are $x_1=-2 + \sqrt{5}$ and $x_2 = -2 - \sqrt{5}$.

This is the graph of $f(x) = x^2+4x-1$. The curve intersects the $x$-axis when $x^2+4x-1=0$. We can see that it crosses the $x$ axis twice, so the equation has two roots.

Solve the equation $3x^2-6x+3=0$.

$ a=3,\;b=-6,\;c=3 $

The discriminant $b^2 - 4ac = (-6)^2 - 4 \times 3 \times 3 = 0$, so the equation has a single, repeated root. Now we use the quadratic formula to find it.

\begin{align} x &= \frac{-b \pm \sqrt{b^2 - 4ac} }{2a}\\\\ &= \frac{6 \pm \sqrt{(-6)^2 - (4\times3\times3)} }{2\times3}\\\\ &= \frac{6 \pm \sqrt{36- 36} }{6}\\\\ &= \frac{6 \pm 0}{6}\\\\ &= \frac{6}{6}\\\\ &= 1 \end{align}

The only solution to the equation is $x=1$.

This is the graph of $f(x) = 3x^2-6x+3$. The curve intersects the $x$-axis when $3x^2-6x+3=0$. We can see that it touches the $x$ axis at its unique minimum, so the equation has one repeated root.

Prof. Robin Johnson finds the discriminants of three quadratic equations, then uses the quadratic formula to solve them.

- The Quadratic Formula worksheet at
**math**centre. - How to use the quadratic formula videos at Khan Academy.