Algebra & Equations

Inequality Calculator

Solve linear, compound, absolute-value, quadratic and rational inequalities in x, with every step shown free.

Try

Use <, >, ≤ (<=), ≥ (>=) or ≠ (!=), and |…| for absolute value. For a compound inequality, chain the signs or join two parts with "and" or "or".

Result

Solution: (−2, 8)

Solution

x∈(−2,8)x \in \left(-2, 8\right)

Interval notation
(−2,8)\left(-2, 8\right)
Set-builder notation
{x∣−2<x<8}\left\{x \mid -2 < x < 8\right\}
Type of inequality
Absolute value
Endpoints of the solution
x = −2, x = 8
Number of solution intervals
1

The inequality holds for x in (−2, 8), that is, −2 < x < 8.

Graph each side in the graphing calculator: the solution is every x where the graphs compare the way the inequality says.

Solution of |x − 3| < 5
−4−20246810−238
Cases for |x − 3| < 5
Part or caseWhereInequality on this pieceSolution on this piece
Case 1x ≥ 3x − 8 < 0[3, 8)
Case 2x < 3−x − 2 < 0(−2, 3)
Step-by-step working (5 steps)
  1. Solve: |x − 3| < 5

    An absolute value changes form where its inside is zero, here at x = 3. Where the inside is positive or zero |A| = A, and where it is negative |A| = −A. Solve each case on its own piece of the number line, then combine the cases.

  2. Case 1: x ≥ 3

    Here |x − 3| = x − 3, so the comparison becomes x − 8 < 0. Move the constant across: x < 8. Keeping only x ≥ 3 gives [3, 8).

  3. Case 2: x < 3

    Here |x − 3| = −(x − 3), so the comparison becomes −x − 2 < 0. Isolate x: −x < 2. Divide both sides by −1, a negative number, so the inequality sign flips: x > −2. Keeping only x < 3 gives (−2, 3).

  4. Combine the cases

    Union of the cases: (−2, 8).

  5. Write the solution

    x∈(−2,8)x \in \left(-2, 8\right)

Type something like |x−3|<5|x - 3| < 5 or −3<2x+1≤5-3 < 2x + 1 \le 5. You get the answer in interval and set-builder notation, the working, and a number line.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Type the inequality with <, >, <= (≤), >= (≥) or != (≠), for example 2x + 3 > 5 - x or x^3 - 4x >= 0. Both sides may contain x.
  2. For a compound inequality, chain the signs, as in -3 < 2x + 1 <= 5, or join two parts with "and" or "or", as in x < -1 or x > 4.
  3. For an absolute value inequality, use bars or abs: |2x + 1| >= 7 or abs(x + 2) < 3.
  4. Fractions such as (x + 1)/(x - 2) are allowed, and values that make a denominator zero are excluded automatically. Use ^ for powers. Functions such as sin, sqrt or ln of x are not supported.
  5. Read the answer in interval notation at the top, then follow the steps and the sign chart or case table to see why each interval is in or out.

Formulas

Flipping the sign

a<bandk<0⇒ka>kba < b \;\text{and}\; k < 0 \;\Rightarrow\; ka > kb

Plain-text formula: a < b and k < 0 ⇒ ka > kb

Adding or subtracting the same number, or multiplying or dividing by a positive number, keeps the direction of an inequality. Multiplying or dividing both sides by a negative number reverses it: from −2x ≥ 6, dividing by −2 gives x ≤ −3.

Absolute value inequalities

|A|<c⇔−c<A<c,|A|>c⇔A<−corA>c(c>0)|A| < c \iff -c < A < c, \qquad |A| > c \iff A < -c \;\text{or}\; A > c \qquad (c > 0)

Plain-text formula: |A| < c ⇔ − c < A < c, |A| > c ⇔ A < −c or A > c (c > 0)

