In this explainer, we will learn how to graph linear functions.
Linear functions are used to define a linear relationship between two variables. They are functions with a constant rate of change and have many practical applications. For example, in economics, a demand curve may be a linear function of price and quantity. In science, Hooke’s law and Ohm’s law are linear relationships, the first between the force on a string and its length and the second between the voltage and the current in an electrical circuit.
Definition: Linear Functions
A linear function is a function whose graph is a straight line. The equation of a line in slope–intercept form is where and are constants. The constant is known as the slope, or gradient, of the line, and is the line’s -intercept—that is, where the line crosses the -axis.
You may also see the equation of the line written as . A linear function has one independent variable, , and one dependent variable, , and the highest power of is 1. The change in is proportional to the change in , and the slope, , which is constant, is the ratio of the change in to the change in .
Note that describes a linear relationship between the variables and . We can also express this in function notation as follows: . Here, is a function of , and a point on the line would have coordinates .
When it comes to graphing linear functions, how we approach this depends on the information we have. For example, we may be given two (or more) points on a line and can form a line by plotting these points and drawing a single line through them. We can work out the slope of this line using two points on the line—say, and —to calculate the ratio of the change in to the change in ,
Using this slope, together with one of the points, say, , we can then find the exact value of the -intercept, , since if , rearranging gives us .
Note that the slope of the line is sometimes depicted as the rise over the run, where the rise is the change in between two points on the line and the run is the change in between the same two points.
It is important to remember that when the slope is positive, the line will slope upward from left to right and when the slope is negative, the line will slope downward from left to right.
One way of graphing a linear function is by making a table of values and plotting the coordinates of the points in our table. Let’s see how this works in an example.
Example 1: Graphing Linear Functions by Making Tables
Let us consider the function .
- Fill in the table.
- Identify the three points that lie on the line .
There are two parts to this question. The first requires us to complete the table by calculating the values of the function , for the three -values given. We can do this by substituting each of the -values, , and 1, in turn, into the function as follows:
Completing the table with these values, we then have,
The second part of the question asks us to identify the three points in the graph that lie on the line . Now, the purpose of creating a table of values for a function is to give us pairs of coordinates for the graph of that function. From our table, we see that the three coordinates for our function are , , and . Let’s plot these on our graph and see which of the given points they coincide with.
Plotting our first point, , we see that, on our graph, this coincides with the point labeled I.
Our next point, , coincides with point H on the graph.
Finally, plotting our third point, , we see that this coincides with point G on our graph.
Therefore, the three points that lie on the line are points I, H, and G, as shown in the diagram below.
We may not always be given the equation of a line in the form and may have to rearrange a function into this form to help us identify the correct line. Our next example demonstrates this process.
Example 2: Graphing Linear Equations by Changing Their Form
Consider the equation .
- Rearrange the equation into the form .
- What are the slope and -intercept of the equation?
- Use the slope and intercept to identify the correct graph of the equation.
In this example, to identify the correct graph of the given equation, we must first rearrange the equation to find the slope and -intercept. Our equation is , so let’s begin by isolating on the left-hand side by dividing through by 3. This gives
Separating out the terms on the right, we then have
In the slope–intercept equation of a line, , the coefficient of is the slope of the line. In our case, this is equal to 1 and the constant, , is the -intercept, .
Now, if we check against the given graphs, as indicated below, the -intercepts of graphs B, C, D, and E are 1, , and respectively. Since none of these are equal to the -intercept of our line—that is, —we can eliminate all four of these graphs.
This leaves us with only one option, graph A, as the correct graph. However, to be absolutely sure that graph A does match that of our equation, let’s check that the slope of the line in graph A is indeed equal to 1.
Recall that the slope of a line is given by where and are points on the line. From graph A, we see that the points and are on the line.
Then, using these points in the equation for the slope , we have
Hence, we have confirmed that both the slope, which is equal to 1, and the -intercept, which is equal to , of graph A match that of the equation , if it is expressed in slope–intercept form.
In our next example, we will match points on a graph with the equation of a line.
Example 3: Plotting Points of Linear Equations
Maged wants to draw the graph of the linear equation .
He plotted the points with -coordinates 0, 1, 2, 3, and 4 but made one mistake.
- Which point is incorrect?
- What are the correct coordinates of this point?
To find which of the points does not satisfy the equation , let’s first find the coordinates of each of the points on the graph. We can then insert the - and -values for each point into the equation to determine which is the incorrect point.
Tracing out the - and -coordinates on the graph for each point, we find the coordinates , and . Now, substituting each of these in turn into the equation , we have the following:
The only point whose coordinates do not satisfy the given equation is point D. Hence, point D is incorrect.
To find the correct coordinates of this point, we substitute the -coordinate, , into the equation, giving
Hence, as shown in the graph below, the correct coordinates of the point on the line , with , are .
In our next example, we will demonstrate how to make and use a table of values to determine which is the correct graph for a specified linear equation.
Example 4: Determining the Graph of a Linear Function Using a Table of Values
By making a table of values, determine which of the following graphs represents the equation .
We’re asked to make a table of values to help us determine which of the graphs represents the equation . This means choosing an appropriate set of -values that we substitute into the given equation to calculate the associated -values. We will then have a set of coordinates of points on the graph of the equation, which we can compare with the given graphs.
For the calculations to be straightforward, we choose points from the given graphs, with integer -values. From lowest to highest, the graphs cross the -axis at (graphs A and D) and at (graphs B and E). We can also include so that we have three points to consider.
Now, using the equation to calculate the -coordinates for these -values, we have
Into our table, this gives us the following:
We now have the coordinates of three points on our graph: , and . By plotting these points on the given graphs, we can determine which of the graphs represents the equation .
As we can see, the only graph that goes through all three of our calculated points is graph A. Graphs B and C do not go through any of our three points, and graphs D and E go through only one of the points: respectively, and .
Hence, the equation is represented in graph A.
In our final example, we use the slope and intercept of a graphed linear function to determine its equation.
Example 5: Graphing Functions
Which of the following is the function represented by the shown graph?
To find which of the given functions is represented by the graph, we first recall that the slope–intercept form of a linear function is , or, sometimes, , where is the slope, or gradient, of the line and or is the -intercept. All of the given options except option A are in this form, so let’s rearrange option A to slope–intercept form as follows:
Our options are now
Now if we consider the given graph, we can see that the -intercept—that is, where —is at .
Substituting into each of our options, we find that only options B and D have their -intercept at . Options A, C, and E have -intercepts at , and respectively. Hence, we can eliminate options A, C, and E. This leaves us with options B and D to consider.
We can use what we know about the slope of a line to find which is the correct equation. Recall that given two points on a line, and , the slope of the line is given by the ratio of the change in to the change in ,
Using our graph, we can choose two points on the line, say, and .
Using these two points, we can then calculate the slope:
Comparing options B, , and D, , we see that only option B has the correct slope.
Hence, the function represented by the graph shown is option B: .
We conclude this explainer with some of the key points covered on graphing linear functions.
- A linear function can be expressed as (or ), where is the slope, or gradient, of the line and (or ) is the -intercept. (This is known as the slope–intercept form of a line.)
- The slope of a line, , sometimes called the rise over the run , is the ratio of the change in to the change in . Given two points on the line, and the slope is then
- We can graph a linear function by creating a table of values for and from the equation, plotting the coordinates of the points, and drawing the unique line through those points.
- Given a graph of a linear function, we can find its equation by using the coordinates of points on the line to determine its slope and intercept.