Lesson Explainer: Graphing Linear Functions Mathematics

In this explainer, we will learn how to graph linear functions.

If a relation or function can be represented graphically by a straight line, we say that the relation or function is linear. For example, the relationship between degrees Celsius and degrees Fahrenheit is linear. Converting from degrees Fahrenheit to degrees Celsius, we use the formula CF=59(32), and as shown below, its graph is a straight line. If an employee is paid by the hour (h)—for example, $20 per hour—then their salary (S) is a linear function of the number of hours they work: Sh=20. In economics, the price (P) and demand (Q) for certain goods may be linearly related: PQ=𝑎𝑏.

In each of these examples, we see that the graph of the function is a straight line. Further, each of these straight lines has a unique linear equation or function specifying the relationship between the two variables.

We recall that, in general, a function is a rule expressing the dependent, or output variable, often called 𝑦, in terms of the independent, or input variable, often called 𝑥. Each input value, 𝑥, produces a unique output value, 𝑦=𝑓(𝑥). The input and output values combine to form ordered pairs (𝑥,𝑓(𝑥)), or (𝑥,𝑦), and each ordered pair corresponds to the coordinates of one point on the graph of the function in the plane.

We define a linear function as follows.

Definition: Linear Functions

The function 𝑓, where 𝑓(𝑥)=𝑎𝑥+𝑏, 𝑎,𝑏, and 𝑎0, is called a linear function.

In the special case where 𝑎=0, we call 𝑓(𝑥)=𝑏 the constant function.

For a linear function, the ordered pairs (𝑥,𝑓(𝑥)), or (𝑥,𝑦), is represented graphically as a point on a line. Let’s look at an example.

Example 1: Graphing Linear Functions by Making Tables

Let us consider the function 𝑓(𝑥)=8𝑥11.

  1. Fill in the table.
    𝑥101
    𝑦=𝑓(𝑥)
  2. Identify the three points that lie on the line 𝑦=8𝑥11.

Answer

Part 1

To fill in the table, we will need to calculate the values of the function 𝑦=𝑓(𝑥) associated with each of the three given 𝑥 values: 𝑥=1,0, and 1. We do this by substituting each of the three values, in turn, into the function, as follows: 𝑓(1)=8×(1)11=811=19,𝑓(0)=8×011=11,𝑓(1)=8×111=3.

We can now complete the table with these three values.

𝑥101
𝑦=𝑓(𝑥)19113

Part 2

We are also asked to identify the three points in the graph that lie on the line 𝑦=8𝑥11. Now, in creating a table of values for a function, we produce ordered pairs, which are coordinates on the graph of that function. From the table, we see that the three ordered pairs for our function 𝑓(𝑥) are (1,19), (0,11), and (1,3). If we plot these on our graph, we will see which of the given points they coincide with. Plotting our first point, (1,19), we see that, on our graph, this coincides with the point labeled I.

Our next point, (0,11), coincides with point H on the graph.

Finally, plotting our third point, (1,3), we see that this coincides with point G on our graph.

Therefore, the three points that lie on the line 𝑦=8𝑥11 are points I, H, and G, as shown in the diagram below.

In our next example, we are given a table with some known and some unknown values. We use the known values to identify the graph of the linear relation and then the graph to identify the unknown values.

Example 2: Identifying the Graph of a Linear Relation given Values from a Table and Determining Unknowns Using the Graph

The following table represents a linear function.

𝑥0123
𝑦 1 3 𝑎𝑏
  1. Which of the following graphs represents this line?
  2. Find the values of 𝑎 and 𝑏.
  3. Write the equation of the straight line in the form 𝑓(𝑥)=𝑚𝑥+𝑐.

Answer

Part 1

In the table, we have the 𝑥- and 𝑦-values for two ordered pairs, (𝑥,𝑦), of the linear relation. These are (0,1) and (1,3) representing two points on the line. Comparing with the given graphs, we see that only the lines in graphs B and C go through the point (0,1). In fact, only graph B goes through both the given points.

Therefore, the linear relation is represented by graph B.

Part 2

We can now use graph B to find the values of 𝑎 and 𝑏. Since we know that the 𝑥-values associated with 𝑦=𝑎 and 𝑦=𝑏 are 𝑥=2 and 𝑥=3, respectively, we can read off the values of 𝑎 and 𝑏 directly from the line, as shown below.

