Inequalities: Ranges, Regions and Constraints

A complete, plain-language guide with worked examples, diagrams, tables and links to AI and machine learning

In this article
  1. Introduction
  2. What is an inequality?
  3. Number lines and interval notation
  4. Solving linear inequalities
  5. Compound inequalities
  6. Absolute value inequalities
  7. Quadratic inequalities
  8. Inequalities in two variables
  9. Systems and optimisation
  10. Famous inequalities
  11. AI and machine learning
  12. Common mistakes
  13. Practice problems
  14. Conclusion

1. Introduction

Equations say two things are exactly equal. Real life is rarely that precise. A lift can carry at most 800 kilograms, a driver must be at least 18, a phone plan must cost less than 30 dollars. These are inequalities, statements that compare quantities instead of equating them. The answer to an inequality is not usually a single number but a whole range of numbers.

This changes how we think about solving. We still isolate the variable, but we must be careful with one new rule, and we describe the solution as a region on a number line or a plane. Inequalities also carry us into practical territory: choosing the best option under limits, which is the subject of optimisation.

This article covers the symbols and the solving rules, compound and absolute-value inequalities, quadratic inequalities, graphing in two variables, optimisation with several constraints, and some famous inequalities. We finish with the many places inequalities decide what machine learning models do, from ReLU to classification boundaries.

2. What is an inequality?

An inequality compares two expressions using one of four symbols. The strict symbols < and > exclude equality, and the non-strict symbols ≤ and ≥ allow it. A solution is any value of the variable that makes the statement true, and the solution set is all of them. For x > 3 the numbers 3.1, 4 and 1,000 are solutions, while 3 and 2 are not.

Inequality symbols
SymbolRead asExampleTrue when
<less thanx < 5x is below 5
>greater thanx > 5x is above 5
≤less than or equal tox ≤ 5x is 5 or below
≥greater than or equal tox ≥ 5x is 5 or above
≠not equal tox ≠ 5x is anything but 5

Everyday phrases translate directly: "at least" means ≥, "at most" means ≤, "fewer than" means <, and "more than" means >. A common source of error is mixing up "at least 18" (18 or more) with "more than 18" (above 18, so 18 itself is excluded).

3. Number lines and interval notation

A solution set of one variable is easiest to see on a number line. Draw a circle at each endpoint: an open circle when the endpoint is excluded (strict symbols), and a filled circle when it is included (non-strict symbols). Then shade or draw an arrow in the direction of the solutions.

Four number lines showing x less than 3, x at least minus 2, a bounded interval and two separate rays
Inequalities as picture on the number line.

Interval notation is the compact written form. Round brackets mean "excluded" and square brackets mean "included." The symbols ∞ and −∞ stand for "without end" and always get a round bracket, because infinity is not a number you can reach.

Three ways to describe the same set
InequalityInterval notationNumber line
x < 3(−∞, 3)open circle at 3, arrow left
x ≥ −2[−2, ∞)filled circle at −2, arrow right
−2 < x ≤ 3(−2, 3]open at −2, filled at 3
x < −1 or x ≥ 4(−∞, −1) ∪ [4, ∞)two separate rays

4. Solving linear inequalities

Linear inequalities are solved almost exactly like linear equations. You may add or subtract the same number on both sides, and you may multiply or divide both sides by the same positive number, and the inequality stays true. For example, 3x + 2 < 11 becomes 3x < 9 and then x < 3. A test confirms it: x = 2 gives 8 < 11, true, while x = 3 gives 11 < 11, false.

Solving 3x + 2 < 11, with a check
StepInequalityWhat we did
13x + 2 < 11start
23x < 9subtract 2 from both sides
3x < 3divide both sides by 3
Checkx = 2: 8 < 11 ✓; x = 3: 11 < 11 ✗test inside and at the boundary

The one new rule is the sign flip. Multiplying or dividing both sides by a negative number reverses the inequality. To see why, start from the true statement 2 < 4 and multiply by −1. The numbers become −2 and −4, and −2 is now greater than −4. The number line reflects, so the order must flip.

Number lines showing that 2 is less than 4 but minus 2 is greater than minus 4
Multiplying by a negative number mirrors the number line, reversing the order.

Apply it to −2x + 5 ≥ 9. Subtract 5 to get −2x ≥ 4. Now divide by −2 and flip the symbol: x ≤ −2. Check: x = −3 gives 6 + 5 = 11 ≥ 9, true, and x = 0 gives 5 ≥ 9, false.

