Chapter 9 ยท Functions

Reading y = mx + b as a Linear Function

Learn why a rule that multiplies the input by one fixed number and adds another is a function, what each number means, and why its points lie on one straight line.

13 min read

You already know that a function is a rule that gives each permitted input exactly one output. In this lesson you study one family of rules and see why every rule in it is a function whose points lie on a straight line.

Start with one rule: take a number xx, multiply it by 22, then add 11. Call the result yy. In symbols, the rule is y=2x+1y = 2x + 1.

Here xx is the input and yy is the output. The domain is the set of permitted inputs. For this rule, let the domain be all real numbers.

Why is this rule a function? Multiplying a number by 22 gives exactly one product, and adding 11 to that product gives exactly one sum. So each input xx leads to exactly one output yy. The table shows the work for five inputs.

Five inputs of the rule y = 2x + 1 and their outputs
Input xMultiply by 2, then add 1Output y
โˆ’1-1
2(โˆ’1)+1=โˆ’2+12(-1) + 1 = -2 + 1
โˆ’1-1
00
2(0)+1=0+12(0) + 1 = 0 + 1
11
11
2(1)+1=2+12(1) + 1 = 2 + 1
33
22
2(2)+1=4+12(2) + 1 = 4 + 1
55
33
2(3)+1=6+12(3) + 1 = 6 + 1
77

Read the table in two ways.

Across a row: each input has exactly one output. The input 00 gives the output 11, because 2(0)+1=12(0) + 1 = 1. So the output for the input 00 is the number added at the end of the rule.

Down the output column: each time the input goes up by 11, the output goes up by 22: โˆ’1,1,3,5,7-1, 1, 3, 5, 7. The reason is in the rule. Adding 11 to xx adds one more group of 22: 2(x+1)+1=2x+2+12(x + 1) + 1 = 2x + 2 + 1, which is 22 more than 2x+12x + 1. So the steady change of 22 is the number that multiplies xx.

The table lists only five inputs, but the rule covers every real number. For example, the input 0.50.5 gives 2(0.5)+1=1+1=22(0.5) + 1 = 1 + 1 = 2. A table with no rule behind it would tell you about its listed inputs only.

Coordinate grid from x -3 to 5 and y -3 to 9, with a grid step of 1, showing 6 plotted elements. Details: line 2 x plus -1 y equals -1, named Line A; point at (-1, -1), named (-1, -1); point at (0, 1), named (0, 1); point at (1, 3), named (1, 3); point at (2, 5), named (2, 5); point at (3, 7), named (3, 7).
Line A is y=2x+1y = 2x + 1. The five plotted points match the five rows of the table.

In the figure above, the horizontal axis shows the input xx and the vertical axis shows the output yy. A point (x,y)(x, y) means the input xx gives the output yy. The table row with input 22 and output 55 becomes the point (2,5)(2, 5).

All five plotted points lie on Line A. You do not need to trust how the picture looks: each pair makes y=2x+1y = 2x + 1 true. For example, (3,7)(3, 7) fits because 2(3)+1=6+1=72(3) + 1 = 6 + 1 = 7.

Because the domain is all real numbers, the graph of this function is all of Line A, not only the five plotted points.

Why is the graph straight? From each plotted point to the next, you move right 11 and up 22. More generally, take any two points of the rule with different inputs and divide the change in output by the change in input. That quotient is called the slope. It tells you how much the output changes for each increase of 11 in the input.

For this rule the slope is always 22, because the outputs differ by 22 times as much as the inputs do. From (โˆ’1,โˆ’1)(-1, -1) to (3,7)(3, 7), the output changes by 7โˆ’(โˆ’1)=87 - (-1) = 8 and the input changes by 3โˆ’(โˆ’1)=43 - (-1) = 4, and 8รท4=28 \div 4 = 2. Points with one constant slope between every pair lie on one straight line.

Key concept

y = mx + b defines a linear function

