Plotting Linear Inequalities

A linear inequality is drawn in two moves: draw its boundary line, then decide which of the two sides it allows. The first is arithmetic and rarely goes wrong. The second has a failure mode of its own, the wrong side chosen, which survives a perfectly accurate drawing and quietly produces a region that is not the feasible one.

Definition

To plot a 1 x 1 + a 2 x 2 ≤ b in the plane:

The boundary line is the equation a 1 x 1 + a 2 x 2 = b . Two points determine it, and the quickest pair is usually the intercepts: setting x 1 = 0 gives x 2 = b / a 2 , and setting x 2 = 0 gives x 1 = b / a 1 , provided the relevant coefficient is nonzero.

The allowed side is found by testing any point not on the line. If the test point satisfies the inequality, the allowed side is the one containing it; otherwise it is the other side. The origin is the usual choice because a T 0 = 0 makes the test immediate, and it is available exactly when the line does not pass through it, that is when b ≠ 0 .

A strict inequality excludes the boundary and is drawn as a dashed line; the inequalities in a linear program are non-strict, so the boundary belongs to the allowed set.

Assumptions and scope

  • The origin is a valid test point only when the boundary does not pass through it. When b = 0 the line runs through the origin and the test is vacuous; choose any other point not on the line.

  • Dividing an inequality by a negative number reverses its direction. This is where a correct line is most often paired with the wrong side.

  • A constraint with one variable absent, such as x 1 ≤ 4 , still has a boundary line (vertical or horizontal) and two sides. It is not a special case requiring different treatment.

  • Non-strict inequalities include their boundary, so the boundary points are feasible. This matters because optima in linear programming occur precisely on boundaries.

  • Sign restrictions are constraints like any other. Omitting x 1 ≥ 0 and x 2 ≥ 0 from the drawing produces a region extending outside the first quadrant, which is a different problem.

Forms this is expressed in

The same content in several forms. Each makes something visible that the others leave implicit, so moving between them is part of understanding the topic rather than a presentation choice.

geometric

the corner comes from solving the pair, not from reading the grid

Two slanted constraints and the two sign restrictions, plotted together. Each boundary is drawn from its intercepts, the allowed side is settled by testing the origin, and the region is what remains after all four cuts.

The corner where the two slanted boundaries meet is not read off the drawing: it is found by solving the two boundary equations simultaneously. The plot shows which pair to solve; the arithmetic supplies the coordinates.

Worked material

Example

Four constraints, one region

Plot the region defined by

x 1 + 2 x 2 ≤ 8 , 3 x 1 + x 2 ≤ 9 , x 1 ≥ 0 , x 2 ≥ 0 .

First boundary. x 1 + 2 x 2 = 8 has intercepts ( 8 , 0 ) and ( 0 , 4 ) . Test the origin: 0 ≤ 8 holds, so the allowed side is the side containing the origin, below and left of this line.

Second boundary. 3 x 1 + x 2 = 9 has intercepts ( 3 , 0 ) and ( 0 , 9 ) . Test the origin: 0 ≤ 9 holds, so again the origin's side is allowed.

Sign restrictions. x 1 ≥ 0 is the region right of the vertical axis; x 2 ≥ 0 is the region above the horizontal axis. Together they confine everything to the first quadrant.

The intersection. The surviving region is a quadrilateral with corners ( 0 , 0 ) , ( 3 , 0 ) , ( 2 , 3 ) and ( 0 , 4 ) . The corner ( 2 , 3 ) is where the two slanted boundaries meet, found by solving x 1 + 2 x 2 = 8 with 3 x 1 + x 2 = 9 simultaneously.

Verification. Take the interior point ( 1 , 1 ) : 1 + 2 = 3 ≤ 8 , 3 + 1 = 4 ≤ 9 , and both coordinates are nonnegative. All four constraints hold, confirming the shaded side of every boundary.

Non-example

Ways the side goes wrong

Not a rule: 'less than shades below'. For x 1 + 2 x 2 ≤ 8 the origin's side is indeed below the line. For − x 1 − 2 x 2 ≤ − 8 , the same boundary, the origin fails the test, since 0 ≤ − 8 is false, so the allowed side is above. Identical line, identical inequality sign, opposite side.

Not a valid test point: the origin on the boundary. For 2 x 1 − 3 x 2 ≤ 0 the line passes through the origin and substituting gives 0 ≤ 0 , which is true but says nothing about a side. Test ( 1 , 0 ) instead: 2 ≤ 0 is false, so the allowed side is the other one.

Not the intersection: shading each constraint separately and taking whatever is covered. A point satisfying one constraint but not another is infeasible. The region is where all of the shadings overlap, not where any of them reaches.

Not optional: the sign restrictions. Omitting x 1 ≥ 0 and x 2 ≥ 0 from x 1 + 2 x 2 ≤ 8 leaves a half-plane extending infinitely into three other quadrants, with no corners at all. The region and the problem are both different.

Not a special case: a missing variable. x 1 ≤ 4 still has a boundary, the vertical line x 1 = 4 , and two sides, tested exactly as any other constraint is.

Contrast

Correct boundary, incorrect half-plane

Two errors are possible when plotting a constraint, and they are not equally visible.

A misplaced boundary is usually visible. Compute an intercept wrongly and the line sits somewhere the constraint cannot justify, cutting an axis beyond the bound it came from, or crossing another boundary far outside the quadrant. The drawing contradicts the arithmetic that produced it.

A wrong side does not. Consider 3 x 1 + x 2 ≥ 9 with sign restrictions. Suppose the origin test is skipped and the side chosen by the feel of the inequality. Testing properly: 0 ≥ 9 is false, so the allowed side is away from the origin, and the region is unbounded. Shade the origin's side instead and you get a neat bounded triangle with corners ( 0 , 0 ) , ( 3 , 0 ) , ( 0 , 9 ) . A perfectly respectable-looking region belonging to a different problem.

The consequence propagates silently. That triangle has corners, those corners get evaluated, one of them wins, and a specific optimum with a specific value is reported. Every step after the shading is performed correctly on incorrect input. Nothing downstream can detect it, because nothing downstream ever sees the original inequality again.

The safeguard is cheap and must be habitual. Test a point and write the verdict down, for every constraint, before shading. Then verify the finished region with one interior point checked against all the original inequalities. Two arithmetic checks, and together they close the only failure mode in this procedure that the picture cannot reveal.

Common errors

Common misconception

The side of a boundary line allowed by an inequality can be decided by looking at the inequality sign, so a less-than constraint always shades below or towards the origin.

Related units

Requires

Connected

Learn this topic

Used in

Sources

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.