Graphing a linear inequality in two variables
An equation in x and y draws a line. What does an inequality in x and y draw?
Where you are 4 in Systems of linear inequalities
When you reach for it
An equation such as y = 2x - 1 is true at some points of the plane and false at the rest, and the points where it is true form a line. Change the = to > and ask the same question: which points (x, y) make
true? There are far too many to list, so they are drawn, and what gets drawn is a whole region: every point on one side of a line.
Reach for this whenever a condition on two quantities is a limit rather than an exact target, such as an oven that can run for at most 12 hours. On a number line, an inequality in one variable is drawn as a ray. In the coordinate plane, an inequality in two variables is drawn as a half-plane, the part of the plane on one side of a line. The edge comes from graphing a line, and the algebra uses the sign flip for dividing by a negative number.
The procedure
Part 1 graphs inequalities with y alone on one side and explains why the answer is always one side of a line. Part 2 handles standard form, horizontal and vertical boundaries, reading an inequality off a graph, and situations where only whole-number points make sense.
Part 1: the region on one side of a line
A solution is a point. A solution of an inequality in x and y is an ordered pair that makes it true. Try three points with first coordinate 3 in y > 2x - 1, where the right side is 2(3) - 1 = 5. For (3, 6), 6 > 5 is true. For (3, 2), 2 > 5 is false. For (3, 5), 5 > 5 is false: the two sides are equal, and equal is not greater.
Why the solutions fill one side of a line. Those three points lie in the column x = 3, which the line y = 2x - 1 crosses at (3, 5). Once x is fixed at 3, the inequality says only y > 5: every point of the column above (3, 5) is a solution, and none at or below it is.
Nothing about 3 mattered. In the column x = a the line sits at height 2a - 1, and the inequality asks for y > 2a - 1, the part of that column above the line. Put all the columns together and the solutions are exactly the points above the line. The inequality compares y with the height of the line at the same x, so “y greater than” means above and “y less than” means below.
The line where the two sides are equal, here y = 2x - 1, is the boundary line. It splits the plane into two half-planes, and the solutions of a linear inequality are one of them, together with the boundary itself when equality is allowed.
Dashed or solid. Points on the boundary make the two sides equal. For < or > they are not solutions, so the boundary is drawn dashed: it marks the edge without belonging to the region. For \le or \ge they are solutions, so it is drawn solid. This is the open or closed circle of the number line, made along a whole line at once.
Choosing the side with a test point. With y alone on the left, the symbol already says which side: > or \ge means above, < or \le means below. A test point confirms it, and in Part 2 it does the deciding. Substitute any point not on the boundary. If the result is true, shade the side containing the point; if false, shade the other side.
One point is enough because of the column argument: every point on one side satisfies the inequality and every point on the other fails it. The origin is the easiest choice, since substituting 0 for both coordinates leaves almost no arithmetic. For y > 2x - 1 it gives 0 > -1, which is true, and the origin is indeed above the line, whose height at x = 0 is -1. When the boundary passes through the origin, the origin belongs to neither side and cannot decide anything; use another easy point such as (1, 0).
Part 2: other forms, and reading the graph back
Standard form. Take 4x + 3y > 12. There are two routes, and they always agree.
The first route solves for y, which puts the inequality back into Part 1. Subtract 4x from both sides, then divide both sides by 3; dividing by a positive number keeps the direction:
So the boundary is dashed and the region is above it.
The second route never rearranges. Draw the boundary 4x + 3y = 12 from its intercepts, (0, 4) and (3, 0), then test the origin in the original inequality: 4(0) + 3(0) > 12 says 0 > 12, which is false, so the region is the side away from the origin. The origin is below this line, so that is the side above it, as before.
They agree for a reason. Solving Ax + By > C for y ends by dividing by B. When B is positive the symbol keeps its direction and the region is above the boundary; when B is negative the symbol reverses and the region is below. The test point finds the side without needing to know the sign of B. Example 4 has B negative.
Horizontal and vertical boundaries. In the plane, y \ge -1 says nothing about x: every point whose second coordinate is at least -1 is a solution. Its boundary is the horizontal line y = -1, drawn solid, with the region on and above it. Likewise x < 3 allows every point whose first coordinate is less than 3, with y free, so its region lies left of the vertical line x = 3, drawn dashed. On a number line x < 3 was a ray; in the plane each allowed x brings its whole vertical line of points with it, and the ray becomes a half-plane.
Reading an inequality from a graph. Run the procedure backwards. Find the boundary’s equation from two points on it. Dashed means < or >, solid means \le or \ge. Then substitute a point from the shaded region and choose the symbol that makes it true.
Whole-number solutions. In a situation, x and y often count things. The shaded region still holds every pair of real numbers that satisfies the inequality, but 2.5 batches cannot be baked and a count cannot be negative. The solutions that make sense are the lattice points of the region, the points whose coordinates are both integers (for counts, both whole numbers), shown as dots. Keeping the counts at 0 or more is really two more inequalities on top of the first, which is where the overlap of several regions begins.
Worked examples
Examples 1 to 3 go with Part 1; Examples 4 to 7 go with Part 2.
Shading below a solid line
Graph \displaystyle y \le -\frac{2}{3}x + 2.
SolutionThe boundary \displaystyle y = -\frac{2}{3}x + 2 has y-intercept (0, 2), and a slope of \displaystyle -\frac{2}{3} means 3 to the right and 2 down, which reaches (3, 0). The symbol \le allows equality, so the line is solid.
Test the origin, which is not on the line: \displaystyle 0 \le -\frac{2}{3}(0) + 2 says 0 \le 2, which is true. Shade the origin’s side, which is below the line, as y \le predicts.
Check with a point on the other side. (3, 3) is above the line, and 3 \le -2 + 2 says 3 \le 0, which is false, so it is correctly left unshaded.
A boundary through the origin
Graph y < 3x.
SolutionThe boundary y = 3x passes through (0, 0) and (1, 3). The symbol is <, so it is dashed.
The origin is on the boundary: substituting it gives 0 < 0, which is false, but that only confirms the boundary is excluded and says nothing about either side. Use (1, 0) instead. The line’s height at x = 1 is 3, so (1, 0) is off the line, and 0 < 3(1) says 0 < 3, which is true. Shade the side containing (1, 0).
That side is below the line, as y < predicts. Because the line is steep, “below” also looks like “to the right”.
Points on the boundary and points near it
For \displaystyle y > -\frac{1}{2}x - 3, decide which of (0, 0), (-4, -1), (2, -5) and (6, -5) are solutions, and describe the graph.
SolutionFor each point, work out the height of the line \displaystyle y = -\frac{1}{2}x - 3 at that point’s x, then compare the point’s y with it.
| Point | Height of the line, \displaystyle -\frac{1}{2}x - 3 | Is y greater? |
|---|---|---|
| (0, 0) | -3 | 0 > -3, yes |
| (-4, -1) | 2 - 3 = -1 | -1 > -1, no |
| (2, -5) | -1 - 3 = -4 | -5 > -4, no |
| (6, -5) | -3 - 3 = -6 | -5 > -6, yes |
So (0, 0) and (6, -5) are solutions; (-4, -1) and (2, -5) are not. The point (-4, -1) lies exactly on the boundary, and with a strict > a point on the boundary fails.
The graph is the dashed line through (0, -3) with slope \displaystyle -\frac{1}{2}, also through (2, -4) and (-4, -1), with the region above it shaded, which is the origin’s side.
The points (2, -5) and (6, -5) have the same y and still land on opposite sides. Whether a point is a solution depends on its y compared with the line’s height at its own x, never on its y alone. The line falls as x grows, so at x = 6 it has dropped below -5.
Standard form, two ways
Graph 3x - 2y \le 6.
SolutionSolving for y. Subtract 3x from both sides:
Now divide both sides by -2. Dividing by a negative number reverses the order of any two numbers, so \le turns into \ge:
The boundary has y-intercept (0, -3) and slope \displaystyle \frac{3}{2}, which reaches (2, 0). It is solid, and y \ge means the region is on and above it.
Testing a point directly. The boundary 3x - 2y = 6 has intercepts (2, 0) and (0, -3), the same line. The origin is not on it, and 3(0) - 2(0) \le 6 says 0 \le 6, which is true, so the region is the origin’s side.
The routes agree: the origin is above the line, since 0 \ge -3. Only the first route needed the reversal.
Horizontal and vertical boundaries
Graph (a) y \ge -1 \qquad (b) x < 3
Solution(a) Only y is restricted, so every point whose second coordinate is -1 or more is a solution. The boundary y = -1 is the horizontal line through (0, -1), solid because of the \ge, and the region is on and above it. The origin agrees: 0 \ge -1.
(b) Only x is restricted. The boundary x = 3 is the vertical line through (3, 0), dashed because of the <, and the region is to its left. The origin agrees again: 0 < 3.
In (b) there is no y to solve for and no above or below, only left and right. The test point still works, since it only asks whether one point makes the statement true.
Reading the inequality from a graph
Write an inequality whose graph is the shaded region below.
The boundary passes through (-3, 0) and (0, 2). Its slope is
and its y-intercept is 2, so the boundary is \displaystyle y = \frac{2}{3}x + 2.
The line is dashed, so the symbol is < or >. The origin is shaded, and substituting it gives 0 on the left and 2 on the right. Since 0 < 2, the symbol is <:
Check with a point on each side. (3, 0) is shaded, and the line’s height at x = 3 is 4, so 0 < 4 holds. (-3, 2) is unshaded, and the height at x = -3 is 0, so 2 < 0 fails, as it should.
The same region has other names. Multiplying both sides by 3 gives 3y < 2x + 6, and moving the terms around gives 2x - 3y > -6, whose origin test, 0 > -6, is also true.
Batches in an oven
A bakery’s oven is free for at most 12 hours a day and bakes one batch at a time. A batch of bread takes 2 hours and a batch of cakes takes 3 hours. With b batches of bread and c batches of cakes, the oven time is 2b + 3c hours, so every possible day satisfies
Show the possible days on a graph with b across and c up. Which plans use all 12 hours? Can the bakery bake 4 batches of bread and 2 of cakes?
SolutionThe boundary 2b + 3c = 12 has intercepts (6, 0) and (0, 4). “At most” allows exactly 12, so the line is solid. The origin gives 0 \le 12, which is true, so the region is the origin’s side.
Now the situation narrows things. A batch is either baked or not, so b and c are whole numbers, and the plans are the lattice points in the shaded triangle, edges included. Row by row:
| Cakes, c | Room left for bread | Bread, b | Plans |
|---|---|---|---|
| 0 | 2b \le 12 | 0 to 6 | 7 |
| 1 | 2b \le 9 | 0 to 4 | 5 |
| 2 | 2b \le 6 | 0 to 3 | 4 |
| 3 | 2b \le 3 | 0 or 1 | 2 |
| 4 | 2b \le 0 | 0 | 1 |
That is 19 plans, counting the day the oven bakes nothing.
The plans that use all 12 hours are the lattice points on the boundary: (6, 0), (3, 2) and (0, 4). The line also passes through (1.5, 3), but one and a half batches of bread is not a plan: that point solves the inequality and not the problem.
For 4 batches of bread and 2 of cakes, 2(4) + 3(2) = 14, and 14 \le 12 is false. The point (4, 2) is outside the region: that day needs 14 hours.
Boundaries
The boundary must be a line. The method needs an inequality linear in x and y, such as Ax + By < C, with A and B not both 0. If both are 0 there is no boundary at all: 0x + 0y < 5 holds at every point and 0x + 0y > 5 at none. An inequality with x^2 or xy in it has a curved boundary, which needs more care.
The test point must be off the boundary. A point on the line belongs to neither side.
Dashed or solid is about the boundary only. It has no effect on which side is shaded.
“Above” and “below” need y alone with a positive coefficient. In standard form the side depends on the sign of the coefficient of y. A vertical boundary has only a left and a right.
The picture is a window. The region continues forever in every direction the grid cuts off.
In a situation, the graph is only the start. The shaded region holds every real solution. Whole-number counts and quantities that cannot be negative pick out the part that makes sense, and those limits are inequalities of their own.
Where this goes next
One inequality gives one half-plane. Most real conditions come in groups: a time limit and a money limit together, or a count that must stay at least 0. Keeping only the points every condition allows is the overlap of shaded regions, and a set of such conditions is a system of linear inequalities. Turning the limits of a situation into those inequalities is writing and interpreting constraints. Once the region of possible plans is drawn, linear programming asks which plan is best, and the answer sits at a corner of the region.
Exercises
Exercises 1 to 6 go with Part 1 (Examples 1 to 3) and Exercises 7 to 18 with Part 2 (Examples 4 to 7). To answer a graphing exercise in words, give the boundary line and two points on it, say whether it is dashed or solid, and say which side is shaded.
Part 1: is the point a solution
- Which of (0, 0), (3, 4), (-1, -8) and (2, 2) are solutions of y < 3x - 4?
- Which of (1, 3), (-2, 0) and (4, 1) are solutions of y \ge -2x + 5?
Part 1: graph the inequality
- y > x - 3
- y \le 2x - 4
- \displaystyle y \ge -\frac{1}{3}x + 1
- y < -4x
Part 2: standard form
Graph each inequality. In Exercises 7 to 9 solve for y first; in Exercises 10 and 11 use intercepts and a test point.
- 2x + y \ge 4
- x - 4y > 8
- 4x - 5y \le 20
- 5x + 2y < 10
- -x + 2y < 0
Part 2: horizontal and vertical boundaries
- y < 2
- -3x > 6
Part 2: reading the graph
Write an inequality for each region.
- Region A
- Region B
- Region C
Part 2: whole-number solutions
A florist has 15 roses for the day. A bouquet uses 3 roses and a corsage uses 2, so a day with b bouquets and c corsages satisfies 3b + 2c \le 15.
- Describe the graph of 3b + 2c \le 15 with b across and c up, and say which of its points are possible days. Can the florist make 2 bouquets and 4 corsages? 4 bouquets and 2 corsages?
- Which days use all 15 roses? How many possible days are there altogether, counting the day nothing is made?
Reasoning
- Explain why every point directly above a point of the line y = 2x - 1 is a solution of y > 2x - 1, and every point directly below one is not.
- Explain why testing a single point off the boundary is enough to decide which side to shade.
- Explain why the graph of x \ge 1 is a ray on a number line but a half-plane in the coordinate plane.
- Explain why 0x + 0y < 5 has the whole plane as its graph, why 0x + 0y > 5 has no points at all, and why neither has a boundary line.
Answers
- (3, 4) and (-1, -8): 4 < 5 and -8 < -7. The origin gives 0 < -4, false, and (2, 2) gives 2 < 2, false: it is on the dashed boundary.
- (1, 3) and (4, 1): (1, 3) gives 3 \ge 3, true, since it lies on the solid boundary, and (4, 1) gives 1 \ge -3. (-2, 0) gives 0 \ge 9, false.
- Dashed line y = x - 3 through (0, -3) and (3, 0); shade above it, the origin’s side, since 0 > -3.
- Solid line y = 2x - 4 through (0, -4) and (2, 0); shade below it, away from the origin, since 0 \le -4 is false.
- Solid line \displaystyle y = -\frac{1}{3}x + 1 through (0, 1) and (3, 0); shade above it, away from the origin, since 0 \ge 1 is false.
- Dashed line y = -4x through (0, 0) and (1, -4); shade below it. The origin is on the line, so test (1, 0): 0 < -4 is false, and the shaded side is away from (1, 0).
- y \ge -2x + 4: solid line through (0, 4) and (2, 0); shade above it. The origin gives 0 \ge 4, false, which agrees.
- \displaystyle y < \frac{1}{4}x - 2: dashed line through (0, -2) and (8, 0); shade below it. From -4y > -x + 8, dividing by -4 reverses the symbol. Check: the origin, above the line, gives 0 > 8, false.
- \displaystyle y \ge \frac{4}{5}x - 4: solid line through (0, -4) and (5, 0); shade above it. From -5y \le -4x + 20, dividing by -5 reverses the symbol. Check: the origin gives 0 \le 20.
- Dashed line 5x + 2y = 10 through (2, 0) and (0, 5). The origin gives 0 < 10, true, so shade its side, which is below the line.
- Dashed line -x + 2y = 0. Both intercepts are (0, 0), so a second point comes from the equation: x = 2 gives 2y = 2, the point (2, 1). The origin is on the line, so test (0, 1): 0 + 2 < 0 is false. Shade the side away from (0, 1), which is below the line \displaystyle y = \frac{1}{2}x.
- Dashed horizontal line y = 2 through (0, 2); shade below it, every point with second coordinate less than 2.
- x < -2: dashed vertical line x = -2 through (-2, 0); shade to its left. Dividing both sides of -3x > 6 by -3 reverses the symbol.
- \displaystyle y \le -\frac{1}{2}x + 2, or in standard form x + 2y \le 4. The solid boundary passes through (0, 2) and (4, 0), with slope \displaystyle -\frac{1}{2}, and the shaded origin gives 0 \le 2.
- x > -1. The boundary is the dashed vertical line x = -1 and the shaded side is the right, which contains the origin: 0 > -1.
- y > 3x - 1. The dashed boundary passes through (0, -1) and (1, 2), with slope 3, and the shaded origin gives 0 > -1.
- Solid line 3b + 2c = 15 through (5, 0) and \displaystyle (0, \frac{15}{2}); shade the origin’s side, since 0 \le 15. The possible days are the lattice points on or below the line with b \ge 0 and c \ge 0. 2 bouquets and 4 corsages: yes, 6 + 8 = 14 \le 15, with 1 rose left. 4 bouquets and 2 corsages: no, 12 + 4 = 16.
- (1, 6), (3, 3) and (5, 0) use all 15 roses; there are 27 possible days. On the line, 2c = 15 - 3b must be even and not negative, so b is odd: b = 1, 3, 5 give c = 6, 3, 0. For b from 0 to 5 the largest c allowed is 7, 6, 4, 3, 1, 0, giving 8 + 7 + 5 + 4 + 2 + 1 = 27 days.
- A point of the line has the form (a, 2a - 1). A point directly above it is (a, y) with y > 2a - 1, which is the statement y > 2x - 1 at x = a. A point directly below has y < 2a - 1, so the statement is false there. Every point is above, on or below the line in its own column, so the solutions are exactly the points above the line.
- Every point on one side of the boundary satisfies the inequality and every point on the other fails it: with y alone this is the column argument of Exercise 19, any other form with a y solves for y to give that case, and a form with no y compares x with a fixed number. So one point off the line shows which whole side is the solution side.
- On a number line a point is one number, so x \ge 1 picks out 1 and everything to its right, a ray. In the plane a point has two coordinates and x \ge 1 restricts only the first, so each allowed x comes with every y, a whole vertical line of points. Together these fill everything on or to the right of the line x = 1, a half-plane.
- At every point, 0x + 0y equals 0. So 0x + 0y < 5 says 0 < 5, true everywhere, and 0x + 0y > 5 says 0 > 5, false everywhere. A boundary line would be the set where 0x + 0y = 5, that is, where 0 = 5, and no point makes that true.