In this video, we’ll learn how to graph linear functions.
Imagine we’ve booked a gardener for a job, presumably some sort of shrubbery-based situation. We know that the gardener charges a 10-dollar call-out fee and then another 5 dollars per hour for their services. The total amount of money that the gardener will charge is then a function of the number of hours they work. Without knowing the exact number of hours that they’re likely to take, we can set up a linear equation that can be used to predict the total cost for any time. Using 𝑥 to represent the total number of hours spent working and 𝑦 to represent the total cost in dollars, the linear equation is 𝑦 equals 10 plus five 𝑥. The graph of this equation is shown. With this in mind, let’s formalize some of the terms we’ve used so far.
When a relationship assigns exactly one output for a given input, it’s called a function. And if the graph of that function is a nonvertical straight line, like in the previous example, that function is said to be linear. In the case of the amount of the gardener would charge, the linear function could be represented as 𝑓 of 𝑥 equals 10 plus five 𝑥. 𝑓 of 𝑥 is the output, where 𝑥 is the variable; it’s the input to the function. The set of inputs is known as the domain of the function, whilst the set of possible outputs is called the range. And for a linear function, both the domain and range is simply the set of real numbers.
Now it follows that since 𝑥 is the input to the function, the value of the function for a certain number can be found by substituting that number for the variable 𝑥. For instance, the total cost of the gardener if they work for eight hours is found by substituting 𝑥 equals eight. And the output is the value of 𝑓 of eight. It’s 10 plus five times eight, which is equal to 50. Now in doing so, we create an ordered pair, which is in general given by 𝑥, 𝑓 of 𝑥. This ordered pair is a point on the graph of the function. And so, by calculating the value of two or more ordered pairs, we can construct the graph of a linear function. Let’s demonstrate this in our first example.
Let us consider the function 𝑓 of 𝑥 equals eight 𝑥 minus 11. Fill in the table. Identify the three points that lie on the line 𝑦 equals eight 𝑥 minus 11.
Remember, given a function, the value of that function for a certain number can be found by substituting that number for the variable. In this case, that’s 𝑥. We see from the table that we’re going to find the value of the function when 𝑥 equals negative one, when 𝑥 equals zero, and when 𝑥 is equal to one. So let’s begin by letting 𝑥 equal negative one. We’re going to substitute negative one into the function. Replacing 𝑥 with negative one, and we find the value of the function at that point is 𝑓 of negative one equals eight times negative one minus 11. That’s negative eight minus 11, which is simply negative 19. And so we filled in the first empty column of our table. When 𝑥 is negative one, 𝑦, which is equal to 𝑓 of 𝑥, is negative 19.
We’ll now move on to 𝑥 equals zero. When 𝑥 is equal to zero, the value of the function 𝑓 of zero is eight times zero minus 11 or zero minus 11, which is negative 11. And so 𝑓 of zero is equal to negative 11, allowing us to fill in the second empty column of our table. To complete the third empty column, we’re going to substitute 𝑥 equals one. That gives us 𝑓 of one, which is eight times one minus 11 or eight minus 11, which is negative three. And so we’ve completed our table. The three values are negative 19, negative 11, and negative three.
It’s worth noting that there is a pattern in the differences between each value of the function. Each value of the function increases by eight each time. This is no accident. Given consecutive integer values for 𝑥, we should notice that the corresponding values of the function should increase by some constant amount.
Now, we’re also asked to identify the three points on the graph that lie on the line 𝑦 equals eight 𝑥 minus 11. Now, in completing the table of values, we’ve produced ordered pairs, which are essentially coordinates on the graph of that function. The first ordered pair is negative one, negative 19. The second is zero, negative 11. And the third set of values, and hence the third ordered pair, is one, negative three.
If we plot these on our graph, we’ll see which of the given points they coincide with. Negative one, negative 19, we can see on our graph that this coincides with the point labeled 𝐼. Zero, negative 11 coincides with the point 𝐻. And one, negative three coincides with the point 𝐺. Whilst not explicitly necessary in this example, for completeness we can draw a line through these points. And so we have the line representing the function 𝑓 of 𝑥 equals eight 𝑥 minus 11.
And so we’re finished. The values that go in our table are negative 19, negative 11, and negative three. And the three points that lie on this line are 𝐼, 𝐻, and 𝐺, respectively.
In this example, we demonstrated how to find the output of a function given its rule and that allowed us to sketch its graph. In our next example, we’ll use known values to identify the graph of a linear relation, and then we’ll use the graph to identify any unknown values.
The following table represents a linear relation. Which of the following graphs represents this line? Find the values of 𝑎 and 𝑏. Write the equation of the straight line in the form 𝑓 of 𝑥 equals 𝑚𝑥 plus 𝑐.
Remember, when we create a table of values for some linear function, we’re essentially creating a group of ordered pairs. And each ordered pair is a point on the line of the graph of the function. We, in fact, have two complete ordered pairs here. The first one has an 𝑥-value of zero and a 𝑦-value of one. So the ordered pair is zero, one. The second has an 𝑥-value of one and a 𝑦-value of three, so the ordered pair is one, three. And in fact, whilst it’s good practice to write more than two ordered pairs, two ordered pairs is enough to identify or draw the graph of a linear relation.
Let’s begin by plotting the coordinate zero, one on each of the graphs. In doing so, we see that we have two graphs that satisfy this coordinate. They are graphs (A) and (E). To be able to identify which of these graphs represents the line, we’ll plot the coordinate one, three. In doing so, we see that we can also now disregard graph (A). And so graph (E) is the graph that represents our linear relation. We can now use this graph to find the values of 𝑎 and 𝑏.
We can see from the table that 𝑎 is the 𝑦-value that corresponds to an 𝑥-value of two. So we can draw a vertical line up from 𝑥 equals two until we hit the graph of our function and then a horizontal line until we hit the 𝑦-axis. When we do, we find the output for an input of two is five, so 𝑎 is equal to five. Let’s repeat this process to help us find the value of 𝑏. This time, the 𝑥-coordinate is three. So we draw a vertical line up from three until we hit the graph of our relation and then a horizontal line until we hit the 𝑦-axis. There’s no value written here, but it is a fairly simple scale. Each large square represents one, so 𝑏 must be equal to seven. And so the values of 𝑎 and 𝑏 are five and seven, respectively.
The final part of this question asks us to write the equation of the straight line. And it gives it in the form 𝑓 of 𝑥 equals 𝑚𝑥 plus 𝑐. In other words, we need to link each 𝑥-value with each 𝑦-value. A sensible pair of values to choose would be when 𝑥 is equal to zero. When 𝑥 is equal to zero, our function 𝑓 of 𝑥 equals 𝑚𝑥 plus 𝑐 is 𝑓 of zero, which equals 𝑚 times zero plus 𝑐. 𝑚 times zero is zero. So we see that 𝑓 of zero is equal to 𝑐. But of course 𝑓 of zero is our output, which in this case has a value of one. So we can say that 𝑐 must be equal to one. And so the equation of our line will be of the form 𝑓 of 𝑥 equals 𝑚𝑥 plus one.
Now that we have the value of 𝑐, let’s use the second ordered pair to find the value of 𝑚. Substituting 𝑥 equals one into the equation 𝑓 of 𝑥 equals 𝑚𝑥 plus one, and we get that 𝑓 of one is equal to 𝑚 times one plus one, which is simply 𝑚 plus one. Now, of course, 𝑓 of one is the output to the relation when the input is one. And we see from the table that that’s three. So we can rewrite this as three equals 𝑚 plus one. Then we can solve this equation by subtracting one from both sides. And that tells us that 𝑚 is equal to two. And so the equation of our line is 𝑓 of 𝑥 equals two 𝑥 plus one.
Now that we know the values of 𝑎 and 𝑏, we could in fact check this result by substituting 𝑥 equals two in and checking we get five out or 𝑥 equals three in and checking that we get seven out. In both cases, we do, confirming that the equation of our straight line is 𝑓 of 𝑥 equals two 𝑥 plus one.
Now in the previous two examples, we’ve seen a very simple linear relation and its corresponding graph and a table of values. We notice in the first example that when the 𝑥-values are consecutive, their corresponding 𝑦-values or output values will increase or sometimes decrease by the same amount each time. In fact, that amount corresponds to the coefficient of 𝑥. In this example, the coefficient of 𝑥 was two and our 𝑦-values increased by two each time. In the previous example, the coefficient of 𝑥 was eight and the 𝑦-values or 𝑓 of 𝑥 values increased by eight each time. Whilst it’s outside the scope of this lesson to investigate this in too much detail, it can serve as a useful check of our results.
Let’s consider another example, but this time the coefficient of 𝑥 is going to be negative. And that will result in the corresponding outputs decreasing and the graph of the function sloping downwards.
Consider the linear function 𝑓 of 𝑥 equals five minus two 𝑥. We can draw a straight line to represent this function. Complete the table to find the coordinate of points on the line. Which of the following is the graph of the function?
And there’s a third and final part to this question which we’ll consider in a moment. We have a linear function 𝑓 of 𝑥 equals five minus two 𝑥. And so we know that the graph of this function is going to be a nonvertical straight line. We’ll find a set of ordered pairs that satisfy this linear function by substituting 𝑥 equals negative two, negative one, zero, one, and two into the expression five minus two 𝑥. We’ll begin by letting 𝑥 equal negative two. So we’re calculating 𝑓 of negative two, which is five minus two times negative two. That’s five plus four, which is, of course, equal to nine. And so the first value in our table is nine.
To find the next ordered pair, the next value in our table, we’ll calculate 𝑓 of negative one by substituting negative one into the expression five minus two 𝑥. That gives us five minus two times negative one, which is five plus two, which is, of course, equal to seven. Let’s repeat this process with 𝑥 equals zero. When we do, we get five minus two times zero. That’s five minus zero, which is equal to five. Now we could continue in this manner working out 𝑓 of one and 𝑓 of two. But this is a linear function, and so we should be able to spot a pattern for the 𝑓 of 𝑥 values as long as the 𝑥-values themselves are consecutive.
Well, they do indeed increase by one each time. And so we notice that the 𝑓 of 𝑥 values decrease by two each time. This means that we can find the value of 𝑓 of one by subtracting two from five to give us three. In a similar way, we can subtract two from three to find 𝑓 of two, and it’s equal to one. And so the values in our table are as shown.
We now have enough information to find the correct graph of our function. The ordered pairs that lie on the graph of the function are negative two, nine; negative one, seven; zero, five; and so on. These are simply taken from the table. And so we plot each of these values on every single pair of axes. And we see that the only pair of axes which contains the correct graph is (D). (D) is the graph of 𝑓 of 𝑥 equals five minus two 𝑥.
We now clear some space and answer the third part of this question.
It says, which of these points is not on the line? Is it six, negative six; negative three, 11; negative four, 13; three, negative one; or four, negative three?
Now we have two techniques here. We could, of course, simply add each of these points to the graph of our function and see which one does not lie on the line. Alternatively, we can substitute the 𝑥-value into the function 𝑓 of 𝑥 equals five minus two 𝑥 and see if the resulting output is the same as the 𝑦-value in the ordered pair. In other words, for our first ordered pair, we substitute 𝑥 equals six. That gives us five minus two times six or five minus 12, which is of course equal to negative seven. And so, in fact, when 𝑥 is equal to six, 𝑦 is equal to negative seven and not negative six. So the answer must be (A).
For completeness, we’ll check the remaining points. 𝑓 of negative three is 11 as required, and 𝑓 of negative four is 13. We can plot point (D) directly onto the graph, and we see it does indeed lie on this line, as does point (E). Four, negative three lies on the line. And so the point that doesn’t lie on the line is six, negative six.
Now, before we wrap up this lesson, we’re going to look at a very special case of a linear function. We said that a linear function has a graph which is a nonvertical straight line. The special case, which is indeed a constant function, is of the form 𝑦 equals 𝑎 or, of course, in function notation 𝑓 of 𝑥 equals 𝑎, where 𝑎 is a real number. In this case, the function is represented graphically by a horizontal line.
As an example, suppose we’re asked to draw the graph of the function 𝑓 of 𝑥 equals three. We see that the output of this function is independent of the value of 𝑥. No matter the value of 𝑥 we substitute in, we will always get an output of three. And so we draw a line whose 𝑦-coordinate is always three. It’s a horizontal line that passes through the 𝑦-axis at three. In a similar way, the graph of 𝑦 equals negative one or 𝑓 of 𝑥 equals negative one is as shown. It’s a horizontal line that passes through the 𝑦-axis at negative one.
We’ll now recap the key points from this lesson. In this lesson, we learned that the graph of a linear function is a nonvertical straight line. And when graphing a function, the coordinates of each point on the graph are given by 𝑥, 𝑓 of 𝑥 — input and output. And we learned about a special case where the function is equal to some real constant 𝑎, 𝑓 of 𝑥 equals 𝑎 or 𝑦 equals 𝑎. In this case, we have simply a horizontal line where all the 𝑦-coordinates are equal to 𝑎.