Skip to content
Family Table Math
Auto

Graphing Lines and Regions

Not every relation arrives in the form y=mx+by = mx + b. Some look like x+y=10x + y = 10, 3x+2y=123x + 2y = 12 or xy=6xy = 6. This page shows you a quick way to graph each kind. Then you’ll graph inequalities like x+y≤10x + y \le 10, where the answer isn’t just a line but a whole shaded region of points. Regions are perfect for questions like “what can I buy with $20?”

  • The graph of x=kx = k is a vertical line. Every point on it has the same xx-coordinate, kk. For example, x=3x = 3 goes through (3,0)(3, 0), (3,5)(3, 5) and (3,−2)(3, -2).
  • The graph of y=ky = k is a horizontal line. Every point on it has the same yy-coordinate, kk. For example, y=−2y = -2 goes through (0,−2)(0, -2) and (4,−2)(4, -2).

It feels backwards at first: x=3x = 3 is the line that goes up and down. Think “all the points where xx is 33”.

For x+y=5x + y = 5, find pairs of numbers that add to 55:

xx00112255
yy55443300

Plot them and join them: the line falls 11 for every 11 step right.

For x−y=2x - y = 2, find pairs where xx is 22 more than yy: (2,0)(2, 0), (3,1)(3, 1), (4,2)(4, 2), (0,−2)(0, -2). This line rises 11 for every 11 step right.

Lines like ax + by = k: the intercept method

Section titled “Lines like ax + by = k: the intercept method”

For an equation like 3x+2y=123x + 2y = 12, the easiest two points to find are the intercepts:

  • xx-intercept: set y=0y = 0. Then 3x=123x = 12, so x=4x = 4. The point is (4,0)(4, 0).
  • yy-intercept: set x=0x = 0. Then 2y=122y = 12, so y=6y = 6. The point is (0,6)(0, 6).

Plot both points and draw the line through them. It’s smart to check a third point: (2,3)(2, 3) gives 3(2)+2(3)=123(2) + 2(3) = 12. ✓ (The equations of lines page shows how to rewrite these equations in y=mx+by = mx + b form.)

xy=kxy = k means ”xx times yy equals kk”. For xy=6xy = 6:

xx−6-6−3-3−2-2−1-111223366
yy−1-1−2-2−3-3−6-666332211

This relation is non-linear. Its graph has two separate curved pieces, called branches. Each branch gets closer and closer to the axes but never touches them, because x=0x = 0 or y=0y = 0 would make the product 00, not 66. When kk is positive, the branches are in the first and third quadrants. When kk is negative, they are in the second and fourth quadrants.

Left: the lines x = 3 (vertical), y = -2 (horizontal), x + y = 5 (falling) and x - y = 2 (rising). Right: the two branches of xy = 6 in the first and third quadrants Four lines −4 −2 4 −4 2 4 x = 3 y = −2 x + y = 5 x − y = 2 xy = 6 −4 −2 2 4 6 −4 −2 2 4 6 −6 (1, 6) (6, 1) (−1, −6) (−6, −1)
Left: x=3x = 3, y=−2y = -2, x+y=5x + y = 5 and x−y=2x - y = 2. Right: the two branches of xy=6xy = 6.

An inequality like x+y≤4x + y \le 4 is true for a whole region of points, not just a line. To graph it:

  1. Draw the boundary line x+y=4x + y = 4.
    • Use a solid line for ≤\le or ≥\ge (points on the line count).
    • Use a dashed line for <\lt or >\gt (points on the line don’t count).
  2. Test a point that’s not on the line. (0,0)(0, 0) is easiest, unless the line goes through it.
  3. Shade the side that contains the test point if it makes the inequality true. Otherwise, shade the other side.
SymbolMeansBoundary
<\ltless thandashed
≤\leless than or equal tosolid
>\gtgreater thandashed
≥\gegreater than or equal tosolid

For x+y≤4x + y \le 4: test (0,0)(0, 0), which gives 0+0=00 + 0 = 0, and 0≤40 \le 4 is true. So shade the side with the origin.

