Linear Inequality Calculator

Solve linear and compound inequalities step by step and see the answer in inequality, interval and set-builder notation on a number line.

Use <, >, <= (≤) or >= (≥). Compound forms like −3 <= 2x + 1 < 7 work too. Any single letter can be the variable.
Interval notation
(−6, ∞)
Set-builder notation
{x | x > −6}
Endpoints
−6 excluded (open dot)
Solutionx > −6

Show the work

  1. Inequality, with each side simplified: 3x − 5 < 5x + 7
  2. Collect the x terms on the left and the constants on the right: −2x < 12
  3. Divide both sides by −2. Dividing by a negative number reverses the inequality sign: x > −6
  4. Check with a test value inside the solution, x = −5: −20 < −18 is true ✓
−8−6−4−202−6

Solving an inequality is almost the same as solving an equation, with one extra rule and a different kind of answer: instead of a single number, you get a whole range of numbers. This calculator solves linear inequalities and compound inequalities exactly, explains each move — including when the sign flips — and shows the solution in three notations and on a number line.

How to use the linear inequality calculator

  1. Type the inequality, for example 3(x - 2) + 1 < 5x + 7. Use <, >, <= (≤) or >= (≥).
  2. For a compound inequality, write both signs: -3 <= 2x + 1 < 7.
  3. Any single letter can be the variable, and fractions such as x/2 or 5/6 are kept exact.
  4. Read the solution on the tape and the shaded range on the number line. The steps simplify each side, collect terms, and check the answer with a test value.

Rules for solving linear inequalities

You may do the same thing to both sides, with one exception:

Operation on both sides Effect on the sign
Add or subtract any number unchanged
Multiply or divide by a positive number unchanged
Multiply or divide by a negative number reversed
Swap the two sides reversed (a < b means b > a)

Why the flip? Multiplying by −1 mirrors the number line: 2 < 5, but −2 > −5. Any negative multiplier includes that mirror.

The general linear inequality ax + b < 0 with a ≠ 0 has the solution

x < −b/a when a > 0  ·  x > −b/a when a < 0

Worked example

Solve 3(x − 2) + 1 < 5x + 7.

Simplify the left side: 3x − 6 + 1 = 3x − 5, so 3x − 5 < 5x + 7.

Collect terms: subtract 5x and add 5 on both sides: −2x < 12.

Divide by −2 and flip: x > −6.

Notations: interval (−6, ∞); set-builder {x | x > −6}; number line with an open dot at −6, shaded to the right.

Check: x = −5 gives 3(−7) + 1 = −20 on the left and −18 on the right, and −20 < −18 ✓.

A compound example: −3 ≤ 2x + 1 < 7. Subtracting 1 from all three parts gives −4 ≤ 2x < 6, and dividing by 2 gives −2 ≤ x < 3, or [−2, 3) in interval notation.

Three ways to write the answer

Inequality Interval Number line
x > −6 (−6, ∞) open dot at −6, shade right
x ≤ 4 (−∞, 4] closed dot at 4, shade left
−2 ≤ x < 3 [−2, 3) closed dot at −2, open dot at 3, shade between
always true (−∞, ∞) whole line shaded
never true ∅ nothing shaded

Common mistakes

  • Forgetting to flip after dividing by a negative coefficient — the most frequent error by far.
  • Flipping when moving terms. Subtracting 5x from both sides never changes the sign.
  • Mixing up brackets. “Less than or equal” includes the endpoint, so it takes a square bracket and a closed dot.
  • Writing compound inequalities backwards. 5 < x < 2 has no solution; write the smaller number on the left.

For equations instead of inequalities, the system of linear equations calculator solves two or three at once. Absolute-value distance on a number line is covered by the absolute value calculator, and sign rules for negative numbers are reviewed in the adding and subtracting integers calculator.

Frequently asked questions

When do I flip the inequality sign?

Only when you multiply or divide both sides by a negative number. Adding or subtracting any number, or multiplying by a positive number, keeps the sign the same. For −2x < 12, dividing by −2 gives x > −6.

What do the brackets and parentheses in interval notation mean?

A square bracket includes the endpoint (≤ or ≥) and a parenthesis excludes it (< or >). Infinity always gets a parenthesis because it is not a number you can reach: x ≥ 4 is [4, ∞).

How is a compound inequality solved?

Treat it as two inequalities joined by and. Solve each one and keep the values that satisfy both, which is the overlap of the two solution sets. For −3 ≤ 2x + 1 < 7 the result is −2 ≤ x < 3.

What if the variable cancels out?

Then the inequality is either always true (every real number is a solution) or never true (no solution). For example 2(x + 1) > 2x simplifies to 2 > 0, which is always true.

Can this solve x² < 4?

No. It handles linear inequalities only. A quadratic inequality needs the roots of the quadratic first; the quadratic formula calculator can find those, and the sign of the quadratic between the roots gives the answer.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.