Rules for working with inequalities
Operation on both sidesEffect on the symbolExample
add or subtract any numberunchangedx − 2 < 5 → x < 7
multiply or divide by a positive numberunchanged3x > 12 → x > 4
multiply or divide by a negative numberreversed−3x > 12 → x < −4
take reciprocals (both sides positive)reversed2 < x → 1/x < 1/2

Variables on both sides work as with equations: for 5x − 7 ≤ 2x + 8, subtract 2x and add 7 to get 3x ≤ 15, so x ≤ 5.

5. Compound inequalities

A compound inequality joins two conditions. With and, both must hold, so the solution is the overlap of the two sets. With or, at least one must hold, so the solution is the combination of the two sets.

An and condition is often written as one chain, −3 < 2x + 1 ≤ 7. Whatever you do, do it to all three parts. Subtract 1 to get −4 < 2x ≤ 6, then divide by 2 to get −2 < x ≤ 3. An or condition stays as two pieces: 2x − 1 < −5 or 3x ≥ 12 gives x < −2 or x ≥ 4.

AND versus OR
AND (intersection)OR (union)
meaningboth conditions trueat least one true
solution setthe overlapeverything covered by either
example−3 < 2x + 1 ≤ 7 → −2 < x ≤ 32x − 1 < −5 or 3x ≥ 12 → x < −2 or x ≥ 4
shapeone connected intervalusually two separate pieces

Sometimes the answer is empty or everything. x < 2 and x > 5 has no solution, because no number is both below 2 and above 5. And x < 5 or x > 2 is true for every real number.

6. Absolute value inequalities

The absolute value |x| is the distance of x from zero, and |x − 2| is the distance of x from 2. That distance idea turns absolute-value inequalities into pictures. |x − 2| < 5 says "the distance from 2 is less than 5," so x lies within 5 of 2, between −3 and 7. |x − 2| ≥ 5 says "at least 5 away," so x ≤ −3 or x ≥ 7.

Number lines showing the inside and outside of a distance of 5 from 2
Absolute value as distance: inside the interval, and outside it.
Solving absolute-value inequalities (c > 0)
FormBecomesShapeExample
|u| < c−c < u < cone interval (and)|2x + 1| ≤ 7 → −4 ≤ x ≤ 3
|u| > cu < −c or u > ctwo rays (or)|x − 2| ≥ 5 → x ≤ −3 or x ≥ 7

Two special cases are worth knowing. |x| < −1 has no solution, since a distance is never negative. |x| > −1 is true for every real number, for the same reason.

7. Quadratic inequalities

Quadratic inequalities such as x² − 5x + 6 < 0 ask where a parabola lies below or above the x-axis. The key idea: a continuous curve can change sign only where it crosses zero. So find the roots first, then test the regions between them.

Factor to find the roots: (x − 2)(x − 3) < 0 has roots 2 and 3. These split the number line into three regions. Test one value in each and record the sign.

Sign chart for (x − 2)(x − 3)
RegionTest x(x − 2)(x − 3)Sign
x < 20(−2)(−3) = 6positive
2 < x < 32.5(0.5)(−0.5) = −0.25negative
x > 34(2)(1) = 2positive

We wanted the expression to be negative, so the answer is the middle region: 2 < x < 3. The roots themselves give zero, which is not below zero, so they are excluded. For ≤ 0 we would include them.

Parabola with the region between 2 and 3 below the axis shaded
The inequality holds exactly where the parabola is below the x-axis.
More quadratic inequalities
InequalityRootsSolution
x² − 5x + 6 < 02, 32 < x < 3
x² − 4 ≥ 0−2, 2x ≤ −2 or x ≥ 2
x² + 2x − 8 > 0−4, 2x < −4 or x > 2
x² + 1 > 0noneall real numbers
x² < 00 onlyno solution

Notice the pattern. For an upward-opening parabola, "below zero" gives the interval between the roots, and "above zero" gives the two outer pieces. If there are no real roots, the parabola never crosses the axis, so the answer is either everything or nothing.

8. Inequalities in two variables

With two variables, an inequality describes a region of the plane. The boundary is the line from the matching equation, and the solution is everything on one side. Graph y > 2x − 1 in three steps: draw the boundary y = 2x − 1, make it dashed for strict symbols and solid for non-strict ones, and shade the correct side.

To choose the side, use a test point, usually the origin. For y > 2x − 1, the point (0, 0) gives 0 > −1, which is true, so shade the side containing the origin, above the line. If the origin lies on the boundary, pick another point.

