Solving Quadratic Equation Using Discriminant

We already know how to solve quadratic equation that has no linear term or no constant. But how to solve a quadratic equation that has all its terms? One way – the ultimate one – is to compute the discriminant.

Recall that the quadratic equation is an equation in the form

ax2 + bx + c = 0,      where a, b, c ∈ ℝ and a≠0.

We denote the discriminant by the capital D. The discriminant is a real number that equals

D = b2 − 4 · a · c.

Take as an example the equation 2x2 − 9x + 7 = 0. First, we identify the coefficients:

  • a = 2, b = − 9 and c = 7.

Then we can compute the discriminant:

D = ( − 9)2 − 4 · 2 · 7 = 81 − 56 = 25.

Ok, we have the discriminant. What’s it good for? We can infer from it the number of real roots of the equation:

  • if D > 0 then the equation has two distinguish real roots.
  • if D = 0 then the equation has a single real root.
  • id D < 0 then the equation has no real root.

Now we can use the discriminant to compute the roots. We just use another magic formula:

x_{1,2} = \frac{-b\pm \sqrt{D}}{2a}

As you can see, we used the ± symbol to denote that the formula produces two outcomes: one with plus sign and one with minus sign. We can rewrite the formula this way (see the sign before the discriminant):

\begin{eqnarray}x_1 &=& \frac{-b + \sqrt{D}}{2a}\\\\x_2 &=& \frac{-b - \sqrt{D}}{2a}\end{eqnarray}

Now we can substitute all the coefficients and we can compute all the roots of our equation:

\begin{eqnarray}x_1 &=& \frac{-b + \sqrt{D}}{2a}\\\\x_1 &=& \frac{-(-9) + \sqrt{25}}{2\cdot2}\\\\x_1 &=& \frac{9 + 5}{4}\\\\x_1 &=& \frac{14}{4} = \frac{7}{2}\end{eqnarray}

The first root equals 7/2. What about the second?

\begin{eqnarray}x_2 &=& \frac{-b - \sqrt{D}}{2a}\\\\x_2 &=& \frac{-(-9) - \sqrt{25}}{2\cdot2}\\\\x_2 &=& \frac{9 - 5}{4}\\\\x_2 &=& \frac{4}{4} = 1\end{eqnarray}

The second root is a lot of nicer, it’s just one. In the end we’ve got our two roots: x1 = 7/2 and x2 = 1. See the graph of the quadratic function f(x) = 2x2 − 9x + 7:

Graph of a function 2x^2-9x+7

We can see that the graph intersects the horizontal axis in two points: (1, 0) and (7/2, 0).