|A| is the distance of A from 0. "Less than c" keeps A between −c and c, which is one compound "and" inequality. "Greater than c" pushes A beyond either end, which gives two pieces joined by "or". The calculator uses the general form of the same idea: it splits at the zero of the inside and removes the bars on each side.

Sign chart method

f(x)=N(x)D(x)changes sign only whereN(x)=0orD(x)=0f(x) = \frac{N(x)}{D(x)} \;\text{changes sign only where}\; N(x) = 0 \;\text{or}\; D(x) = 0

Plain-text formula: f(x) = (N(x))/(D(x)) changes sign only where N(x) = 0 or D(x) = 0

A polynomial or rational function is continuous wherever it is defined, so it can only change sign at a zero or at a point where the denominator vanishes. Between those critical points the sign is constant, and one test value decides each interval.

Interval notation

(a,b)={x∣a<x<b},[a,b]={x∣a≤x≤b}(a, b) = \{x \mid a < x < b\}, \quad [a, b] = \{x \mid a \le x \le b\}

Plain-text formula: (a, b) = {x∣a < x < b}, [a, b] = {x∣a ≤ x ≤ b}

A parenthesis means the endpoint is not included and a bracket means it is. Infinity always gets a parenthesis, and separate pieces are joined with ∪ (union).

Reading the result

The solution set is every x that makes the inequality true. With a strict sign (< or >) the boundary points are left out; with ≤ or ≥ they are included. Values that make a denominator zero are always left out, because the expression is undefined there.

For a compound inequality, "and" (or a chain such as −3 < 2x + 1 ≤ 5) keeps only the overlap of the parts, so the answer is usually one bounded interval. "Or" keeps everything that satisfies at least one part, so the answer often has two pieces joined by ∪.

Two outcomes deserve a closer look. No solution (∅) means nothing works, as with (x−3)2<0(x - 3)^2 < 0: a square is never negative. All real numbers means everything works, as with x2+1>0x^2 + 1 > 0. A result such as (−∞,0)∪(0,∞)(-\infty, 0) \cup (0, \infty) means every number except 0.

How to solve inequalities by hand

Solve an inequality the same way as an equation, with one extra rule: flip the sign whenever you multiply or divide both sides by a negative number. Then write the answer as a set of x values, not a single number. The method depends on the type of inequality.

For a quadratic, polynomial or rational inequality, move everything to one side so it reads f(x) < 0 (or >, ≤, ≥), find where f is zero or undefined, and test one value in each interval between those points. The worked example below does this for a cubic.

Each type of inequality, with a method and the answer the calculator gives
TypeExampleMethodAnswer
Linear−2x + 5 ≥ 11Subtract 5, then divide by −2 and flip the signx ≤ −3, or (−∞, −3]
Compound−3 < 2x + 1 ≤ 5Subtract 1 from all three parts, then divide by 2−2 < x ≤ 2, or (−2, 2]
Absolute value, less than|x − 3| < 5Rewrite as −5 < x − 3 < 5−2 < x < 8, or (−2, 8)
Absolute value, greater than|2x + 1| ≥ 7Split into 2x + 1 ≤ −7 or 2x + 1 ≥ 7(−∞, −4] ∪ [3, ∞)
Quadraticx² − 5x + 6 < 0Factor as (x − 2)(x − 3), then use a sign chart(2, 3)
Rational(x + 1)/(x − 2) ≤ 0Sign chart, leaving out x = 2[−1, 2)

The rules of inequalities

Adding or subtracting the same number on both sides never changes the direction: if a < b, then a + 5 < b + 5.

Multiplying or dividing by a positive number keeps the direction. Multiplying or dividing by a negative number reverses it: 3 < 4, but −3 > −4.

Never multiply both sides by an expression whose sign you do not know, such as x − 2. It is positive for some x and negative for others, so the sign would flip on only part of the number line. Move everything to one side and use a sign chart instead.

Worked example

Solve x³ − 4x ≥ 0