Two graphs of half-planes, one with a dashed boundary and one with a solid boundary
Dashed boundaries are excluded; solid boundaries are included.
Graphing a two-variable inequality
Stepy > 2x − 1y ≤ −x + 3
1. boundaryy = 2x − 1y = −x + 3
2. line styledashed (strict)solid (non-strict)
3. test (0, 0)0 > −1 true0 ≤ 3 true
4. shadeside with the origin: aboveside with the origin: below

9. Systems and optimisation

A system of inequalities requires all conditions at once, so the solution is the overlap of the shaded regions, called the feasible region. This is the setting of linear programming: choose the best value of some goal while respecting limits.

A workshop makes two products. Each unit of A and B takes 1 hour of cutting, and each unit of A takes 2 hours of assembly against 1 hour for B. With 6 cutting hours and 8 assembly hours, the limits are x + y ≤ 6 and 2x + y ≤ 8, with x ≥ 0 and y ≥ 0. If profit is P = 3x + 2y, how many of each should be made?

The feasible region is a polygon. A key fact of linear programming is that the best value of a linear goal always occurs at a corner of the region. So compute the corners and compare. The corner (2, 4) is where the two limit lines meet, found by solving x + y = 6 and 2x + y = 8.

Feasible region polygon with corners and a profit line touching the best corner
The profit line touches the feasible region last at the corner (2, 4).
Evaluating the profit at each corner
Corner (x, y)Profit 3x + 2yResult
(0, 0)0nothing made
(4, 0)12
(2, 4)14best
(0, 6)12

The answer is to make 2 units of A and 4 of B for a profit of 14. The same pattern, a goal under constraints, appears in scheduling, diet planning, transport and resource allocation.

10. Famous inequalities

Some inequalities are so useful they have names. They hold for every allowed value, and they are tools for proving that one quantity bounds another.

Famous inequalities
NameStatementNumerical example
Triangle inequality|a + b| ≤ |a| + |b||−3 + 5| = 2 ≤ 3 + 5 = 8
AM–GM(a + b)/2 ≥ √(ab) for a, b ≥ 0(4 + 9)/2 = 6.5 ≥ √36 = 6
Cauchy–Schwarz(a · b)² ≤ |a|² |b|²a = (1, 2), b = (3, 4): 11² = 121 ≤ 5 × 25 = 125
Logarithm boundln x ≤ x − 1 for x > 0ln 2 ≈ 0.693 ≤ 1

AM–GM says an average of two numbers is never smaller than their geometric mean, with equality only when the numbers are equal. It explains, for example, why a square encloses the largest area for a given perimeter. The triangle inequality says a detour is never shorter than the direct route, and it is the reason distances in machine learning behave sensibly.

Pairs of bars comparing arithmetic and geometric means for four pairs of numbers
The arithmetic mean always sits at or above the geometric mean.
AM–GM for four pairs
a, b(a + b)/2√(ab)Gap
4, 96.560.5
2, 8541
5, 5550
1, 168.544.5

11. AI and machine learning

Inequalities quietly decide what machine learning models do. The ReLU activation max(0, x) is defined by an inequality: it outputs 0 when x < 0 and x otherwise. Gradient clipping uses an inequality as a safety limit: if the gradient's size exceeds a threshold c, it is scaled down so that ‖g‖ ≤ c.

Left: the ReLU function. Right: a clipping function limited between minus 1 and 1
ReLU and clipping are both defined by inequalities.
ReLU and clipping in numbers
InputReLU(x)clip(x, −1, 1)
-30-1
-10-1
000
0.50.50.5
221
551

A gradient with components 3 and 4 has size 5. With a threshold of 1, the clipped gradient is (3, 4) × 1/5 = (0.6, 0.8), the same direction but a size of exactly 1.

The central idea of classification is an inequality. A linear classifier computes a score w · x + b and predicts class 1 when w · x + b ≥ 0. The boundary w · x + b = 0 is a line, and the inequality picks a side of it, exactly as in section 8. With w = (2, −1) and b = −1, the point (2, 1) scores 4 − 1 − 1 = 2, which is positive, so it lands in class 1, while (0, 2) scores −3 and lands in class 0.

Scatter of points on two sides of a decision boundary line with scores
A classifier is a half-plane: the sign of the score decides the class.
Scores for five points with w = (2, −1), b = −1
PointScore 2x₁ − x₂ − 1Class (score ≥ 0 → 1)
(2, 1)21
(0, 2)-30
(1, 1)01
(3, 2)31
(1, 3)-20

