Reading a linear function from its graph
A graph shows a straight line. How do you turn the picture into a rule that gives the output for any input, including inputs the picture never shows?
Where you are 5 in Linear functions
When you reach for it
A function is often handed to you as a picture: a line on a grid, with inputs along the bottom and outputs up the side. The picture shows the shape at a glance, but it cannot tell you the output for an input beyond its edge, and it gives exact values only where the line crosses a grid corner. A rule does both.
When the graph is a straight line, the function has a constant rate of change, and two numbers settle everything: the initial value, f(0), the output when the input is 0; and the rate of change, the amount the output changes for each one unit of input. With those two numbers the rule is
where m is the rate of change and b = f(0) is the initial value, written in function notation.
Measuring a slope on a grid is in Slope from a graph or a table, and reading m and b in y = mx + b is in Slope-intercept form. This lesson reads the line as a function: what its two numbers are worth, in which units, and what to do when the picture does not show input 0 at all. It takes two days: Part 1 (Examples 1 to 3) reads the two numbers, on any scale and in any window; Part 2 (Examples 4 and 5) handles graphs that start later than input 0 and graphs that fall.
The procedure
Part 1: the two numbers and the rule
The initial value. Input 0 sits on the vertical axis, because every point of that axis has first coordinate 0. So when the horizontal axis starts at 0, the initial value is the height at which the line meets the vertical axis: the point (0, f(0)).
The rate of change. Take two points of the line, (x_1, f(x_1)) and (x_2, f(x_2)). The rate of change is
the change in output divided by the change in input. Because the function is linear, every pair of points gives the same m, so any two will do. Choose points where the line passes exactly through a grid corner, so that both coordinates are read exactly, and choose them far apart, so that a small slip in reading is a small part of the whole change.
Why the rule is mx + b. Going from input 0 to input x changes the input by x. Each unit of input changes the output by m, so the whole change in output is mx. Start at f(0) = b and add that change: f(x) = b + mx = mx + b.
Squares that are not units. A grid square stands for whatever its axis says: half an hour, 5 dollars, 25 kilometers. Counting squares measures the drawing, not the function. Turn each count into the axis’s units first, then divide.
A window that leaves out input 0. When the horizontal axis starts at, say, 20, the left edge of the graph is input 20, and the height there is f(20), not the initial value. Find m from two points as usual. Then use the fact that every point of the line satisfies the rule: at a point (x_1, f(x_1)), f(x_1) = mx_1 + b, so
This is walking back along the line: from input x_1 down to input 0 is x_1 steps of one unit, and each step back undoes a change of m.
Units. The initial value carries the output’s units. The rate carries output units per input unit: dollars per hour, kilometers per minute. Each number’s meaning is one sentence built from the axis labels.
Checking against a third point. A rule built from two points passes through both of them whatever happened, so those two points cannot test it. A third point of the graph, one that was not used, can. If the rule gives that point’s output, the readings and the rule agree. If not, at least one reading is wrong, or the graph is not a straight line at all.
Part 2: late starts and falling lines
A graph that starts later. In many situations the input does not begin at 0: a clock is started before anything happens, so the graph is a segment that begins at some input a > 0. The rule still has an initial value, the height where the line would meet the vertical axis if it were extended, and the rule needs that number. But the situation never takes that value. Its own start is the point (a, f(a)). Write the rule together with the inputs it covers, its domain, as in f(x) = mx + b for a \le x \le c.
A falling line. If the output goes down as the input goes up, the change in output between two points is negative, so m is negative and the function is decreasing. The size of m is how much is lost per input unit. Where the output reaches 0, the line meets the horizontal axis, and solving f(x) = 0 gives that input exactly, an intercept of the function.
Worked examples
Reading a rule off a grid
Figure 1 shows the graph of a linear function f. Find its initial value and its rate of change, write f(x), then find f(10) and the input x for which f(x) = 10.
The line meets the y-axis at (0, -2), so the initial value is f(0) = -2.
For the rate, use two grid corners on the line: (0, -2) and (2, 1). The input goes up by 2 and the output by 1 - (-2) = 3, so
Each step of 1 to the right raises the output by \displaystyle \frac{3}{2}. Putting the two numbers in place,
Check with a third corner, (4, 4): \displaystyle \frac{3}{2}(4) - 2 = 6 - 2 = 4.
Now the rule reaches past the grid. \displaystyle f(10) = \frac{3}{2}(10) - 2 = 15 - 2 = 13, which is far above the top edge. For f(x) = 10, solve \displaystyle \frac{3}{2}x - 2 = 10: add 2 to both sides to get \displaystyle \frac{3}{2}x = 12, then multiply both sides by \displaystyle \frac{2}{3} to get x = 8.
A paddleboard rental, with squares that are not units
Solveig rents a paddleboard. Figure 2 graphs the cost C(t), in dollars, of a rental lasting t hours. Find the initial value and the rate of change with their units, write C(t), and say what each number means. What does a rental of 2.5 hours cost, and how long a rental costs 50 dollars?
The line meets the cost axis at 15, so C(0) = 15 dollars.
Each square is half an hour across and 5 dollars up. From the corner (0, 15) to the corner (2, 35) the line crosses 4 squares across, which is 2 hours, and 4 squares up, which is 20 dollars. So
Dividing the counts of squares would give \displaystyle \frac{4}{4} = 1, a number with no units that measures only the drawing. Check with the corner (4, 55): 10(4) + 15 = 55. The rule is
The rate says each hour on the water adds 10 dollars. The initial value is the cost at t = 0, before any paddling: a fixed charge of 15 dollars for taking a board out at all.
A 2.5 hour rental costs C(2.5) = 10(2.5) + 15 = 25 + 15 = 40 dollars. For a cost of 50 dollars, 10t + 15 = 50, so 10t = 35 and t = 3.5 hours.
A charging car, with input 0 off the window
Rasmus plugs his electric car into a fast charger. The car shows how many kilometers it can still drive on its battery; call that the distance left. Figure 3 graphs the distance left L(t), in kilometers, t minutes after he plugged in, but only for t from 20 to 60. Find the rate of change, the initial value and the rule, and say what the two numbers mean.
The time axis starts at 20, so the left edge of the picture is t = 20, and the line meets it at L(20) = 150. That is not the initial value; input 0 is off the window.
The rate first. The corners (20, 150) and (60, 350) are 40 minutes apart, and the distance left grows by 200 kilometers between them:
Now work back to t = 0. The point (20, 150) satisfies L(t) = 5t + b, so 150 = 5(20) + b = 100 + b, and b = 50. In steps: going back 20 minutes undoes 5 \times 20 = 100 kilometers of charging, and 150 - 100 = 50. The rule is
Check with the corner (40, 250): 5(40) + 50 = 250.
The car arrived at the charger able to drive 50 more kilometers, and at this rate the charger adds 5 kilometers every minute, which is 300 kilometers per hour. The value 50 rests on the charging having run at the same rate from t = 0 to t = 20; the picture does not show that stretch, so the rule assumes it.
A dive that starts late
Tiberius navigates a research submarine. He starts a clock as it leaves harbor, and the dive begins later. Figure 4 graphs its depth D(t), in meters below the surface, t minutes after the clock started, for the dive only. Find the rate of change, the rule and its domain. What is D(0), and does it describe the submarine? Find the depth after 8 minutes and the time it reaches 90 meters.
The graph is a segment from (5, 0) to (15, 120), with solid dots because both ends belong to it. The dive starts at the surface at t = 5 and ends 120 meters down at t = 15. Using the two ends,
The segment never reaches the depth axis, so work back from (5, 0): 0 = 12(5) + b, so b = -60. With its domain,
Check with the corner (10, 60): 12(10) - 60 = 60.
The rule gives D(0) = -60, which would mean 60 meters above the water. That is not where the submarine was at t = 0; it was at the surface, waiting. The number is only where the extended line crosses the depth axis, and t = 0 is outside the domain. The dive really starts at (5, 0), and the same rule written from that point is
where t - 5 counts the minutes since the dive began. This is point-slope form; multiplying out gives 12t - 60 again.
After 8 minutes, D(8) = 12(8) - 60 = 36 meters. For 90 meters, 12t - 60 = 90, so 12t = 150 and t = 12.5 minutes, which is inside the domain.
A mower’s fuel, a falling line
Ulla fills her lawn mower’s tank and starts mowing. Figure 5 graphs the fuel F(t) in the tank, in liters, after t minutes of mowing. Find the initial value and the rate of change, per minute and per hour, write F(t), and say when the tank is empty and which inputs the rule covers.
The line meets the fuel axis at 2, so F(0) = 2 liters: a full tank holds 2 liters.
From the corner (0, 2) to the corner (80, 0) the input grows by 80 minutes and the output changes by 0 - 2 = -2 liters:
The rate is negative because the fuel goes down, and that is why the line falls from left to right. In an hour of mowing the tank loses 60 \times 0.025 = 1.5 liters, so the rate is also -1.5 liters per hour. The rule is
Check with the corner (40, 1): -0.025(40) + 2 = -1 + 2 = 1.
The tank is empty when F(t) = 0: -0.025t + 2 = 0 gives 0.025t = 2 and t = 80 minutes, where the line meets the time axis. Past that the rule would give negative fuel, which cannot happen, so it covers 0 \le t \le 80.
Boundaries
The graph must be a straight line, and not a vertical one. Only a line has one rate of change everywhere. A curve has no single rate, and two points read off it give a rule that misses the rest; the third-point check is how that shows up, and Linear and nonlinear functions takes it further. A vertical line is not the graph of a function at all.
The rule is as exact as the points it was read from. Grid corners give exact coordinates. If the line passes through no corner, the readings are estimates and so are m and b.
The initial value is the output at input 0, which is where the line meets the vertical axis only when the horizontal axis starts at 0. On a window that starts elsewhere, work back with b = f(x_1) - mx_1.
The rule describes the inputs the situation allows. When the graph starts at a > 0, as in Example 4, f(0) is a number in the rule, not a value the situation ever takes. Using the rule beyond the drawn graph, before its start or past its end, assumes the rate holds there too.
Units come from the axes. A rate is in output units per input unit. When the axes use minutes and the question asks per hour, convert.
Where this goes next
Saying in words what the two numbers mean, and building the function from a description rather than a picture, is Linear functions in context. With a rule in hand, a graph can be set beside a table or an equation and the two functions compared by rate and by initial value, which is Comparing linear functions given different ways. The third-point check grows into a test for whether a graph or table is linear at all, in Linear and nonlinear functions. The late-start form f(a) + m(x - a) is point-slope form, and building a rule from a story, then judging where it stops being trustworthy, is Modeling with linear relationships.
Exercises
Part 1: reading the rule
Figure 6 shows the graphs of three linear functions. For each, give the initial value and the rate of change, and write the rule.
- The function f in graph (a). Then find f(6).
- The function g in graph (b). Then find g(10).
- The function h in graph (c). Then find the input x for which h(x) = 15.
Part 1: scales and windows
Figure 7 (a) graphs the cost C(t), in dollars, of renting a paddleboard for t hours from a lakeside kiosk. Figure 7 (b) graphs the distance L(t), in kilometers, that a car can still drive, t minutes after it is plugged into a charger.
- From graph (a), give the initial value and the rate of change with their units.
- Write C(t), and find the cost of a 3.5 hour rental.
- From graph (b), find the rate of change with its units.
- From graph (b), find L(0) by working back, write L(t), and say what L(0) means.
- The graph of a linear function f shows only inputs from 10 to 20. It passes through the grid corners (12, 47) and (18, 65). Find f(0) and write f(x).
Part 1: units and meaning
- A second shop’s paddleboard cost P(t), in dollars for t hours, has a graph through (0, 14) and (3, 41). Give the rate of change with its units, write P(t), and say in a sentence what each number means.
- On another charger, the graph of a car’s distance left L(t), in kilometers, t minutes after plugging in, shows only t from 10 to 25, and passes through (10, 120) and (25, 210). Find the rate in kilometers per minute and in kilometers per hour, then L(0) and L(t).
Part 2: graphs that start later
Figure 8 (a) graphs a submarine’s depth D(t), in meters below the surface, t minutes after a clock was started.
- Find the rate of change, write D(t) with its domain, and find D(7).
- Find D(0). Say why it does not describe the submarine, and write the rule in a form that shows when the dive began.
Part 2: falling lines
Figure 8 (b) graphs the fuel F(t), in liters, in a lawn mower’s tank after t minutes of mowing.
- Give the initial value, the rate of change per minute and per hour, and write F(t).
- When is the tank empty, and which inputs does the rule cover?
- The graph of a linear function f passes through the grid corners (-2, 7) and (4, -2). Find the rate of change, f(0) and f(x). Is (6, -5) on the graph?
- As a submarine rises, the graph of its depth D(t), in meters below the surface, is a segment from (20, 180) to (32, 0), with t in minutes. Find the rate of change, write D(t) with its domain, and find the depth at t = 26.
Part 2: checking a third point
- Vashti reads a line crossing the y-axis at (0, 5) and passing through (3, 14), and writes f(x) = 3x + 5. The line also passes through the grid corner (-2, -1). Does her rule agree with it?
- Wilhelm reads a line as crossing the y-axis at (0, 2) and passing through (4, 5), and writes \displaystyle f(x) = \frac{3}{4}x + 2. The line also passes through the grid corners (8, 9) and (-2, -1). Test his rule at (8, 9). If it fails, find the rule from (4, 5) and (8, 9) and test it at (-2, -1).
- Three points read off a graph are (0, -4), (5, 6) and (8, 13). Can all three lie on the graph of one linear function?
Reasoning
- Explain why the two points used to build a rule cannot check it, and why a third point can.
- On a graph whose horizontal axis starts at 20, explain why the height where the line meets the left edge is not the initial value, and say what it is instead.
- For f(x) = mx + b, show that f(x + 1) - f(x) = m for every x, and use it to explain why the graph falls from left to right when m is negative.
- Example 2’s line climbs one square for each square across. Explain why its rate of change is still 10 dollars per hour and not 1, and say what the graph would look like if the squares were redrawn as 1 hour across and 20 dollars up.
Answers
- f(0) = 1, rate \displaystyle \frac{3}{2}, \displaystyle f(x) = \frac{3}{2}x + 1, and f(6) = 10. From (0, 1) to (2, 4) the input grows by 2 and the output by 3.
- g(0) = -3, rate \displaystyle \frac{1}{2}, \displaystyle g(x) = \frac{1}{2}x - 3, and g(10) = 2. From (0, -3) to (4, -1) the output grows by 2 over 4 units of input.
- h(0) = -1, rate 2, h(x) = 2x - 1. From (0, -1) to (1, 1) the output grows by 2. 2x - 1 = 15 gives 2x = 16, so x = 8.
- Initial value 20 dollars, rate 15 dollars per hour. From (0, 20) to (2, 50) the cost grows by 30 dollars in 2 hours.
- C(t) = 15t + 20, and C(3.5) = 52.5 + 20 = 72.5 dollars.
- 2 kilometers per minute. From (30, 100) to (90, 220) the distance left grows by 120 kilometers in 60 minutes.
- L(0) = 40 kilometers, from 100 = 2(30) + b. So L(t) = 2t + 40: the car could drive 40 more kilometers when it was plugged in.
- f(0) = 11 and f(x) = 3x + 11. The rate is \displaystyle \frac{65 - 47}{18 - 12} = \frac{18}{6} = 3, and b = 47 - 3(12) = 11.
- 9 dollars per hour, from \displaystyle \frac{41 - 14}{3} = 9, and P(t) = 9t + 14. The shop charges 14 dollars before any time on the water, and each hour adds 9 dollars.
- 6 kilometers per minute, which is 360 kilometers per hour; L(0) = 60 kilometers and L(t) = 6t + 60. The rate is \displaystyle \frac{210 - 120}{25 - 10} = \frac{90}{15} = 6, and b = 120 - 6(10) = 60.
- 20 meters per minute, from the ends (2, 0) and (10, 160): \displaystyle \frac{160}{8} = 20. Working back from (2, 0), b = 0 - 20(2) = -40, so D(t) = 20t - 40 for 2 \le t \le 10, and D(7) = 140 - 40 = 100 meters.
- D(0) = -40, which would mean 40 meters above the water. The dive starts at t = 2, so t = 0 is outside the domain, and -40 is only where the extended line meets the depth axis. The form D(t) = 20(t - 2) shows depth 0 when the dive begins at t = 2.
- F(0) = 1.2 liters; the rate is -0.02 liters per minute, which is -1.2 liters per hour; F(t) = -0.02t + 1.2. From (0, 1.2) to (60, 0) the fuel changes by -1.2 liters in 60 minutes.
- At t = 60 minutes, from -0.02t + 1.2 = 0. The rule covers 0 \le t \le 60.
- Rate \displaystyle -\frac{3}{2}, f(0) = 4, \displaystyle f(x) = -\frac{3}{2}x + 4. The rate is \displaystyle \frac{-2 - 7}{4 - (-2)} = \frac{-9}{6}, and \displaystyle b = 7 - \left(-\frac{3}{2}\right)(-2) = 7 - 3 = 4. Yes, (6, -5) is on it: \displaystyle -\frac{3}{2}(6) + 4 = -9 + 4 = -5.
- -15 meters per minute, from \displaystyle \frac{0 - 180}{32 - 20} = \frac{-180}{12}. Working back, b = 180 + 15(20) = 480, so D(t) = -15t + 480 for 20 \le t \le 32, and D(26) = -390 + 480 = 90 meters.
- Yes. f(-2) = 3(-2) + 5 = -1, which is the corner’s output.
- His rule fails: \displaystyle \frac{3}{4}(8) + 2 = 8, not 9. From (4, 5) to (8, 9) the rate is \displaystyle \frac{4}{4} = 1, and b = 5 - 1(4) = 1, so f(x) = x + 1. It passes the test: -2 + 1 = -1. He misread the crossing, which is at 1, not 2.
- No. The first two give rate \displaystyle \frac{6 - (-4)}{5} = 2 and the rule 2x - 4, which gives 2(8) - 4 = 12 at x = 8, not 13. At least one reading is wrong, or the graph is not a line.
- The rule is built so that it passes through the two points used: the rate comes from them and the initial value is worked back from one of them. So it fits them even if one was misread. A third point played no part in building the rule, so whether the rule gives its output is a real test of the readings.
- The left edge is the input 20, not the input 0, so the height there is f(20). The initial value f(0) lies 20 input units further left, off the picture, and is found with b = f(20) - 20m.
- f(x + 1) - f(x) is m(x + 1) + b - (mx + b), which multiplies out to mx + m + b - mx - b, and that is m. So every step of one unit to the right changes the output by the same m. If m is negative, every such step lowers the output, so the graph goes down from left to right.
- Each square is half an hour across and 5 dollars up, so one square across and one up is 5 dollars per half hour, which is 10 dollars per hour. Counting squares ignores what they stand for. With squares 1 hour across and 20 dollars up, the line would climb half a square per square across and look flatter, but it is the same function, and its rate is still 10 dollars per hour.