The idea: shade the side that makes it true
An equation like 3x − 4 = 5 has one answer, x = 3. An inequality like 3x − 4 < 5 has a whole set of answers: every number below 3. So you don't write the answer as one number. You draw it: shade the part of the number line where the inequality is true.
The end of the shaded part is where the two sides are equal. For x > 2 the number 2 itself is not an answer, because 2 > 2 is false: draw an open dot. For x ≤ −1 the number −1 is an answer: draw a closed dot. Two signs at once, like −2 ≤ x < 2, give a segment instead of a ray (Demo: between two numbers).
Solving: the same moves as an equation, with one twist
You may add or subtract the same number on both sides, and multiply or divide both sides by the same positive number. The sign stays the same. So 3x − 4 < 5 becomes 3x < 9 (add 4), then x < 3 (divide by 3).
The twist: multiplying or dividing by a negative number flips the sign. 1 < 3, but −1 > −3. Multiplying by −1 mirrors the number line, so the order of every pair of numbers turns around.
For −2x + 3 ≤ 7: subtract 3 to get −2x ≤ 4, then divide by −2 and flip: x ≥ −2. Without the flip you would get x ≤ −2, and x = −3 shows that is wrong: −2·(−3) + 3 = 9, and 9 ≤ 7 is false (Demo: dividing by −2 flips the sign). A quick check with a number from your shaded part always catches a missed flip.
Two variables: a half-plane
An inequality in x and y, like y ≤ x + 1, is true for some points (x, y) of the plane and false for others. Three steps find which:
- Boundary. Replace the sign with = and draw the line y = x + 1. Solid for ≤ and ≥ (points on the line count), dashed for < and > (they don't), like closed and open dots.
- Test point. Pick a point that is not on the line, usually (0, 0), and put it in: 0 ≤ 0 + 1 is true.
- Shade. True: shade the side with the test point. False: shade the other side.
The answer is a half-plane: all points on one side of the line (Demo: half-plane y ≤ x + 1). For y > −x + 3 the test gives 0 > 3, false, so you shade the side without (0, 0) (Demo: (0, 0) is false). If the line goes through (0, 0), as y < 2x does, (0, 0) can't decide anything: take (1, 0) instead (Demo: the line goes through (0, 0)).
A one-variable answer is a half-plane too. In the plane, x ≥ −2 means every point whose x is at least −2, whatever y is: everything right of the vertical line x = −2. The page draws each one-variable answer both ways.
Systems: the feasible region
A system of inequalities asks for points that make every inequality true at once. Shade each half-plane, then keep only the part where they all overlap. That overlap is the feasible region. To check a point, put it into each inequality: one false one is enough to put it outside (Test).
The region can be a closed polygon, it can go on forever (unbounded), or it can be empty. y ≥ x + 2 and y ≤ x − 1 have parallel boundaries, and each one shades away from the other: no point is in both, so the system has no solution (Demo: no solution).
Toward linear programming: the best corner
Factories, diets and timetables lead to problems like: make P = 2x + 3y as large as possible, while x ≥ 0, y ≥ 0, x + y ≤ 5 and x + 2y ≤ 8. This is linear programming. All points with the same P lie on one line, 2x + 3y = P. Bigger P slides that line further out. The last point of the region it touches is a corner, so you only need to check the corners:
| Corner | P = 2x + 3y |
|---|---|
| (0, 0) | 0 |
| (5, 0) | 10 |
| (2, 3) | 13, the best |
| (0, 4) | 12 |
(Demo: a system, its feasible region and best corner.) Each corner is where two boundaries cross: (2, 3) solves x + y = 5 and x + 2y = 8 together, the same work as in systems of equations. If two corners tie, the whole edge between them is best. The simplex method does this in many dimensions by walking from corner to corner. Change P in Options to see another best corner.
See also linear functions for slope and intercept of the boundary lines, and Gaussian elimination for solving larger systems of equations.
What the page leaves out
The page uses ready-made inequalities with whole-number coefficients and a view from −6 to 6. It does not cover inequalities with absolute values, quadratic inequalities such as x² < 4, or inequalities in three or more variables. The corner search only lists corners for a closed region and does not run the simplex method itself; an unbounded region may have no best point at all.