Support vector machines add inequality constraints: every training point must satisfy yᵢ (w · xᵢ + b) ≥ 1, and among all such boundaries the machine picks the one with the widest margin, 2/‖w‖. For w = (3, 4), ‖w‖ = 5 and the margin is 0.4. This is a linear programming style problem, a goal under inequality constraints.

Inequalities also shape how predictions are used. A model that outputs a probability p becomes a yes/no decision by a threshold: predict positive when p ≥ t. Moving t trades precision against recall. Take five cases with model probabilities 0.9, 0.8, 0.6, 0.4, 0.2 and true labels 1, 1, 0, 1, 0.

Effect of the decision threshold
Threshold tPredicted positivesPrecisionRecall
0.340.751.00
0.530.670.67
0.721.000.67

A low threshold catches every positive but lets a false alarm through. A high threshold is cleaner but misses a true case. Neither is right in general; the choice depends on which error is costlier.

Finally, stopping rules are inequalities. Training loops often stop when the improvement drops below a small tolerance, |Lₜ − Lₜ₋₁| < ε. For the loss Lₜ = 2 + 9 · 0.25ᵗ from earlier articles and a tolerance of 0.001, the change first falls below the tolerance at step 8.

A stopping rule in action, tolerance 0.001
Step tLoss LₜChange |Lₜ − Lₜ₋₁|Change < 0.001?
52.008790.02637no
62.002200.00659no
72.000550.00165no
82.000140.00041yes: stop
The same ideas, two vocabularies
AlgebraMachine learning
max(0, x), defined by x < 0 or x ≥ 0ReLU activation
‖g‖ ≤ cgradient clipping
w · x + b ≥ 0linear classifier, decision boundary
yᵢ(w · xᵢ + b) ≥ 1support vector machine constraints
p ≥ tclassification threshold
|change| < εconvergence and stopping tolerance
feasible region, corner optimumconstrained optimisation, linear programming

12. Common mistakes

Frequent mistakes and corrections
MistakeWrongRight
Forgetting to flip−2x ≥ 4 → x ≥ −2−2x ≥ 4 → x ≤ −2
Wrong circle at an endpointfilled circle for x < 3open circle: 3 is excluded
Writing and instead of or|x − 2| ≥ 5 → −3 ≥ x ≥ 7x ≤ −3 or x ≥ 7
Treating a quadratic like a linear onex² > 4 → x > 2x < −2 or x > 2
Dividing by a variablex² > 3x → x > 3x(x − 3) > 0 → x < 0 or x > 3
Skipping the test pointshading either sidetest (0, 0) to choose

13. Practice problems

Try these before looking at the answers.

  1. Solve 4x − 3 > 9 and write the answer in interval notation.
  2. Solve −3x + 2 ≤ 11.
  3. Solve −5 < 3x + 1 ≤ 10.
  4. Solve |x + 1| < 4.
  5. Solve |2x − 3| ≥ 5.
  6. Solve x² − x − 6 ≤ 0.
  7. Decide whether (1, 1) satisfies y > 2x − 1.
  8. A classifier has w = (1, 1) and b = −3. Which class does the point (2, 2) fall in?

Answers.

  1. 4x > 12, so x > 3, which is (3, ∞).
  2. −3x ≤ 9, so dividing by −3 flips the sign: x ≥ −3.
  3. Subtract 1: −6 < 3x ≤ 9. Divide by 3: −2 < x ≤ 3.
  4. −4 < x + 1 < 4, so −5 < x < 3.
  5. 2x − 3 ≤ −5 or 2x − 3 ≥ 5, so x ≤ −1 or x ≥ 4.
  6. (x − 3)(x + 2) ≤ 0, so −2 ≤ x ≤ 3.
  7. 1 > 2(1) − 1 = 1 is false because 1 is not greater than 1, so no. The point lies on the dashed boundary.
  8. Score 2 + 2 − 3 = 1, which is ≥ 0, so class 1.

14. Conclusion

An inequality compares instead of equating, and its solution is a range. Solve it like an equation with one new rule: multiplying or dividing by a negative reverses the symbol. Number lines and interval notation describe the answer, compound and absolute-value inequalities combine conditions with and or or, and quadratic inequalities are settled by roots and sign charts.

In two variables an inequality is a region, and several together form a feasible region where an optimum sits at a corner. In machine learning, inequalities define ReLU, clipping, classification boundaries, margins, thresholds and stopping rules. The final article in this series connects algebra and geometry directly: coordinate geometry.