Skip to content
Graph Linear Inequalities in Two Variables

Graph Linear Inequalities in Two Variables

By the end of this section, you will be able to: verify solutions to an inequality in two variables, recognize the relation between the solutions of an inequality and its graph, graph linear inequalities in two variables, and solve applications using linear inequalities in two variables.

Verify solutions to an inequality in two variables

Previously we learned to solve inequalities with only one variable. We will now learn about inequalities containing two variables. In particular we will look at linear inequalities in two variables which are very similar to linear equations in two variables.

Linear inequalities in two variables have many applications. If you ran a business, for example, you would want your revenue to be greater than your costs—so that your business made a profit.

Linear inequality. A linear inequality is an inequality that can be written in one of the following forms:

Ax+By>CAx+ByCAx+By<CAx+ByCAx + By > C \qquad Ax + By \geq C \qquad Ax + By < C \qquad Ax + By \leq C

where AA and BB are not both zero.

Recall that an inequality with one variable had many solutions. For example, the solution to the inequality x>3x > 3 is any number greater than 33. We showed this on the number line by shading in the number line to the right of 33, and putting an open parenthesis at 33.

−5−4−3−2−1012345(

Similarly, linear inequalities in two variables have many solutions. Any ordered pair (x,y)(x,y) that makes an inequality true when we substitute in the values is a solution to a linear inequality.

Solution to a linear inequality. An ordered pair (x,y)(x,y) is a solution to a linear inequality if the inequality is true when we substitute the values of xx and yy.

Example. Determine whether each ordered pair is a solution to the inequality y>x+4y > x + 4: (a) (0,0)(0,0) (b) (1,6)(1,6) (c) (2,6)(2,6) (d) (5,15)(-5,-15) (e) (8,12)(-8,12).

(a) Substitute 00 for xx and 00 for yy.

y>x+4Substitute.0>?0+4Simplify.04 \begin{array}{lrcl} & y &>& x+4 \\[4pt] \text{Substitute.} & 0 &\overset{?}{>}& 0+4 \\[4pt] \text{Simplify.} & 0 &\not>& 4 \end{array}

So, (0,0)(0,0) is not a solution to y>x+4y > x+4.

(b) Substitute 11 for xx and 66 for yy.

y>x+4Substitute.6>?1+4Simplify.6>5 \begin{array}{lrcl} & y &>& x+4 \\[4pt] \text{Substitute.} & 6 &\overset{?}{>}& 1+4 \\[4pt] \text{Simplify.} & 6 &>& 5 \end{array}

So, (1,6)(1,6) is a solution to y>x+4y > x+4.

(c) Substitute 22 for xx and 66 for yy.

y>x+4Substitute.6>?2+4Simplify.66 \begin{array}{lrcl} & y &>& x+4 \\[4pt] \text{Substitute.} & 6 &\overset{?}{>}& 2+4 \\[4pt] \text{Simplify.} & 6 &\not>& 6 \end{array}

So, (2,6)(2,6) is not a solution to y>x+4y > x+4.

(d) Substitute 5-5 for xx and 15-15 for yy.

y>x+4Substitute.15>?5+4Simplify.151 \begin{array}{lrcl} & y &>& x+4 \\[4pt] \text{Substitute.} & -15 &\overset{?}{>}& -5+4 \\[4pt] \text{Simplify.} & -15 &\not>& -1 \end{array}

So, (5,15)(-5,-15) is not a solution to y>x+4y > x+4.

(e) Substitute 8-8 for xx and 1212 for yy.

y>x+4Substitute.12>?8+4Simplify.12>4 \begin{array}{lrcl} & y &>& x+4 \\[4pt] \text{Substitute.} & 12 &\overset{?}{>}& -8+4 \\[4pt] \text{Simplify.} & 12 &>& -4 \end{array}

So, (8,12)(-8,12) is a solution to y>x+4y > x+4.

For the inequality y>x3y > x-3, determine whether each ordered pair is a solution.

Is (0,0)(0,0) a solution to y>x3y > x-3?

Is (4,9)(4,9) a solution to y>x3y > x-3?

Is (5,1)(5,1) a solution to y>x3y > x-3?

For the inequality y<x+1y < x+1, determine whether each ordered pair is a solution.

Is (0,0)(0,0) a solution to y<x+1y < x+1?

Is (8,6)(8,6) a solution to y<x+1y < x+1?

Is (2,1)(-2,-1) a solution to y<x+1y < x+1?

Recognize the relation between the solutions of an inequality and its graph

Now, we will look at how the solutions of an inequality relate to its graph.

Let’s think about the number line shown previously again. The point x=3x=3 separated that number line into two parts. On one side of 33 are all the numbers less than 33. On the other side of 33 all the numbers are greater than 33.

Similarly, the line y=x+4y=x+4 separates the plane into two regions. On one side of the line are points with y<x+4y<x+4. On the other side of the line are the points with y>x+4y>x+4. We call the line y=x+4y=x+4 a boundary line.

Boundary line. The line with equation Ax+By=CAx+By=C is the boundary line that separates the region where Ax+By>CAx+By>C from the region where Ax+By<CAx+By<C.

For an inequality in one variable, the endpoint is shown with a parenthesis or a bracket depending on whether or not it is included in the solution. Similarly, for an inequality in two variables, the boundary line is shown with a solid or dashed line to show whether or not the line is included in the solution.

InequalityBoundary lineInclusion
Ax+By<CAx+By<C or Ax+By>CAx+By>CAx+By=CAx+By=CBoundary line is not included in solution. Boundary line is dashed.
Ax+ByCAx+By\leq C or Ax+ByCAx+By\geq CAx+By=CAx+By=CBoundary line is included in solution. Boundary line is solid.

Now, let’s take a look at what we found in the preceding example. We’ll start by graphing the line y=x+4y=x+4, and then we’ll plot the five points we tested.

xy−16−14−12−10−8−6−4−2246810121416−16−14−12−10−8−6−4−2246810121416(0, 0)(1, 6)(2, 6)(−5, −15)(−8, 12)

Some of the points were solutions to y>x+4y>x+4 and some were not. The points (1,6)(1,6) and (8,12)(-8,12) are solutions. Notice that they are both on the same side of the boundary line y=x+4y=x+4.

The two points (0,0)(0,0) and (5,15)(-5,-15) are on the other side of the boundary line, and they are not solutions to y>x+4y>x+4. For those two points, y<x+4y<x+4.

What about the point (2,6)(2,6)? Because 6=2+46=2+4, the point is a solution to the equation y=x+4y=x+4, but not a solution to the inequality y>x+4y>x+4. So the point (2,6)(2,6) is on the boundary line.

Let’s take another point above the boundary line and test whether or not it is a solution to y>x+4y>x+4. The point (0,10)(0,10) clearly looks to be above the boundary line. Is it a solution to the inequality?

y>x+410>?0+410>4 \begin{array}{rcl} y &>& x+4 \\[4pt] 10 &\overset{?}{>}& 0+4 \\[4pt] 10 &>& 4 \end{array}

So, (0,10)(0,10) is a solution to y>x+4y>x+4. Any point you choose above the boundary line is a solution to the inequality. All points above the boundary line are solutions. Similarly, all points below the boundary line are not solutions to y>x+4y>x+4.

The line y=x+4y=x+4 divides the plane into two regions. The shaded side shows the solutions to y>x+4y>x+4. The points on the boundary line, those where y=x+4y=x+4, are not solutions, so the line itself is not part of the solution. We show that by making the line dashed, not solid.

xy−8−6−4−22468−8−6−4−22468

Example. The boundary line shown in this graph is y=2x1y=2x-1. Write the inequality shown by the graph. The boundary line is solid, and the side containing (0,0)(0,0) is shaded.

xy−8−6−4−22468−8−6−4−22468

The line y=2x1y=2x-1 is the boundary line. On one side of the line are the points with y>2x1y>2x-1 and on the other side are the points with y<2x1y<2x-1. Let’s test the point (0,0)(0,0) and see which inequality describes its position relative to the boundary line.

At (0,0)(0,0), which inequality is true: y>2x1y>2x-1 or y<2x1y<2x-1?

0>?2010>1True0<?20101False \begin{array}{rcl} 0 &\overset{?}{>}& 2\cdot0-1 \\[4pt] 0 &>& -1 \quad \text{True} \end{array} \qquad \begin{array}{rcl} 0 &\overset{?}{<}& 2\cdot0-1 \\[4pt] 0 &\not<& -1 \quad \text{False} \end{array}

Since y>2x1y>2x-1 is true, the side of the line with (0,0)(0,0) is the solution. The shaded region shows the solution of y>2x1y>2x-1. Since the boundary line is graphed with a solid line, the inequality includes the equal sign. The graph shows the inequality y2x1y\geq2x-1.

We could use any point as a test point, provided it is not on the line. We chose (0,0)(0,0) because it’s the easiest to evaluate. You may want to pick a point on the other side of the boundary line and check that y<2x1y<2x-1.

Write the inequality shown by a solid boundary line y=2x+3y=-2x+3 with the region to the right of the line shaded.

Write the inequality shown by a solid boundary line y=12x4y=\tfrac{1}{2}x-4 with the region below the line shaded.

Example. The boundary line shown in this graph is 2x+3y=62x+3y=6. Write the inequality shown by the graph. The boundary line is dashed, and the side containing (0,0)(0,0) is shaded.

xy−8−6−4−22468−8−6−4−22468

The line 2x+3y=62x+3y=6 is the boundary line. On one side are the points with 2x+3y>62x+3y>6 and on the other side are the points with 2x+3y<62x+3y<6. Let’s test the point (0,0)(0,0) and see which inequality describes its side.

2(0)+3(0)>?606False2(0)+3(0)<?60<6True \begin{array}{rcl} 2(0)+3(0) &\overset{?}{>}& 6 \\[4pt] 0 &\not>& 6 \quad \text{False} \end{array} \qquad \begin{array}{rcl} 2(0)+3(0) &\overset{?}{<}& 6 \\[4pt] 0 &<& 6 \quad \text{True} \end{array}

So the side with (0,0)(0,0) is the side where 2x+3y<62x+3y<6. You may want to pick a point on the other side and check that 2x+3y>62x+3y>6. Since the boundary line is dashed, the inequality does not include an equal sign. The shaded region shows the solution to 2x+3y<62x+3y<6.

Write the inequality shown by a solid boundary line x4y=8x-4y=8 with the region above the line shaded.

Write the inequality shown by a solid boundary line 3xy=63x-y=6 with the region to the right of the line shaded.

Graph linear inequalities in two variables

Now that we know what the graph of a linear inequality looks like and how it relates to a boundary equation we can use this knowledge to graph a given linear inequality.

Example. Graph the linear inequality y34x2y\geq\tfrac{3}{4}x-2.

Step 1. Identify and graph the boundary line. Replace the inequality sign with an equal sign to find the boundary line. Graph the boundary line y=34x2y=\tfrac{3}{4}x-2. The inequality sign is \geq, so we draw a solid line.

Step 2. Test a point that is not on the boundary line. Is it a solution of the inequality? We’ll test (0,0)(0,0).

0?34(0)20 \overset{?}{\geq} \tfrac{3}{4}(0)-2

Since 020\geq-2, (0,0)(0,0) is a solution.

Step 3. Shade in one side of the boundary line. The test point (0,0)(0,0) is a solution to y34x2y\geq\tfrac{3}{4}x-2, so we shade in that side. All points in the shaded region and on the boundary line represent the solutions.

xy−6−4−2246−6−4−2246

Graph a linear inequality in two variables.

  1. Identify and graph the boundary line.
    • If the inequality is \leq or \geq, the boundary line is solid.
    • If the inequality is << or >>, the boundary line is dashed.
  2. Test a point that is not on the boundary line. Is it a solution of the inequality?
  3. Shade in one side of the boundary line.
    • If the test point is a solution, shade in the side that includes the point.
    • If the test point is not a solution, shade in the opposite side.

For y52x4y\geq\tfrac{5}{2}x-4, which graph is correct?

For y<23x5y<\tfrac{2}{3}x-5, which graph is correct?

Example. Graph the linear inequality x2y<5x-2y<5.

First, we graph the boundary line x2y=5x-2y=5. The inequality is << so we draw a dashed line.

xy−8−6−4−22468−8−6−4−22468

Then, we test a point. We’ll use (0,0)(0,0) again because it is easy to evaluate and it is not on the boundary line.

02(0)<?500<50<5 \begin{array}{rcl} 0-2(0) &\overset{?}{<}& 5 \\[4pt] 0-0 &<& 5 \\[4pt] 0 &<& 5 \end{array}

The point (0,0)(0,0) is a solution of x2y<5x-2y<5, so we shade in that side of the boundary line. All points in the shaded region, but not those on the boundary line, represent the solutions.

xy−8−6−4−22468−8−6−4−22468

For 2x3y<62x-3y<6, which graph is correct?

For 2xy>32x-y>3, which graph is correct?

What if the boundary line goes through the origin? Then, we won’t be able to use (0,0)(0,0) as a test point. No problem—we’ll just choose some other point that is not on the boundary line.

Example. Graph the linear inequality y4xy\leq-4x.

First, we graph the boundary line y=4xy=-4x. It is in slope-intercept form, with m=4m=-4 and b=0b=0. The inequality is \leq so we draw a solid line.

Now we need a test point. We can see that the point (1,0)(1,0) is not on the boundary line. Is (1,0)(1,0) a solution of y4xy\leq-4x?

0?4(1)0≰40 \overset{?}{\leq} -4(1) \qquad 0 \not\leq -4

The point (1,0)(1,0) is not a solution, so we shade in the opposite side of the boundary line. All points in the shaded region and on the boundary line represent the solutions.

xy−8−6−4−22468−8−6−4−22468

For y>3xy>-3x, which graph is correct?

For y2xy\geq-2x, which graph is correct?

Some linear inequalities have only one variable. They may have an xx but no yy, or a yy but no xx. In these cases, the boundary line will be either a vertical or a horizontal line. Recall that x=ax=a is a vertical line and y=by=b is a horizontal line.

Example. Graph the linear inequality y>3y>3.

First, we graph the boundary line y=3y=3. It is a horizontal line. The inequality is >> so we draw a dashed line. We test the point (0,0)(0,0). Since 030\not>3, (0,0)(0,0) is not a solution. So we shade the side that does not include (0,0)(0,0).

xy−8−6−4−22468−8−6−4−22468

All points in the shaded region, but not those on the boundary line, represent the solutions to y>3y>3.

For y<5y<5, which graph is correct?

For y1y\leq-1, which graph is correct?

Solve applications using linear inequalities in two variables

Many fields use linear inequalities to model a problem. While our examples may be about simple situations, they give us an opportunity to build our skills and to get a feel for how they might be used.

Example. Hilaria works two part time jobs in order to earn enough money to meet her obligations of at least $240 a week. Her job in food service pays $10 an hour and her tutoring job on campus pays $15 an hour. How many hours does Hilaria need to work at each job to earn at least $240?

(a) Let xx be the number of hours she works at the job in food service and let yy be the number of hours she works tutoring. Write an inequality that would model this situation.

We let xx be the number of hours she works at the job in food service and let yy be the number of hours she works tutoring. She earns $10 per hour at the job in food service and $15 an hour tutoring. At each job, the number of hours multiplied by the hourly wage will give the amount earned at that job. The amount earned at the food service job plus the amount earned tutoring is at least $240:

10x+15y24010x+15y\geq240

(b) Graph the inequality. To graph it, we put it in slope-intercept form.

10x+15y24015y10x+240y23x+16 \begin{array}{rcl} 10x+15y &\geq& 240 \\[4pt] 15y &\geq& -10x+240 \\[4pt] y &\geq& -\tfrac{2}{3}x+16 \end{array}
xy2468101214161820222426283024681012141618202224262830

(c) From the graph, we see that the ordered pairs (15,10)(15,10), (0,16)(0,16), (24,0)(24,0) represent three of infinitely many solutions. Check the values in the inequality.

10(15)+15(10)=30024010(0)+15(16)=24024010(24)+15(0)=240240 \begin{array}{rcl} 10(15)+15(10) &=& 300\geq240 \\[4pt] 10(0)+15(16) &=& 240\geq240 \\[4pt] 10(24)+15(0) &=& 240\geq240 \end{array}

For Hilaria, it means that to earn at least $240, she can work 15 hours tutoring and 10 hours at her fast-food job, earn all her money tutoring for 16 hours, or earn all her money while working 24 hours at the job in food service.

Hugh works two part time jobs. One at a grocery store that pays $10 an hour and the other is babysitting for $13 hour. Between the two jobs, Hugh wants to earn at least $260 a week. How many hours does Hugh need to work at each job to earn at least $260?

Let xx be the number of hours Hugh works at the grocery store and let yy be the number of hours he works babysitting. Write an inequality that would model this situation.

xy2468101214161820222426283024681012141618202224262830

Three ordered pairs that are solutions are (0,20)(0,20), (13,10)(13,10), and (26,0)(26,0). They mean Hugh can earn at least $260 by babysitting 20 hours, working 13 hours at each job, or working 26 hours at the grocery store.

Veronica works two part time jobs in order to earn enough money to meet her obligations of at least $280 a week. Her job at the day spa pays $10 an hour and her administrative assistant job on campus pays $17.50 an hour. How many hours does Veronica need to work at each job to earn at least $280?

Let xx be the number of hours Veronica works at the day spa and let yy be the number of hours she works as administrative assistant. Write an inequality that would model this situation.

xy2468101214161820222426283024681012141618202224262830

Three ordered pairs that are solutions are (0,16)(0,16), (14,8)(14,8), and (28,0)(28,0). They mean Veronica can earn at least $280 by working 16 hours as an administrative assistant, working 14 hours at the day spa and 8 hours as an administrative assistant, or working 28 hours at the day spa.

Key terms

linear inequality — an inequality that can be written as Ax+By>CAx+By>C, Ax+ByCAx+By\geq C, Ax+By<CAx+By<C, or Ax+ByCAx+By\leq C, where AA and BB are not both zero. solution to a linear inequality — an ordered pair (x,y)(x,y) that makes the inequality true when the values are substituted. boundary line — the line Ax+By=CAx+By=C that separates the region where Ax+By>CAx+By>C from the region where Ax+By<CAx+By<C.


This section is adapted from Intermediate Algebra 2e, Section 3.4: Graph Linear Inequalities in Two Variables by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated number-line and coordinate-plane figures as accessible interactive graphics; omitted the Be Prepared quiz, Media link, Self Check, and Section Exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback.