Lesson Explainer: Graphing Linear Functions | Nagwa Lesson Explainer: Graphing Linear Functions | Nagwa

Lesson Explainer: Graphing Linear Functions Mathematics • Third Year of Preparatory School

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

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=βˆ’8βˆ’11=βˆ’19,𝑓(0)=8Γ—0βˆ’11=βˆ’11,𝑓(1)=8Γ—1βˆ’11=βˆ’3.

We can now complete the table with these three values.

π‘₯βˆ’101
𝑦=𝑓(π‘₯)βˆ’19βˆ’11βˆ’3

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 𝑓(π‘₯)=5βˆ’2π‘₯.

  1. We can draw a straight line to represent this function. Complete the table to find the coordinates of points on the line.
    π‘₯βˆ’2βˆ’1012
    𝑓(π‘₯)β‹―β‹―β‹―β‹―β‹―
  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 𝑦=5βˆ’2π‘₯ 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βŸΉπ‘¦=5βˆ’2Γ—(βˆ’2)𝑦=9,π‘₯=βˆ’1βŸΉπ‘¦=5βˆ’2Γ—(βˆ’1)𝑦=7,π‘₯=0βŸΉπ‘¦=5βˆ’2Γ—0𝑦=5,π‘₯=1βŸΉπ‘¦=5βˆ’2Γ—1𝑦=3,π‘₯=2βŸΉπ‘¦=5βˆ’2Γ—2𝑦=1.

Hence, we can complete the table as follows:

π‘₯βˆ’2βˆ’1012
𝑦=𝑓(π‘₯)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 𝑦=5βˆ’2π‘₯, and we see that this is the case only in graph B.

Hence, graph B is the graph of the equation 𝑦=5βˆ’2π‘₯.

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, 𝑦=5βˆ’2π‘₯. 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: (π‘₯,𝑦)𝑦=5βˆ’2π‘₯(4,βˆ’3)βˆ’3=5βˆ’2Γ—(4)=βˆ’3βœ“(βˆ’3,11)11=5βˆ’2Γ—(βˆ’3)=11βœ“(βˆ’4,13)13=5βˆ’2Γ—(βˆ’4)=13βœ“(3,βˆ’1)βˆ’1=5βˆ’2Γ—(3)=βˆ’1βœ“(6,βˆ’6)βˆ’6=5βˆ’2Γ—(6)=βˆ’7::::::?????Γ—

The only point that does not satisfy the equation 𝑦=5βˆ’2π‘₯ 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.

π‘₯βˆ’2βˆ’1012
𝑦⋯⋯⋯⋯⋯

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.

π‘₯βˆ’2βˆ’1012
π‘¦βˆ’3βˆ’3βˆ’3βˆ’3βˆ’3

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 pointο€Ό0,βˆ’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.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

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