For fixed numbers mm and bb, the rule y=mx+by = mx + b multiplies the input xx by mm and then adds bb. Each step gives exactly one result, so each permitted input has exactly one output: the rule is a function. It is called a linear function because its points lie on one straight line that is not vertical.

  • mm is the slope: the change in yy for each increase of 11 in xx. It may be positive, negative or 00.
  • bb is the yy-intercept: the output when the input is 00, because m(0)+b=bm(0) + b = b. The line crosses the vertical axis at (0,b)(0, b).

With all real numbers as the domain, the graph is the whole line. With a smaller domain, the graph is only the points of that line whose inputs are permitted.

y=mx+by = mx + b

Worked example

Reading m and b from a rule

A rule is y=3xโˆ’2y = 3x - 2, and its domain is all real numbers. Name mm and bb, say what each one tells you, and find the output for the input 44.

  1. Match the rule to the form y = mx + b. Subtracting 2 gives the same result as adding negative 2, so rewrite the rule with a plus sign. Now you can read the two numbers: m is 3 and b is negative 2.

    y=3xโˆ’2=3x+(โˆ’2)y = 3x - 2 = 3x + (-2)
  2. Interpret b. It is the output when the input is 0, because the 3x part is then 0. So the line crosses the vertical axis at the point (0, -2).

    y=3(0)โˆ’2=0โˆ’2=โˆ’2y = 3(0) - 2 = 0 - 2 = -2
  3. Interpret m. Because x is multiplied by 3, adding 1 to x adds 3 to y. Check with the inputs 0 and 1: the output goes from -2 to 1, which is a rise of 3. So the slope is 3.

    y=3(1)โˆ’2=3โˆ’2=1,1โˆ’(โˆ’2)=3y = 3(1) - 2 = 3 - 2 = 1, \qquad 1 - (-2) = 3
  4. Find the output for the input 4. Follow the rule in order: multiply 4 by 3, then subtract 2.

    y=3(4)โˆ’2=12โˆ’2=10y = 3(4) - 2 = 12 - 2 = 10
  5. Check the function idea. The product of 3 and 4 can only be 12, and 12 minus 2 can only be 10, so the input 4 has one output and no other. The same reasoning works for every real input.

Answer

In y=3xโˆ’2y = 3x - 2, the slope is m=3m = 3, so yy rises by 33 for each increase of 11 in xx. The yy-intercept is b=โˆ’2b = -2, the output for the input 00. The input 44 gives exactly one output, 1010, and the rule is a linear function.

Worked example

A rule with a restricted domain

At a fair you start with 1212 tokens, and each ride costs 33 tokens. Let xx be the number of rides you have taken and yy be the number of tokens you have left. The rule is y=โˆ’3x+12y = -3x + 12. State the domain, explain what mm and bb mean, and describe the graph.

  1. State the domain. You cannot take part of a ride or a negative number of rides, and 12 tokens pay for at most 4 rides. So the permitted inputs are the whole numbers 0, 1, 2, 3 and 4.

    12รท3=412 \div 3 = 4
  2. Interpret b. Here b is 12, the output when the input is 0. Before any ride, you still have all 12 tokens.

    y=โˆ’3(0)+12=0+12=12y = -3(0) + 12 = 0 + 12 = 12
  3. Interpret m. Here m is -3, measured in tokens per ride. Each ride changes the number of tokens left by -3, so the count drops by 3. Check with 0 rides and 1 ride: the output goes from 12 to 9.

    y=โˆ’3(1)+12=โˆ’3+12=9,9โˆ’12=โˆ’3y = -3(1) + 12 = -3 + 12 = 9, \qquad 9 - 12 = -3
  4. Find the outputs for the other permitted inputs: 2, 3 and 4. Each input gives exactly one output, so the rule is a function on this domain.

    โˆ’3(2)+12=โˆ’6+12=6,โˆ’3(3)+12=โˆ’9+12=3,โˆ’3(4)+12=โˆ’12+12=0-3(2) + 12 = -6 + 12 = 6, \quad -3(3) + 12 = -9 + 12 = 3, \quad -3(4) + 12 = -12 + 12 = 0
  5. Describe the graph. The domain has five inputs, so the graph is five separate points: (0, 12), (1, 9), (2, 6), (3, 3) and (4, 0). From each point to the next you move right 1 and down 3, so all five lie on one straight line.

  6. Compare with the figure below. Its horizontal axis shows rides x and its vertical axis shows tokens left y. The five plotted points are the whole graph. Line B is y = -3x + 12 for all real inputs, drawn only to show that the points line up. A point of Line B between them, such as (0.5, 10.5), is not part of this function, because 0.5 is not a permitted input.

    โˆ’3(0.5)+12=โˆ’1.5+12=10.5-3(0.5) + 12 = -1.5 + 12 = 10.5