For x−y>2x - y \gt 2: test (0,0)(0, 0), which gives 0−0=00 - 0 = 0, and 0>20 \gt 2 is false. So shade the side without the origin. Notice that this shaded region is below the line even though the symbol is “greater than”. That’s why testing a point is safer than guessing.

Left: x + y ≤ 4 with a solid boundary and the side containing (0, 0) shaded. Right: x - y > 2 with a dashed boundary and the side away from (0, 0) shaded x + y ≤ 4 −4 −2 2 −4 −2 2 test (0, 0): 0 ≤ 4 ✓ solid line x − y > 2 −4 −2 4 −4 2 4 test (0, 0): 0 > 2 ✗ dashed line
A solid boundary for ≤\le and a dashed boundary for >\gt. The test point (0,0)(0, 0) decides which side to shade.

For simple inequalities, you can read the region directly: y>3y \gt 3 is everything above the dashed line y=3y = 3, and x≤−1x \le -1 is everything to the left of the solid line x=−1x = -1, including the line itself.

In a real problem, every point in the shaded region is a combination that works, and every point outside it doesn’t. Points on a solid boundary line are the combinations that use up the limit exactly. Watch out for context, though: you can’t buy −2-2 muffins or 3.53.5 tickets, so often only points with whole-number coordinates in the first quadrant make sense.

Graph x=−4x = -4, y=1y = 1 and x+y=3x + y = 3 on the same grid. Where does y=1y = 1 cross each of the other two lines?

Solution.

  • x=−4x = -4 is a vertical line through (−4,0)(-4, 0).
  • y=1y = 1 is a horizontal line through (0,1)(0, 1).
  • For x+y=3x + y = 3, use pairs that add to 33: (0,3)(0, 3), (1,2)(1, 2), (3,0)(3, 0). Join them with a straight line.

y=1y = 1 crosses x=−4x = -4 at (−4,1)(-4, 1): that point has x=−4x = -4 and y=1y = 1.

y=1y = 1 crosses x+y=3x + y = 3 where x+1=3x + 1 = 3, so x=2x = 2. The point is (2,1)(2, 1).

Check: 2+1=32 + 1 = 3. ✓

Graph 2x+5y=202x + 5y = 20.

Solution.

xx-intercept: set y=0y = 0. Then 2x=202x = 20, so x=10x = 10. The point is (10,0)(10, 0).

yy-intercept: set x=0x = 0. Then 5y=205y = 20, so y=4y = 4. The point is (0,4)(0, 4).

Plot (10,0)(10, 0) and (0,4)(0, 4) and draw the line through them.

Check a third point: (5,2)(5, 2) gives 2(5)+5(2)=10+10=202(5) + 5(2) = 10 + 10 = 20. ✓ So (5,2)(5, 2) should be on your line, halfway between the intercepts.

Make a table of values for xy=−8xy = -8 and describe its graph.

Solution. Pick values of xx that divide evenly into −8-8, and find y=−8xy = \dfrac{-8}{x}:

xx−8-8−4-4−2-2−1-111224488
yy11224488−8-8−4-4−2-2−1-1

When xx is negative, yy is positive (second quadrant). When xx is positive, yy is negative (fourth quadrant). So the graph has two branches, one in the second quadrant and one in the fourth. Neither branch touches an axis, and there’s no point at x=0x = 0.

It’s non-linear. From x=1x = 1 to x=2x = 2, yy goes from −8-8 to −4-4: up 44 for one step, a rate of change of 44. From x=2x = 2 to x=4x = 4, yy goes from −4-4 to −2-2: up 22 over two steps, a rate of change of 11. The rates are different, so the graph isn’t a straight line.

Ari has $10 to spend at a bake sale. Muffins cost $2 each and cookies cost $1 each. Let xx be the number of muffins and yy the number of cookies.

  • (a) Write an inequality for the combinations Ari can afford, and describe its graph.
  • (b) Can Ari buy 33 muffins and 44 cookies? 44 muffins and 33 cookies?

Solution.

(a) Muffins cost 2x2x dollars and cookies cost yy dollars, and the total can be at most $10:

2x+y≤102x + y \le 10

