Module 2 of 6 · Lesson 1 of 3

Plotting Linear Inequalities

Drawing a constraint and choosing the side it allows.

What you will be able to do

Given one or more linear inequalities in two variables, the learner can draw each boundary line, determine which side the inequality allows by testing a point, and shade the set satisfying all of them together, including sign restrictions.

Orientation

An inequality describes a boundary and a side. Getting the boundary right and the side wrong produces a plausible region belonging to a different problem.

That second half is the reason this is a unit of its own. Placing a line is arithmetic, and its failures are usually visible: a mis-plotted intercept looks wrong. Choosing the side is a decision, and choosing it wrongly produces a tidy, plausible, entirely incorrect region that no subsequent step will question.

Everything downstream inherits the error. The feasible region is the intersection of these sides; the corners come from that region; the optimum comes from those corners. A single wrong side at the start produces a confident final answer to a problem nobody asked.

This unit assumes you know what a half-space is and can decide whether a given point satisfies a linear inequality.

Intuition

A boundary line and the side the inequality allows

An inequality is an equation plus a choice of side. The equation says where the boundary runs; the inequality says which way from it you may stand.

Why does testing one point settle an entire side? Because the quantity a T x varies continuously as x moves, and it equals b exactly on the boundary. To get from a point where a T x < b to one where a T x > b , you must pass through a point where it equals b , you must cross the line. So every point on one side gives the same verdict, and a single test decides all of them at once.

That is also why the origin is the customary test point: a T 0 = 0 , so the test reduces to asking whether 0 ≤ b , which is to say whether b is nonnegative. It is available whenever the boundary misses the origin, which is whenever b ≠ 0 .

The failure mode is worth naming plainly. It is not that people cannot test a point. It is that they do not, because the sign of the inequality feels like it already says which way to shade. 'Less than' feels downward. It is downward often enough to build a habit and not often enough to trust.

Definition

Boundary, side, and the test point

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

The boundary line is a 1 x 1 + a 2 x 2 = b . Two points determine it. The usual pair is the intercepts: set x 1 = 0 to get x 2 = b / a 2 , and set x 2 = 0 to get x 1 = b / a 1 , each available when the corresponding coefficient is nonzero. If one coefficient is zero the line is vertical or horizontal and a single value fixes it.

The allowed side is determined by a test point not on the line. Evaluate the inequality there. If it holds, the allowed side is the one containing the test point; if it fails, the allowed side is the other one.

The origin is a valid test point exactly when b ≠ 0 , since the line passes through the origin precisely when b = 0 . When it is unavailable, any convenient off-line point serves, ( 1 , 0 ) or ( 0 , 1 ) usually.

A non-strict inequality ( ≤ or ≥ ) includes its boundary, drawn as a solid line. A strict inequality excludes it, drawn dashed. Linear programs use non-strict inequalities, and this matters: optima occur on boundaries, so the boundary must belong to the feasible set.

Procedure

Drawing a system of inequalities

Write each constraint as an equation. Replace every inequality sign with an equals sign. These equations are the boundary lines; the inequalities will be reinstated when you choose sides.

Plot each boundary from its intercepts. Set one variable to zero and solve for the other, then repeat. Two points give the line. If a coefficient is zero, the boundary is vertical or horizontal instead.

Choose a test point for each constraint and evaluate it. Use the origin whenever the boundary does not pass through it, that is, whenever the right-hand side is nonzero. Otherwise pick any point that does not satisfy the boundary equation, substitute it and check that the two sides differ.

Record the verdict for each constraint before shading anything. Write down, for each one, whether the test point satisfied it and therefore which side is allowed. Doing this in writing rather than by eye is what prevents the error this unit exists to prevent.

Shade the intersection, not the union. A point is feasible only if it satisfies every constraint simultaneously. The region you want is what survives all of the restrictions together.

Include the sign restrictions. Treat x 1 ≥ 0 and x 2 ≥ 0 as constraints like any other; together they confine the region to the first quadrant. Their absence is equally meaningful, without them the region extends into the other quadrants, and assuming them when they were not stated solves a different problem.

Verify with one interior point. Take a point well inside the shaded region and check it against every original inequality. One point satisfying all of them confirms the region is on the right side of every boundary.

Figure

Intercepts, a test point, and a corner found by solving

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

The procedure carried out on x 1 + 2 x 2 ≤ 8 and 3 x 1 + x 2 ≤ 9 with both variables nonnegative.

