Inequality solver: the interval method, step by step
Linear, quadratic, rational and double inequalities: the solver marks the points on the number line, fills in the signs taking multiplicity into account, picks the intervals and checks the answer by substitution.
x^2 - 5x + 6 > 0
(x + 3)/(x - 2) >= 0
(x - 1)^2(x + 2) <= 0
2(x - 1) <= 5x + 4
-1 < 2x + 3 <= 5
x^2 + x + 1 < 0
1/x < 1
Loading the solver…
What you can type
An inequality in one unknown whose two sides are polynomials or fractions of polynomials. Signs: “less than” and “greater than”, the non-strict ≤ and ≥ (you can type them as two characters: first the “less than” or “greater than” sign, then “equals”) and “not equal” ≠. Examples: x^2 - 5x + 6 > 0, (x + 3)/(x - 2) >= 0, 1/x < 1. A double inequality is written as a chain: -1 < 2x + 3 <= 5.
Inequalities with an absolute value, a root, a logarithm or an exponential are solved by other techniques; the solver doesn’t take them yet and will say so. The same goes for systems of several inequalities: solve each one and take the common part of the answers.
Linear inequalities: one difference from equations
You can do almost everything with inequalities that you do with equations: expand brackets, collect like terms, move terms across with the opposite sign, multiply and divide both sides by a positive number. There is one difference, but an important one: multiplying or dividing by a negative number reverses the inequality sign. Check it with numbers: $2 < 3$, but after multiplying by $-1$ we get $-2 > -3$.
For example, $2(x - 1) \le 5x + 4$. Expand the brackets and move terms across: $2x - 5x \le 4 + 2$, that is, $-3x \le 6$. Divide by $-3$ and reverse the sign: $x \ge -2$. Answer: $x \in [-2, +\infty)$. The square bracket at $-2$ is there because the inequality is non-strict and the point itself works; at infinity the bracket is always round.
A double inequality $-1 < 2x + 3 \le 5$ is solved in all three parts at once: subtract $3$ to get $-4 < 2x \le 2$, then divide by $2$: $-2 < x \le 1$.
The interval method: six steps
For anything more complicated than a linear inequality, one method works. In English-language textbooks it’s often drawn as a sign chart.
- Everything on one side. Leave zero on the right: $f(x) > 0$, $f(x) \le 0$ and so on. Now only the sign of the expression matters.
- A single fraction. If there are denominators, bring everything over a common one. You mustn’t multiply both sides by the denominator: its sign depends on $x$.
- Zeros. Find where the numerator and the denominator vanish, and factorise them.
- Points on the line. Fill in the zeros of the numerator if the inequality is non-strict, and leave them hollow if it is strict. The zeros of the denominator are always hollow: the expression isn’t defined there.
- Signs. On the rightmost interval the sign matches the sign of the leading coefficient (for a fraction, of the ratio of the leading coefficients). Moving from right to left, change the sign at each point of odd multiplicity and keep it at points of even multiplicity. To be safe, you can check the sign on any interval by substituting a number from it.
- Choose. Take the intervals with the sign you need and add the filled-in points.
Why the signs alternate
Factorise the expression. Each factor of the form $x - a$ is negative to the left of $a$ and positive to the right: it changes sign only at its own point. The sign of a product or quotient is the product of the signs of the factors. So between neighbouring marked points the sign of the whole expression doesn’t change, and when we pass through a point $a$, only the factor $(x - a)^k$ changes sign, and only if $k$ is odd: an even power is never negative.
The graph of $y = f(x)$ shows the same answer: the inequality $f(x) > 0$ holds where the graph is above the $x$-axis, and $f(x) < 0$ where it’s below. The zeros are the points where the graph touches or crosses the axis, and the zeros of the denominator are vertical asymptotes. The solver shows both the sign chart and the graph.
Worked examples
Example 1. Quadratic: $x^2 - 5x + 6 > 0$
The roots of the quadratic are $2$ and $3$, that is, $x^2 - 5x + 6 = (x - 2)(x - 3)$. The points are hollow: the inequality is strict. To the right of $3$ the sign is “$+$” (the leading coefficient is $1 > 0$), on $(2, 3)$ it’s “$-$”, and to the left of $2$ it’s “$+$”. We need “$+$”: $x \in (-\infty, 2) \cup (3, +\infty)$. On the graph these are the branches of the parabola above the axis.
Example 2. Rational: $\frac{x + 3}{x - 2} \ge 0$
The zero of the numerator, $-3$, is filled in (the inequality is non-strict); the zero of the denominator, $2$, is hollow. Signs from right to left: “$+$”, “$-$”, “$+$”. Answer: $x \in (-\infty, -3] \cup (2, +\infty)$. The point $2$ isn’t in the answer even though the sign is $\ge$: you can’t divide by zero.
Example 3. A point of even multiplicity: $(x - 1)^2(x + 2) \le 0$
The points are $-2$ and $1$, both filled in. To the right of $1$ it’s “$+$”; through $1$ (multiplicity 2) the sign doesn’t change, so on $(-2, 1)$ it’s “$+$” too; through $-2$ it changes, so to the left it’s “$-$”. We need “$-$” or zero: $x \in (-\infty, -2] \cup \{1\}$. The lonely point $\{1\}$ is the one most often lost: the intervals around it don’t work, but at the point itself the expression is zero, and the non-strict inequality holds.
Example 4. A trap: $\frac{1}{x} < 1$
It’s tempting to multiply by $x$ and get $1 < x$. But for $x < 0$ the sign would have to be reversed, and the answer $x > 1$ loses all the negative numbers, for example $x = -5$: $-\frac15 < 1$. The right way: $\frac{1}{x} - 1 < 0$, that is, $\frac{1 - x}{x} < 0$. The points are $0$ and $1$, both hollow; to the right of $1$ the sign is “$-$” (the ratio of the leading coefficients is $\frac{-1}{1}$), on $(0, 1)$ it’s “$+$”, and to the left of $0$ it’s “$-$”. Answer: $x \in (-\infty, 0) \cup (1, +\infty)$.
Common mistakes
- Multiplying by the denominator. As in Example 4, this loses half the answer. First a single fraction, then the interval method.
- Forgetting to reverse the sign when dividing by a negative number: $-3x \le 6$ gives $x \ge -2$, not $x \le -2$.
- Alternating the signs blindly. At a point of even multiplicity the sign doesn’t change: for $(x - 1)^2(x + 2)$ the signs to the right and left of one are the same.
- Filling in the zeros of the denominator. With a non-strict inequality, fill in only the zeros of the numerator; at the zeros of the denominator the expression doesn’t exist.
- Losing isolated points. $(x - 1)^2 \le 0$ has the solution $x = 1$, not “no solutions”.
- Answering “no solutions” to every question when $D < 0$. $x^2 + x + 1 < 0$ really has no solutions, but $x^2 + x + 1 > 0$ holds for every $x$: a quadratic with no roots and a positive leading coefficient is positive everywhere.
- Putting a square bracket at infinity. $[3, +\infty)$, but never $[3, +\infty]$: infinity isn’t a number and doesn’t belong to the interval.
See also
Inequalities, systems and linear programming are in the chapter on systems of equations and inequalities. The roots of a quadratic are found by the quadratic equation solver, the roots of higher-degree polynomials and their multiplicities by the higher-degree equation solver; if you replace the inequality sign with “$=$”, the linear equation solver comes in handy too. What a parabola looks like and where it lies above the axis is in the chapter on quadratic equations.
Where this is explained
Other solvers
- Quadratic equation
- Linear equation
- System of linear equations
- Higher-degree equations and factoring
- Derivative
- Integral
- Limit
- Curve sketching
- Fraction arithmetic
- GCD, LCM and Euclid's algorithm
- Prime factorisation
- Solving a triangle
- Matrices: determinant, inverse, rank, eigenvalues
- Trigonometric equation
- Exponential and logarithmic equations
- Percentages, compound interest, loans
- Permutations and combinations
- Number bases
- Complex numbers
- Congruences
- Progressions
- Probability: Bayes and Bernoulli trials
- Differential equation