Boundary line: 2x+y=102x + y = 10. The xx-intercept is (5,0)(5, 0) (only muffins) and the yy-intercept is (0,10)(0, 10) (only cookies). Use a solid line, because spending exactly $10 is allowed.

Test (0,0)(0, 0): 2(0)+0=02(0) + 0 = 0, and 0≤100 \le 10 is true. So shade the side with the origin.

Ari can’t buy negative amounts, so only the part of the region in the first quadrant (including the axes) makes sense, and only the points with whole-number coordinates.

(b) (3,4)(3, 4): 2(3)+4=102(3) + 4 = 10, and 10≤1010 \le 10 is true. Yes: the point is on the boundary line, so Ari spends exactly $10.

(4,3)(4, 3): 2(4)+3=112(4) + 3 = 11, and 11≤1011 \le 10 is false. No: that costs $11, and the point is outside the shaded region.

Mixing up x=kx = k and y=ky = k. x=3x = 3 is vertical (every point has xx-coordinate 33), and y=3y = 3 is horizontal. If you’re unsure, list two points, like (3,0)(3, 0) and (3,4)(3, 4), and see which way they line up.

Using the wrong kind of boundary line. Solid for ≤\le and ≥\ge, dashed for <\lt and >\gt. A dashed line tells the reader “the points on this line are not included”.

Shading by the symbol instead of testing. “Greater than means shade above” doesn’t always work. In x−y>2x - y \gt 2, the correct region is below the line. Always test a point.

Testing a point that’s on the boundary line. For y<2xy \lt 2x, the line goes through (0,0)(0, 0), so testing the origin gives 0<00 \lt 0, which tells you nothing. Pick a point clearly off the line, like (1,0)(1, 0): 0<20 \lt 2 is true, so shade the side containing (1,0)(1, 0).

Joining the two branches of xy = k. The branches never touch the axes and never meet. Don’t draw a curve through the origin, and don’t connect the two pieces.

Ignoring the context. In a budget problem, a point like (−1,12)(-1, 12) might be in the shaded region, but you can’t buy −1-1 muffins. Only use points that make sense in the situation.

1. (Warm-up) Which of x=5x = 5 and y=−3y = -3 is a vertical line? Where do the two lines cross?

Solution

x=5x = 5 is vertical (every point has xx-coordinate 55) and y=−3y = -3 is horizontal.

They cross at the point that has x=5x = 5 and y=−3y = -3: (5,−3)(5, -3).

2. (Warm-up) Find the intercepts of 4x+3y=244x + 3y = 24.

Solution

xx-intercept: set y=0y = 0, so 4x=244x = 24 and x=6x = 6. The point is (6,0)(6, 0).

yy-intercept: set x=0x = 0, so 3y=243y = 24 and y=8y = 8. The point is (0,8)(0, 8).

3. (Warm-up) Is each point in the region x+y≥6x + y \ge 6?

  • (a) (2,5)(2, 5)
  • (b) (1,4)(1, 4)
  • (c) (3,3)(3, 3)
Solution

(a) 2+5=72 + 5 = 7, and 7≥67 \ge 6 is true. Yes.

(b) 1+4=51 + 4 = 5, and 5≥65 \ge 6 is false. No.

(c) 3+3=63 + 3 = 6, and 6≥66 \ge 6 is true. Yes: the point is on the solid boundary line, so it’s included.

4. (Core) Make a table of values for x−y=4x - y = 4 and graph it. Which of the points (1,−3)(1, -3) and (3,1)(3, 1) is on the line?

Solution

Find pairs where xx is 44 more than yy:

xx00224466
yy−4-4−2-20022

Plot the points and join them with a straight line. It rises 11 for every 11 step right.

(1,−3)(1, -3): 1−(−3)=41 - (-3) = 4. ✓ It’s on the line.

(3,1)(3, 1): 3−1=23 - 1 = 2, not 44. It’s not on the line.

5. (Core) A rectangle has an area of 1818 cm². Let ll be its length and ww its width, both in centimetres.

  • (a) Write an equation relating ll and ww.
  • (b) Make a table of whole-number lengths and widths.
  • (c) Why does only one branch of the graph make sense here? What happens to the width as the length gets bigger?