Each boundary is placed by its intercepts: x 1 + 2 x 2 = 8 through ( 8 , 0 ) and ( 0 , 4 ) , and 3 x 1 + x 2 = 9 through ( 3 , 0 ) and ( 0 , 9 ) . The origin is the test point, marked: it gives 0 ≤ 8 and 0 ≤ 9 , both true, so for each constraint the side containing it is the side kept.

What survives is the quadrilateral with corners ( 0 , 0 ) , ( 3 , 0 ) , ( 2 , 3 ) and ( 0 , 4 ) . The corner ( 2 , 3 ) is marked as solved rather than read: it is where the two slanted boundaries meet, obtained from that pair of equations. A drawing locates a corner; only the algebra gives its coordinates, and ( 2 , 3 ) and ( 2.05 , 2.95 ) look the same on paper.

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.

Worked example

A constraint that needs rearranging first

Problem. Plot − 2 x 1 + x 2 ≥ − 4 together with x 1 ≥ 0 and x 2 ≥ 0 , and identify the allowed side of the first constraint.

Goal. Draw the region, with particular care over the inequality direction.

Relevant principle. Multiplying or dividing an inequality by a negative number reverses its direction. Testing a point is immune to this, which is why the test is the safeguard rather than the rearrangement.

Step 1: the boundary. − 2 x 1 + x 2 = − 4 . Setting x 1 = 0 gives x 2 = − 4 ; setting x 2 = 0 gives x 1 = 2 . The line passes through ( 0 , − 4 ) and ( 2 , 0 ) .

Step 2: test the origin. The right-hand side is − 4 ≠ 0 , so the origin is off the line and available. Substituting: − 2 ( 0 ) + 0 = 0 , and 0 ≥ − 4 is true. The origin's side is allowed.

Step 3: rearrange, and confirm the two agree. Multiplying through by − 1 reverses the inequality:

2 x 1 − x 2 ≤ 4 .

Test the origin in this form: 0 ≤ 4 , true. The same side, as it must be. The two forms are the same constraint.

Step 4: what happens if the reversal is forgotten. Writing 2 x 1 − x 2 ≥ 4 instead and testing the origin gives 0 ≥ 4 , false, so the opposite side would be shaded. The boundary line is identical in both cases, so the drawing gives no hint that anything went wrong.

Step 5: the region. With the sign restrictions, the allowed set is the part of the first quadrant on the origin's side of the line through ( 2 , 0 ) . An unbounded region extending upward and to the left within the quadrant.

Check. Take ( 0 , 5 ) : − 2 ( 0 ) + 5 = 5 ≥ − 4 holds, and both coordinates are nonnegative. Feasible, consistent with the shading.

What did the work. The test point. It gave the same verdict in both algebraic forms, which is exactly the property that makes it a safeguard against the sign-reversal error.

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.

Exercise

1. Plot 4 x 1 + 3 x 2 ≤ 12 with x 1 , x 2 ≥ 0 . Give the intercepts, the test point you used, and the verdict.

2. Plot x 1 − x 2 ≥ 0 . The origin is not available here, say why, choose a valid test point, and give the allowed side.

3. Rewrite − 3 x 1 + 2 x 2 ≤ 6 with a positive leading coefficient, then confirm by testing a point that both forms allow the same side.

4. A classmate plots x 1 + x 2 ≥ 4 with sign restrictions and reports a bounded triangle with corners ( 0 , 0 ) , ( 4 , 0 ) , ( 0 , 4 ) . What did they do, and what is the correct region?

5. Shade the region satisfying x 1 + x 2 ≤ 6 , x 1 − x 2 ≤ 2 , x 1 ≥ 1 , x 2 ≥ 0 , then verify it with a single interior point checked against all four.

What to carry forward

Plotting an inequality is two moves: draw the boundary from the equation, then decide the side by testing a point.

The boundary comes from the intercepts in the ordinary case, or from a single value when a coefficient is zero. The side comes from evaluating one point not on the line. The origin whenever the right-hand side is nonzero, since that makes the test immediate.

One test decides a whole side because the expression cannot change which side of b it falls on without crossing the boundary.

Two situations deserve deliberate care: an inequality multiplied or divided by a negative number, which reverses its direction while leaving the boundary untouched; and sign restrictions, which are constraints like any other and confine the region to the first quadrant when present.

The region is the intersection of every allowed side, not the union. Verify the finished drawing with one interior point checked against all the original inequalities. The wrong-side error is invisible in its own output, and this check is what catches it before anything downstream inherits it.

Next step

Practice Plotting Linear Inequalities

Practice records what support you used, so the evidence reflects how you actually performed.

Practice this lessonSkip to Contour Lines and the Direction of Improvement

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.