Find every x with x³ − 4x ≥ 0 and write the answer in interval notation.

  1. Factor: x3−4x=x(x−2)(x+2)x^3 - 4x = x(x - 2)(x + 2), so the zeros are x = −2, 0 and 2.
  2. These three points split the line into four intervals. Test one value in each: f(−3) = −15, f(−1) = 3, f(1) = −3, f(3) = 15.
  3. We need f(x) ≥ 0, so keep the intervals where f is positive, (−2, 0) and (2, ∞), and include the zeros because equality is allowed.

Answer: The solution is [−2,0]∪[2,∞)[-2, 0] \cup [2, \infty), that is, −2 ≤ x ≤ 0 or x ≥ 2.

Frequently asked questions

How do I enter a compound inequality?

Type it as a chain, such as -3 < 2x + 1 <= 5, or join two parts with "and" or "or", such as x < -1 or x > 4. With "and" or a chain, the answer is the overlap of the parts. With "or", it is every x that satisfies at least one part.

How does the calculator solve absolute value inequalities?

It splits the number line where the expression inside the bars is zero. Where the inside is positive or zero, |A| = A; where it is negative, |A| = −A. It solves the inequality on each piece and combines the pieces. For |x−3|<5|x - 3| < 5 the cases give (−2, 3) and [3, 8), so the solution is (−2, 8).

When does the inequality sign flip?

Only when you multiply or divide both sides by a negative number. For −2x + 5 ≥ 11, subtract 5 to get −2x ≥ 6, then divide by −2 and flip: x ≤ −3. Adding or subtracting never flips the sign.

When do I use brackets instead of parentheses?

Use a bracket [ ] when the endpoint satisfies the inequality, which happens with ≤ or ≥. Use a parenthesis ( ) for strict inequalities, for excluded values and always next to ∞.

Why is a value where the denominator is zero never included?

At that value the expression is undefined, so it cannot be less than, greater than or equal to anything. For x+1x−2≤0\frac{x+1}{x-2} \le 0 the solution is [−1,2)[-1, 2): −1 is included (the fraction is 0 there) but 2 is not.

What does "no solution" mean?

It means no real number makes the inequality true. For example, x2+4<0x^2 + 4 < 0 has no solution because x2+4x^2 + 4 is at least 4 for every x. An absolute value can never be negative either, so |x−1|<−2|x - 1| < -2 has no solution.

Is this inequality solver free?

Yes. The answer and every step are free, with no sign-up and no limit on how many inequalities you solve. The calculation runs in your browser.

How do I solve the matching equation instead?

To find where f(x) = 0 exactly, use the polynomial root finder for polynomials, or the quadratic equation calculator for degree 2. The step-by-step guide to quadratic inequalities walks through a sign chart by hand.

Quadratic Formula Calculator

Solve ax² + bx + c = 0 with the quadratic formula: exact roots, discriminant, vertex, graph and steps.

Algebra & Equations

Factoring Calculator

Factor a polynomial completely, with each step labeled by method and a check by expanding.

Algebra & Equations

Polynomial Root Finder

All real and complex roots of a polynomial up to degree 10, with multiplicities, exact forms and steps.

Algebra & Equations

Equation Solver

Solve any equation in x: exact steps for linear and quadratic equations, numerical roots for the rest.

Algebra & Equations

Graphing Calculator

Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.

Tools

Step-by-Step Math Solver

Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.

Tools

Learn more: For the sign-chart method step by step, read how to solve quadratic inequalities. Linear inequalities follow the rules for linear equations, with one sign flip.

Sources and further reading

  1. Section 2.7, Linear Inequalities and Absolute Value Inequalities, Algebra and Trigonometry 2e (opens in a new tab), OpenStax, Rice University
  2. Section 5.6, Rational Functions, Algebra and Trigonometry 2e (opens in a new tab), OpenStax, Rice University
  3. Absolute Value Inequalities (opens in a new tab), Paul's Online Notes, Lamar University
  4. Polynomial Inequalities (opens in a new tab), Paul's Online Notes, Lamar University

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?