Solution

(a) Area is length times width, so lw=18lw = 18.

(b)

ll (cm)11223366991818
ww (cm)18189966332211

(c) Lengths and widths must be positive, so only the first-quadrant branch makes sense. As the length gets bigger, the width gets smaller, but it never reaches 00. This relation is non-linear: doubling the length from 33 to 66 halves the width from 66 to 33.

6. (Core) Explain how to graph 3x+2y<123x + 2y \lt 12. Is the point (4,0)(4, 0) part of the region?

Solution

Boundary line: 3x+2y=123x + 2y = 12, with intercepts (4,0)(4, 0) and (0,6)(0, 6). Draw it dashed, because the symbol is <\lt.

Test (0,0)(0, 0): 3(0)+2(0)=03(0) + 2(0) = 0, and 0<120 \lt 12 is true. Shade the side containing the origin.

(4,0)(4, 0) gives 3(4)+2(0)=123(4) + 2(0) = 12, and 12<1212 \lt 12 is false. So (4,0)(4, 0) is not in the region: it sits on the dashed boundary.

7. (Core) A school play charges $15 for adult tickets and $10 for student tickets. The drama club needs to raise at least $600. Let xx be the number of adult tickets and yy the number of student tickets.

  • (a) Write an inequality and find the intercepts of its boundary line.
  • (b) Which side of the line should be shaded?
  • (c) Do 2020 adult and 3030 student tickets raise enough?
Solution

(a) 15x+10y≥60015x + 10y \ge 600. Intercepts: y=0y = 0 gives 15x=60015x = 600, so (40,0)(40, 0); x=0x = 0 gives 10y=60010y = 600, so (0,60)(0, 60). Draw a solid line.

(b) Test (0,0)(0, 0): 0≥6000 \ge 600 is false. So shade the side away from the origin (more tickets sold).

(c) 15(20)+10(30)=300+300=60015(20) + 10(30) = 300 + 300 = 600, and 600≥600600 \ge 600 is true. Yes: they raise exactly $600, so the point is on the boundary line.

8. (Challenge) A region has a dashed boundary line through (0,3)(0, 3) and (3,0)(3, 0), and the shaded side does not contain the origin. Write the inequality.

Solution

The line through (0,3)(0, 3) and (3,0)(3, 0) contains points whose coordinates add to 33, so its equation is x+y=3x + y = 3.

Dashed means the symbol is <\lt or >\gt. The origin gives 0+0=00 + 0 = 0, which is less than 33, and the origin is not shaded. So the shaded points must have x+yx + y greater than 33:

x+y>3x + y \gt 3

Check with a point on the shaded side, like (3,3)(3, 3): 6>36 \gt 3. ✓

9. (Challenge) Mei has at most 1010 hours a week for guitar practice (xx hours) and studying (yy hours), and she wants to study more than 33 hours. So x+y≤10x + y \le 10 and y>3y \gt 3.

  • (a) Which of these combinations work: (5,4)(5, 4), (7,3)(7, 3), (2,8)(2, 8), (6,5)(6, 5)?
  • (b) If she only plans whole numbers of hours, what is the most guitar practice she can fit in?
Solution

(a) A combination must make both inequalities true.

  • (5,4)(5, 4): 5+4=9≤105 + 4 = 9 \le 10 ✓ and 4>34 \gt 3 ✓. Works.
  • (7,3)(7, 3): 7+3=10≤107 + 3 = 10 \le 10 ✓, but 3>33 \gt 3 is false. Doesn’t work.
  • (2,8)(2, 8): 2+8=10≤102 + 8 = 10 \le 10 ✓ and 8>38 \gt 3 ✓. Works.
  • (6,5)(6, 5): 6+5=116 + 5 = 11, which is more than 1010. Doesn’t work.

(b) With whole numbers, y>3y \gt 3 means she studies at least 44 hours. Then x+4≤10x + 4 \le 10, so x≤6x \le 6. The most guitar practice is 66 hours (with exactly 44 hours of studying).

On a graph, the allowed points are in the region below the solid line x+y=10x + y = 10 and above the dashed line y=3y = 3.