We see that, on the line, when 𝑥=2, 𝑦=5 and when 𝑥=3, 𝑦=7. Hence, 𝑎=5 and 𝑏=7.

Part 3

We are asked to write the equation of the straight line in the form 𝑓(𝑥)=𝑚𝑥+𝑐. Since graph B goes through the point (0,1), we know that when 𝑥=0, 𝑦=1. Substituting these values into our function 𝑓(𝑥), we have 1=𝑓(0)=𝑚×0+𝑐=𝑐.

Hence, 𝑐=1. Now, using this value for 𝑐 in our function 𝑓(𝑥)=𝑚𝑥+𝑐, with another point on the line, say, (1,3), we can find the value of 𝑚 as follows. Substituting 𝑐=1, 𝑥=1, and 𝑦=3, we have 3=𝑓(1)=𝑚×1+1=𝑚+1.

Solving for 𝑚, we find 𝑚=2. Hence, with 𝑐=1 and 𝑚=2, the equation of the straight line is 𝑓(𝑥)=2𝑥+1.

Let’s consider another example of how we determine the graph of a straight line from a table of values.

Example 3: Graphing Linear Functions by Plotting Points

Consider the linear function 𝑓(𝑥)=52𝑥.

  1. We can draw a straight line to represent this function. Complete the table to find the coordinates of points on the line.
    𝑥21012
    𝑓(𝑥)
  2. Which of the following is the graph of the function?
  3. Which of these points is not on the line?
    1. (4,3)
    2. (3,11)
    3. (4,13)
    4. (3,1)
    5. (6,6)

Answer

Part 1

We begin by using the equation 𝑦=52𝑥 to determine the 𝑦-values corresponding to the 𝑥-values given in the table. These are 𝑥=2,1,0,1, and 2. Substituting each of these in turn into the equation, we have 𝑥=2𝑦=52×(2)𝑦=9,𝑥=1𝑦=52×(1)𝑦=7,𝑥=0𝑦=52×0𝑦=5,𝑥=1𝑦=52×1𝑦=3,𝑥=2𝑦=52×2𝑦=1.

Hence, we can complete the table as follows:

𝑥21012
𝑦=𝑓(𝑥)97531

Part 2

Now, from the table, we can construct the ordered pairs, (𝑥,𝑦), corresponding to points on the line. These are (2,9), (1,7), (0,5), (1,3), and (2,1). All five of these points must lie on the graph of the line 𝑦=52𝑥, and we see that this is the case only in graph B.

Hence, graph B is the graph of the equation 𝑦=52𝑥.

Part 3

Next, we must determine which of the points (4,3), (3,11), (4,13), (3,1), and (6,6) is not on the line. Since we know that graph B represents the equation of the line, we could try plotting the given points on graph B to see which are on the line and which are not. However, a more accurate method is to substitute the 𝑥- and 𝑦-values of each point into the given equation, 𝑦=52𝑥. If the left-hand side is equal to the right-hand side after evaluation, then the point lies on the line. If not, then the point does not lie on the line. Let’s do this for our five points: (𝑥,𝑦)𝑦=52𝑥(4,3)3=52×(4)=3(3,11)11=52×(3)=11(4,13)13=52×(4)=13(3,1)1=52×(3)=1(6,6)6=52×(6)=7::::::?????×

The only point that does not satisfy the equation 𝑦=52𝑥 is the point (6,6). Hence, the point (6,6) is not on the line.

In our next example, using the graph of a straight line, we create a table of values and use this to determine which is the correct equation of the line.

Example 4: Creating a Table of Values to Determine Which Function Matches the Graph

By making a table of values, determine which of the following is the function represented by the graph shown.

  1. 𝑓(𝑥)=4𝑥
  2. 𝑓(𝑥)=4𝑥+1
  3. 𝑓(𝑥)=4𝑥1
  4. 𝑓(𝑥)=4𝑥+1
  5. 𝑓(𝑥)=4𝑥

Answer

From the graph, we see that there are three points that will be convenient to work with, since their coordinates have integers—that is, whole number values.

