Graphing an Inequality in Two Variables

Draw the boundary, test a point, shade the side.

Start with the boundary

The inequality y > x + 1 has two variables, so each solution is a pair of values, a point (x, y). There are infinitely many of them, and on a graph they fill a whole region of the plane.

Begin by drawing the line y = x + 1. Every point on it makes y exactly equal to x + 1. This line is the boundary: on one side of it y is larger than x + 1, and on the other side y is smaller.

xyy = x + 1

The line y = x + 1. On it, y and x + 1 are equal.

Test a point off the line

To find which side holds the solutions, test one point that is not on the line. Take (−2, 4). Here x + 1 = −2 + 1 = −1, and y = 4. Is 4 > −1? Yes, so (−2, 4) is a solution.

Now take (3, 0), on the other side. Here x + 1 = 3 + 1 = 4, and y = 0. Is 0 > 4? No, so (3, 0) is not a solution.

One test settles a whole side. To go from a point where y > x + 1 to a point where y < x + 1, you would have to cross the place where y = x + 1, and that is the line. So every point on the same side as (−2, 4) is a solution, and no point on the other side is.

xyy = x + 1(−2, 4)(3, 0)

(−2, 4) is above the line and satisfies y > x + 1. (3, 0) is below it and does not.

Shade the side, and choose the line

Shade the side that holds (−2, 4). For y > x + 1 that is everything above the line.

Then decide how to draw the boundary. The sign > is strict: on the line y equals x + 1, which is not greater than it, so no point on the line is a solution. The boundary is drawn dashed to show that it is left out, just as a hollow circle leaves a boundary out on a number line.

For y ≥ x + 1 the points on the line are solutions too, because there y = x + 1. The same side is shaded, and the boundary is drawn solid, like a filled circle.

xyy > x + 1(−2, 4)

y > x + 1: the side holding (−2, 4) is shaded, and the dashed boundary is not part of it.

xy

y ≥ x + 1: the same region, with the boundary drawn solid because the points on it are solutions.

The shading is not always above

Take y ≤ 6 − 2x. Draw the boundary y = 6 − 2x, solid because the sign is ≤. Then test the origin, (0, 0): 6 − 2 × 0 = 6, and 0 ≤ 6 is true. So the origin is a solution, and the side that holds it is shaded. Here that side is below the line.

The origin is the easiest point to test, because its coordinates are both 0. If the boundary passes through the origin, as y > 2x does, the origin is on the line and cannot decide the side, so test another point such as (1, 0) or (0, 1).

Testing a point always works, however the inequality is written. With y alone on the left, > and ≥ shade above the line and < and ≤ shade below it; for an inequality such as 2x + 6y ≤ 60, a test point is the reliable way to find the side.

xy
(0, 0)

y ≤ 6 − 2x: the origin satisfies it, so the side holding the origin, below the solid line, is shaded.

The usual mistakes

Swapping dashed and solid. A dashed line leaves the boundary out and goes with < and >. A solid line includes it and goes with ≤ and ≥.

Shading a side without testing it. For y ≤ 6 − 2x, the test at (0, 0) shows the solutions are below the line; shading above it would be a guess, and a wrong one.

Shading only the line. The line is where the two sides are equal. The solutions of an inequality fill a whole side of it.

Worked example: Chairs and Tables That Must Fit a Floor Area

Question A hall has 60 m2 of floor for furniture. Each chair needs 2 m2 of floor and each table needs 6 m2. There are x chairs and y tables. (a) Write an inequality in x and y for the furniture to fit, and describe the region of the graph that it gives. (b) Use the inequality to decide whether 12 chairs and 5 tables fit, and whether 18 chairs and 5 tables fit.

  1. 1.The chairs use 2x m2 and the tables use 6y m2. Together they cannot use more than 60 m2, so 2x + 6y ≤ 60.

    0246810120102030chairs, xtables, y2x + 6y ≤ 60
    0246810120102030chairs, xtables, y2x + 6y ≤ 60
    The chairs use 2x m2 and the tables use 6y m2, so 2x + 6y ≤ 60.
  2. 2.The boundary is the line 2x + 6y = 60. When x = 0, 6y = 60 and y = 10. When y = 0, 2x = 60 and x = 30. The line joins (0, 10) and (30, 0), and it is drawn solid because the sign ≤ includes the points on the line.

    0246810120102030chairs, xtables, y2x + 6y = 60x = 0 gives y = 10, and y = 0 gives x = 30a solid line, because ≤ includes the line
    0246810120102030chairs, xtables, y2x + 6y = 60x = 0 gives y = 10, and y = 0 gives x = 30a solid line, because ≤ includes the line
    The boundary 2x + 6y = 60 joins (0, 10) and (30, 0). It is solid because ≤ includes the line.
  3. 3.Test the point (0, 0): 2 × 0 + 6 × 0 = 0, and 0 ≤ 60 is true. (a) The inequality is 2x + 6y ≤ 60. Its region is the side of the line that contains (0, 0), with x and y not negative.

    0246810120102030chairs, xtables, y2x + 6y = 60(0, 0)test (0, 0): 0 ≤ 60 is trueshade the side that contains (0, 0)
    0246810120102030chairs, xtables, y2x + 6y = 60(0, 0)test (0, 0): 0 ≤ 60 is trueshade the side that contains (0, 0)
    (a) (0, 0) gives 0 ≤ 60, which is true, so the region is the side of the line that contains (0, 0).
  4. 4.For 12 chairs and 5 tables, 2 × 12 + 6 × 5 = 24 + 30 = 54, and 54 ≤ 60 is true. The point (12, 5) lies inside the region.

    0246810120102030chairs, xtables, y2x + 6y = 60(12, 5)(12, 5): 24 + 30 = 54, and 54 ≤ 60 is true
    0246810120102030chairs, xtables, y2x + 6y = 60(12, 5)(12, 5): 24 + 30 = 54, and 54 ≤ 60 is true
    12 chairs and 5 tables use 24 + 30 = 54 m2, so (12, 5) is inside the region.
  5. 5.(b) For 18 chairs and 5 tables, 2 × 18 + 6 × 5 = 36 + 30 = 66, and 66 ≤ 60 is false. So 12 chairs and 5 tables fit, using 54 m2, but 18 chairs and 5 tables do not, because they need 66 m2.

    0246810120102030chairs, xtables, y2x + 6y = 60(12, 5)(18, 5)(12, 5): 54 ≤ 60 is true, so they fit(18, 5): 36 + 30 = 66, and 66 ≤ 60 is false
    0246810120102030chairs, xtables, y2x + 6y = 60(12, 5)(18, 5)(12, 5): 54 ≤ 60 is true, so they fit(18, 5): 36 + 30 = 66, and 66 ≤ 60 is false
    (b) 18 chairs and 5 tables need 66 m2, so (18, 5) is outside the region and they do not fit.

Answer: (a) 2x + 6y ≤ 60: the region on and below the line through (0, 10) and (30, 0); (b) 12 chairs and 5 tables fit (54 m2), 18 chairs and 5 tables do not (66 m2)

Common mistakes

  • Writing x + y ≤ 60. That counts pieces of furniture. The limit is on floor area, so each chair counts as 2 and each table as 6.
  • Shading the side of the line away from (0, 0) without testing a point. An empty hall uses 0 m2, which certainly fits, so (0, 0) must be in the shaded region.

More equations and inequalities problems, worked step by step →

Practice Graphing an Inequality in Two Variables in the app