Answer

The domain is the whole numbers from 00 to 44. The yy-intercept b=12b = 12 is the number of tokens before any ride, and the slope m=โˆ’3m = -3 means each ride lowers the count by 33 tokens. The graph is five points on the line y=โˆ’3x+12y = -3x + 12, so the rule is a linear function.

Coordinate grid from x -1 to 6 and y -1 to 14, with a grid step of 1, showing 6 plotted elements. Details: line 3 x plus 1 y equals 12, named Line B; point at (0, 12), named (0, 12); point at (1, 9), named (1, 9); point at (2, 6), named (2, 6); point at (3, 3), named (3, 3); point at (4, 0), named (4, 0).
The five plotted points are the whole graph of the token rule. Line B is y=โˆ’3x+12y = -3x + 12; it only shows that the points line up.

Two special lines test the idea of exactly one output for each input. In the figure below, the horizontal axis shows the input xx and the vertical axis shows the output yy.

Slope zero. With m=0m = 0 and b=3b = 3, the rule y=0x+3y = 0x + 3 becomes y=3y = 3. Let its domain be all real numbers. Every input gives the output 33, so different inputs share an output. That is allowed, because each input still has exactly one output. So y=3y = 3 is a linear function, and its graph is the horizontal Line C. The points (โˆ’1,3)(-1, 3) and (4,3)(4, 3) on it have different inputs and the same output.

Vertical lines. Line D is the vertical line x=2x = 2. The points (2,1)(2, 1) and (2,5)(2, 5) are both on it, so the one input 22 would have two outputs, 11 and 55. That breaks the definition of a function. The slope is also undefined: between those two points the change in yy is 5โˆ’1=45 - 1 = 4, but the change in xx is 2โˆ’2=02 - 2 = 0, and you cannot divide by 00. So a vertical line is straight, but it is not the graph of any rule y=mx+by = mx + b.

Coordinate grid from x -3 to 6 and y -2 to 7, with a grid step of 1, showing 6 plotted elements. Details: line 0 x plus 1 y equals 3, named Line C; line 1 x plus 0 y equals 2, named Line D; point at (-1, 3), named (-1, 3); point at (4, 3), named (4, 3); point at (2, 1), named (2, 1); point at (2, 5), named (2, 5).
Line C is y=3y = 3, a linear function with slope 00. Line D is x=2x = 2, a vertical line; it is not the graph of a function with input xx and output yy.

The big idea: y=mx+by = mx + b is a rule that multiplies the input by mm and then adds bb. Each permitted input gets exactly one output, so the rule is a function. Equal steps in xx give equal steps in yy, so its points lie on one straight line that is not vertical. The slope mm is the change in yy for each increase of 11 in xx, and the yy-intercept bb is the output when x=0x = 0. Always state the domain: it decides whether the graph is the whole line or only some of its points. A linear function is proportional only in the special case b=0b = 0.

Next, you will sort functions into linear and nonlinear ones, see examples of functions that are not linear, and compare how the two kinds change.