Skip to content
Tutorials Center
My learning

Topics

Lesson 31 of 86 ยท Algebra, Geometry and Calendars

Quadratic Equations and Inequalities

Solve quadratic equations by factoring or the formula, use the discriminant and sum and product of roots, and solve inequalities with the sign method.

A quadratic equation has the form ax squared + bx + c = 0, with a not equal to zero. It appears in aptitude tests in two ways: directly ("find the roots"), and hidden inside word problems about areas, ages, speeds and consecutive numbers. Banking-style exams add a favourite format: two quadratics are given and you compare the sizes of their roots.

In this lesson you will learn to solve a quadratic by factoring and by the formula, to read the nature of the roots from the discriminant, to use the sum and product of roots without solving at all, and to solve inequalities by looking at signs. Two scripts at the end let you check your work.

Solving by factoring

If you can write the quadratic as a product of two brackets, set each bracket to zero. For x squared - 7x + 12 = 0, find two numbers that multiply to 12 and add to -7: they are -3 and -4. So (x - 3)(x - 4) = 0 and the roots are x = 3 and x = 4.

When a is not 1, split the middle term. For 2x squared + 5x - 3 = 0, the product a x c is -6, and you need two numbers that multiply to -6 and add to 5: they are 6 and -1. Then

2x squared + 6x - x - 3 = 2x(x + 3) - 1(x + 3) = (2x - 1)(x + 3),

so the roots are x = 1/2 and x = -3.

The quadratic formula and the discriminant

Factoring does not always work with whole numbers, but the formula always does:

x = (-b + or - the square root of D) / 2a, where D = b squared - 4ac

The quantity D is the discriminant. It tells you what to expect before you calculate:

Discriminant Roots
D greater than 0 Two different real roots
D equal to 0 Two equal real roots, x = -b / 2a
D less than 0 No real roots (a complex pair)

For 2x squared + 5x - 3 = 0, D = 25 + 24 = 49, the square root is 7, and x = (-5 + or - 7) / 4, which gives 1/2 and -3, matching the factoring. For x squared + 2x + 5 = 0, D = 4 - 20 = -16, so there are no real roots. If D is a perfect square and a, b, c are integers, the roots are rational and the equation factors neatly.

flowchart TB
    A["ax^2 + bx + c = 0"] --> B["D = b^2 - 4ac"]
    B --> C{"Sign of D"}
    C -->|"D > 0"| D["Two real roots<br/>(-b ยฑ sqrt(D)) / 2a"]
    C -->|"D = 0"| E["One repeated root<br/>-b / 2a"]
    C -->|"D < 0"| F["No real roots"]

Compute D first; it decides which case you are in.

Equal roots. To find k so that x squared + kx + 9 = 0 has equal roots, set D = 0: k squared - 36 = 0, so k = 6 or k = -6.

Sum and product of roots

If the roots are alpha and beta, then

  • alpha + beta = -b / a
  • alpha x beta = c / a

This lets you answer many questions without finding the roots.

Example 1 (build an equation). Roots 2 and -5: sum is -3 and product is -10. The equation is x squared - (sum)x + product = 0, which is x squared + 3x - 10 = 0.

Example 2 (symmetric expressions). The roots of x squared - 5x + 3 = 0 are alpha and beta, with sum 5 and product 3. Then:

  • alpha squared + beta squared = (sum) squared - 2(product) = 25 - 6 = 19.
  • 1/alpha + 1/beta = (alpha + beta) / (alpha beta) = 5/3.

Note that the roots here are irrational (about 0.697 and 4.303), yet the answers come out cleanly without finding them.

Example 3 (roots related). If one root of x squared - 8x + k = 0 is three times the other, let the roots be r and 3r. The sum is 4r = 8, so r = 2 and the roots are 2 and 6. The product is k = 12.

A root finder you can edit

This script computes the discriminant, the roots, and the sum and product for any coefficients. Check that sum and product agree with -b/a and c/a.

