# 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:

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):

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

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

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:

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