These points have coordinates (1,4), (0,0), and (1,4). We can now construct a table with the 𝑥- and 𝑦-values of these points as cell values.

𝑥101
𝑦404

Using these three points, we can determine which is the correct function as follows.

Taking first the point with coordinates (0,0), we know that, on our line, when 𝑥=0, 𝑦=0. Substituting 𝑥=0 and 𝑦=𝑓(0)=0 into each of the given functions, we have A:B:C:D:E:𝑓(𝑥)=4𝑥0=4×(0)=0𝑓(𝑥)=4𝑥+10=4×(0)+1=1𝑓(𝑥)=4𝑥10=4×(0)1=1𝑓(𝑥)=4𝑥+10=4×(0)+1=1𝑓(𝑥)=4𝑥0=4×(0)=0?????×××

Since 𝑓(0)=0 only for options A and E, we can eliminate options B, C, and D. Now, following the same procedure with the remaining two points, (1,4) and (1,4), in options A and E, we have (1,4)𝑓(𝑥)=4𝑥4=4×(1)=4𝑓(𝑥)=4𝑥4=4×(1)=4(1,4)𝑓(𝑥)=4𝑥4=4×1=4𝑓(𝑥)=4𝑥4=4×1=4A:E:A:E:????××

We see that, for both points, the function in option A satisfies the equation and the function in option B does not. In fact, we need not have tried both points since either one would have given us the required result. That is, option A, 𝑓(𝑥)=4𝑥, is the correct function.

Before completing this explainer, we recall that, in the special case where a linear function is a constant function, the function is represented graphically by a horizontal line. As an example, suppose we are asked to complete the table below for values of the function 𝑦=𝑓(𝑥)=3.

𝑥21012
𝑦

Since our function is a constant function, we know that it takes the same value for 𝑦=𝑓(𝑥) no matter the value of 𝑥. In our case, this value is 𝑦=3. Hence, we complete the table where each 𝑦-value is equal to 3.

𝑥21012
𝑦33333

This function is represented graphically as shown below.

We see that a constant output means that all points on the graph of 𝑓(𝑥) have same 𝑦-coordinate, which, in this case, is 𝑦=3.

In general, if a linear function is a constant function—that is, it has the form 𝑓(𝑥)=𝑏—the function is represented graphically by a horizontal line through the point (0,𝑏). The graph below shows such a function for a positive value of 𝑏.

Let’s look at another example.

Example 5: Determining the Graph of a Constant Function

Identify which of the graphs represents the function 𝑓(𝑥)=12.

Answer

We recall that a linear function is a function of the form 𝑦=𝑓(𝑥)=𝑎𝑥+𝑏, where 𝑎 and 𝑏 are real numbers. We know also that a linear function is represented graphically by a straight line. In the special case where 𝑎=0 such that 𝑦=𝑓(𝑥)=𝑏, the function is called a constant function. A constant function is represented graphically by a horizontal line passing through the point (0,𝑏) on the 𝑦-axis.

The function we are given, 𝑓(𝑥)=12, is of this form, where, in our case, 𝑎=0 and 𝑏=12. This means that, graphically, our function is represented by a horizontal line passing through the point0,12.

Considering each of the graphs shown, we see that although graph A is a horizontal line, it passes through the point 0,12, not 0,12. Therefore, graph A cannot represent our function. Graph B is a vertical line, as is graph D, so we can eliminate these. Finally, graph C is not a horizontal line. The only graph that is a horizontal line passing through the point 0,12 is graph E.

Hence, graph E represents the function 𝑓(𝑥)=12.

Let’s finish by reminding ourselves of some of the key points covered in this explainer.

Key Points

  • A linear function is a function of the form 𝑓, where 𝑓(𝑥)=𝑎𝑥+𝑏, 𝑎,𝑏, and 𝑎0. In the special case where 𝑎=0, we call 𝑓(𝑥)=𝑏 the constant function.
  • When graphing a function, the coordinates of each point on the graph are (input, output)—that is, (𝑥,𝑓(𝑥)), or (𝑥,𝑦).
  • A linear function is represented graphically as a straight line. A constant function is represented graphically as a horizontal line.
  • A table containing a selection of input and output values of a linear function can be helpful in identifying or plotting the graph of the function.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.