JS Quadratic root finder

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Comparing two quadratics

A frequent exam format gives one quadratic in x and another in y, then asks whether x is greater than, less than or equal to y. Solve both, then compare every root of one with every root of the other.

Example 4. I: x squared - 5x + 6 = 0 and II: y squared - 9y + 20 = 0. Equation I gives (x - 2)(x - 3) = 0, so x = 2 or 3. Equation II gives (y - 4)(y - 5) = 0, so y = 4 or 5. Every y is bigger than every x, so y > x. If the ranges overlap, the answer is "cannot be determined".

Inequalities and the sign method

An inequality asks for a range of values, not exact ones. The golden rule: when you multiply or divide both sides by a negative number, reverse the sign. So -3x + 6 > 0 becomes -3x > -6, then x < 2.

For a quadratic inequality, find the roots first, then decide the sign of the expression in each region.

  • For a positive leading coefficient, the parabola opens upward: the expression is negative between the roots and positive outside them.
  • (x - 2)(x - 5) < 0 gives 2 < x < 5.
  • (x - 2)(x - 5) >= 0 gives x <= 2 or x >= 5.
  • x squared - 9 <= 0 gives (x - 3)(x + 3) <= 0, so -3 <= x <= 3.

For a fraction such as (x - 1)(x - 4) / (x + 2) >= 0, mark the critical points -2, 1 and 4 on a number line, then test one point in each region. The sign is positive for x > 4, negative on (1, 4), positive on (-2, 1), negative for x < -2. So the solution is -2 < x <= 1 or x >= 4. The point x = -2 is excluded because it makes the denominator zero.

This script checks these inequalities by testing every integer in a range.

JS Test inequalities by scanning

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Quadratics in word problems

Many word problems turn into quadratics. Consecutive integers whose product is 56 give n(n + 1) = 56, so n squared + n - 56 = 0, which factors as (n + 8)(n - 7) = 0. Take the positive solution: 7 and 8. A rectangular garden with area 120 and perimeter 44 has length plus width 22 and length times width 120, so the sides are the roots of x squared - 22x + 120 = 0, which gives 10 and 12. Always reject roots that make no physical sense, such as a negative length or a fractional number of people.

Common mistakes

  • Forgetting to reverse the inequality sign after dividing by a negative number.
  • Writing the sum of roots as b / a instead of -b / a.
  • Cancelling a common factor containing x instead of factoring it out (that loses a root).
  • Including a point that makes a denominator zero.
  • Treating "greater than or equal" and "greater than" the same way at the endpoints.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What are the roots of x squared - 9x + 20 = 0?

    Two numbers with product 20 and sum 9 are 4 and 5, so (x - 4)(x - 5) = 0.
  2. 2. For which value of k does 4x squared + kx + 25 = 0 have equal roots (take k positive)?

    Equal roots need D = 0: k squared - 4 x 4 x 25 = 0, so k squared = 400 and k = 20.
  3. 3. The roots of x squared - 6x + 4 = 0 are alpha and beta. What is alpha squared + beta squared?

    Sum = 6 and product = 4, so alpha squared + beta squared = 6 x 6 - 2 x 4 = 28.
  4. 4. Which values of x satisfy x squared - 4x - 5 < 0?

    x squared - 4x - 5 = (x - 5)(x + 1). It is negative between the roots -1 and 5.

Summary

  • Solve ax squared + bx + c = 0 by factoring, or with x = (-b + or - the square root of D) / 2a.
  • The discriminant D = b squared - 4ac gives two, one or no real roots when D is positive, zero or negative.
  • Sum of roots = -b / a and product = c / a; many questions need no root-finding at all.
  • When comparing two quadratics, compare all roots of one with all roots of the other.
  • Reverse an inequality when multiplying by a negative; a positive upward quadratic is negative between its roots.

Next: Arithmetic and Geometric Progressions, where terms follow a rule you can sum.