Graphs of Linear Functions
LEARNING OBJECTIVES
By the end of this lesson, you will be able to:- Graph linear functions.
- Write the equation for a linear function from the graph of a line.
- Given the equations of two lines, determine whether their graphs are parallel or perpendicular.
- Write the equation of a line parallel or perpendicular to a given line.
- Solve a system of linear equations.
Two competing telephone companies offer different payment plans. The two plans charge the same rate per long distance minute, but charge a different monthly flat fee. A consumer wants to determine whether the two plans will ever cost the same amount for a given number of long distance minutes used. The total cost of each payment plan can be represented by a linear function. To solve the problem, we will need to compare the functions. In this section, we will consider methods of comparing functions using graphs.
Graphing Linear Functions
In Linear Functions, we saw that that the graph of a linear function is a straight line. We were also able to see the points of the function as well as the initial value from a graph. By graphing two functions, then, we can more easily compare their characteristics.
There are three basic methods of graphing linear functions. The first is by plotting points and then drawing a line through the points. The second is by using the y-intercept and slope. And the third is by using transformations of the identity function
Graphing a Function by Plotting Points
To find points of a function, we can choose input values, evaluate the function at these input values, and calculate output values. The input values and corresponding output values form coordinate pairs. We then plot the coordinate pairs on a grid. In general, we should evaluate the function at a minimum of two inputs in order to find at least two points on the graph. For example, given the function,
How To: Given a linear function, graph by plotting points.
- Choose a minimum of two input values.
- Evaluate the function at each input value.
- Use the resulting output values to identify coordinate pairs.
- Plot the coordinate pairs on a grid.
- Draw a line through the points.
Example 1: Graphing by Plotting Points
Graph
Solution
Begin by choosing input values. This function includes a fraction with a denominator of 3, so let’s choose multiples of 3 as input values. We will choose 0, 3, and 6.
Evaluate the function at each input value, and use the output value to identify coordinate pairs.

Graphing a Linear Function Using y-intercept and Slope
Another way to graph linear functions is by using specific characteristics of the function rather than plotting points. The first characteristic is its y-intercept, which is the point at which the input value is zero. To find the y-intercept, we can set x = 0 in the equation.
The other characteristic of the linear function is its slope m, which is a measure of its steepness. Recall that the slope is the rate of change of the function. The slope of a function is equal to the ratio of the change in outputs to the change in inputs. Another way to think about the slope is by dividing the vertical difference, or rise, by the horizontal difference, or run. We encountered both the y-intercept and the slope in Linear Functions.
Let’s consider the following function.

A General Note: Graphical Interpretation of a Linear Function
In the equation
- b is the y-intercept of the graph and indicates the point (0, b) at which the graph crosses the y-axis.
- m is the slope of the line and indicates the vertical displacement (rise) and horizontal displacement (run) between each successive pair of points. Recall the formula for the slope:
Q & A
Do all linear functions have y-intercepts?Yes. All linear functions cross the y-axis and therefore have y-intercepts. (Note: A vertical line parallel to the y-axis does not have a y-intercept, but it is not a function.)
How To: Given the equation for a linear function, graph the function using the y-intercept and slope.
- Evaluate the function at an input value of zero to find the y-intercept.
- Identify the slope as the rate of change of the input value.
- Plot the point represented by the y-intercept.
- Use to determine at least two more points on the line.
- Sketch the line that passes through the points.
Example 2: Graphing by Using the y-intercept and Slope
Graph
Solution
Evaluate the function at x = 0 to find the y-intercept. The output value when x = 0 is 5, so the graph will cross the y-axis at (0, 5).
According to the equation for the function, the slope of the line is
Analysis of the Solution
The graph slants downward from left to right, which means it has a negative slope as expected.
Graphing a Linear Function Using Transformations
Another option for graphing is to use transformations of the identity function
Vertical Stretch or Compression
In the equation

Figure 4. Vertical stretches and compressions and reflections on the function
Vertical Shift
In

Figure 5. This graph illustrates vertical shifts of the function
Using vertical stretches or compressions along with vertical shifts is another way to look at identifying different types of linear functions. Although this may not be the easiest way to graph this type of function, it is still important to practice each method.
How To: Given the equation of a linear function, use transformations to graph the linear function in the form .
- Graph .
- Vertically stretch or compress the graph by a factor m.
- Shift the graph up or down b units.
Example 3: Graphing by Using Transformations
Graph
Solution
The equation for the function shows that

Figure 6. The function, y = x, compressed by a factor of
Figure 7. The function
Q & A
In Example 3, could we have sketched the graph by reversing the order of the transformations?No. The order of the transformations follows the order of operations. When the function is evaluated at a given input, the corresponding output is calculated by following the order of operations. This is why we performed the compression first. For example, following the order: Let the input be 2.
Writing the Equation for a Function from the Graph of a Line
Recall that in Linear Functions, we wrote the equation for a linear function from a graph. Now we can extend what we know about graphing linear functions to analyze graphs a little more closely. Begin by taking a look at Figure 8. We can see right away that the graph crosses the y-axis at the point (0, 4) so this is the y-intercept.

Then we can calculate the slope by finding the rise and run. We can choose any two points, but let’s look at the point (–2, 0). To get from this point to the y-intercept, we must move up 4 units (rise) and to the right 2 units (run). So the slope must be
Substituting the slope and y-intercept into the slope-intercept form of a line gives
How To: Given a graph of linear function, find the equation to describe the function.
- Identify the y-intercept of an equation.
- Choose two points to determine the slope.
- Substitute the y-intercept and slope into the slope-intercept form of a line.
Example 4: Matching Linear Functions to Their Graphs
Match each equation of the linear functions with one of the lines in Figure 9.

Solution
Analyze the information for each function.
- This function has a slope of 2 and a y-intercept of 3. It must pass through the point (0, 3) and slant upward from left to right. We can use two points to find the slope, or we can compare it with the other functions listed. Function g has the same slope, but a different y-intercept. Lines I and III have the same slant because they have the same slope. Line III does not pass through (0, 3) so f must be represented by line I.
- This function also has a slope of 2, but a y-intercept of –3. It must pass through the point (0, –3) and slant upward from left to right. It must be represented by line III.
- This function has a slope of –2 and a y-intercept of 3. This is the only function listed with a negative slope, so it must be represented by line IV because it slants downward from left to right.
- This function has a slope of and a y-intercept of 3. It must pass through the point (0, 3) and slant upward from left to right. Lines I and II pass through (0, 3), but the slope of j is less than the slope of f so the line for j must be flatter. This function is represented by Line II.
Now we can re-label the lines as in Figure 10.

Finding the x-intercept of a Line
So far, we have been finding the y-intercepts of a function: the point at which the graph of the function crosses the y-axis. A function may also have an x-intercept, which is the x-coordinate of the point where the graph of the function crosses the x-axis. In other words, it is the input value when the output value is zero.
To find the x-intercept, set a function f(x) equal to zero and solve for the value of x. For example, consider the function shown.
Set the function equal to 0 and solve for x.
The graph of the function crosses the x-axis at the point (2, 0).
Q & A
Do all linear functions have x-intercepts?
No. However, linear functions of the form y = c, where c is a nonzero real number are the only examples of linear functions with no x-intercept. For example, y = 5 is a horizontal line 5 units above the x-axis. This function has no x-intercepts.

A General Note: x-intercept
The x-intercept of the function is value of x when f(x) = 0. It can be solved by the equation 0 = mx + b.
Example 5: Finding an x-intercept
Find the x-intercept of
Solution
Set the function equal to zero to solve for x.
The graph crosses the x-axis at the point (6, 0).
Analysis of the Solution
A graph of the function is shown in Figure 12. We can see that the x-intercept is (6, 0) as we expected.

Describing Horizontal and Vertical Lines
There are two special cases of lines on a graph—horizontal and vertical lines. A horizontal line indicates a constant output, or y-value. In Figure 13, we see that the output has a value of 2 for every input value. The change in outputs between any two points, therefore, is 0. In the slope formula, the numerator is 0, so the slope is 0. If we use m = 0 in the equation
Figure 13. A horizontal line representing the function

A vertical line indicates a constant input, or x-value. We can see that the input value for every point on the line is 2, but the output value varies. Because this input value is mapped to more than one output value, a vertical line does not represent a function. Notice that between any two points, the change in the input values is zero. In the slope formula, the denominator will be zero, so the slope of a vertical line is undefined.
Notice that a vertical line, such as the one in Figure 15, has an x-intercept, but no y-intercept unless it’s the line x = 0. This graph represents the line x = 2.
Figure 15. The vertical line, x = 2, which does not represent a function.
A General Note: Horizontal and Vertical Lines
Lines can be horizontal or vertical.
A horizontal line is a line defined by an equation in the form
A vertical line is a line defined by an equation in the form
Example 6: Writing the Equation of a Horizontal Line
Write the equation of the line graphed in Figure 16.
Solution
For any x-value, the y-value is –4, so the equation is y = –4.
Example 7: Writing the Equation of a Vertical Line
Write the equation of the line graphed in Figure 17.

Solution
The constant x-value is 7, so the equation is x = 7.Determining Whether Lines are Parallel or Perpendicular
The two lines in Figure 18 are parallel lines: they will never intersect. Notice that they have exactly the same steepness, which means their slopes are identical. The only difference between the two lines is the y-intercept. If we shifted one line vertically toward the y-intercept of the other, they would become the same line.

We can determine from their equations whether two lines are parallel by comparing their slopes. If the slopes are the same and the y-intercepts are different, the lines are parallel. If the slopes are different, the lines are not parallel.
Unlike parallel lines, perpendicular lines do intersect. Their intersection forms a right, or 90-degree, angle. The two lines in Figure 20 are perpendicular.
Perpendicular lines do not have the same slope. The slopes of perpendicular lines are different from one another in a specific way. The slope of one line is the negative reciprocal of the slope of the other line. The product of a number and its reciprocal is 1. So, if
To find the reciprocal of a number, divide 1 by the number. So the reciprocal of 8 is
As with parallel lines, we can determine whether two lines are perpendicular by comparing their slopes, assuming that the lines are neither horizontal nor perpendicular. The slope of each line below is the negative reciprocal of the other so the lines are perpendicular.
The product of the slopes is –1.
A General Note: Parallel and Perpendicular Lines
Two lines are parallel lines if they do not intersect. The slopes of the lines are the same.
If and only if
Two lines are perpendicular lines if they intersect at right angles.
Example 8: Identifying Parallel and Perpendicular Lines
Given the functions below, identify the functions whose graphs are a pair of parallel lines and a pair of perpendicular lines.
Solutions
Parallel lines have the same slope. Because the functions
Analysis of the Solution
A graph of the lines is shown in Figure 21.
Figure 21. The graph shows that the lines
Writing the Equation of a Line Parallel or Perpendicular to a Given Line
If we know the equation of a line, we can use what we know about slope to write the equation of a line that is either parallel or perpendicular to the given line.
Writing Equations of Parallel Lines
Suppose for example, we are given the following equation.
We know that the slope of the line formed by the function is 3. We also know that the y-intercept is (0, 1). Any other line with a slope of 3 will be parallel to f(x). So the lines formed by all of the following functions will be parallel to f(x).
Suppose then we want to write the equation of a line that is parallel to f and passes through the point (1, 7). We already know that the slope is 3. We just need to determine which value for b will give the correct line. We can begin with the point-slope form of an equation for a line, and then rewrite it in the slope-intercept form.
So
How To: Given the equation of a function and a point through which its graph passes, write the equation of a line parallel to the given line that passes through the given point.
- Find the slope of the function.
- Substitute the given values into either the general point-slope equation or the slope-intercept equation for a line.
- Simplify.
Example 9: Finding a Line Parallel to a Given Line
Find a line parallel to the graph of
Solutions
The slope of the given line is 3. If we choose the slope-intercept form, we can substitute m = 3, x = 3, and f(x) = 0 into the slope-intercept form to find the y-intercept.
The line parallel to f(x) that passes through (3, 0) is
Analysis of the Solution
We can confirm that the two lines are parallel by graphing them. Figure 22 shows that the two lines will never intersect.

Writing Equations of Perpendicular Lines
We can use a very similar process to write the equation for a line perpendicular to a given line. Instead of using the same slope, however, we use the negative reciprocal of the given slope. Suppose we are given the following function:
The slope of the line is 2, and its negative reciprocal is
As before, we can narrow down our choices for a particular perpendicular line if we know that it passes through a given point. Suppose then we want to write the equation of a line that is perpendicular to f(x) and passes through the point (4, 0). We already know that the slope is
The equation for the function with a slope of
So
Q & A
A horizontal line has a slope of zero and a vertical line has an undefined slope. These two lines are perpendicular, but the product of their slopes is not –1. Doesn’t this fact contradict the definition of perpendicular lines?
No. For two perpendicular linear functions, the product of their slopes is –1. However, a vertical line is not a function so the definition is not contradicted.
How To: Given the equation of a function and a point through which its graph passes, write the equation of a line perpendicular to the given line.
- Find the slope of the function.
- Determine the negative reciprocal of the slope.
- Substitute the new slope and the values for x and y from the coordinate pair provided into .
- Solve for b.
- Write the equation for the line.
Example 10: Finding the Equation of a Perpendicular Line
Find the equation of a line perpendicular to
Solution
The original line has slope m = 3, so the slope of the perpendicular line will be its negative reciprocal, or
The line perpendicular to f(x) that passes through (3, 0) is
Analysis of the Solution
A graph of the two lines is shown in Figure 23.

Try It 5
Given the function
a. parallel to h(x)
b. perpendicular to h(x)
How To: Given two points on a line and a third point, write the equation of the perpendicular line that passes through the point.
- Determine the slope of the line passing through the points.
- Find the negative reciprocal of the slope.
- Use the slope-intercept form or point-slope form to write the equation by substituting the known values.
- Simplify.
Example 11: Finding the Equation of a Line Perpendicular to a Given Line Passing through a Point
A line passes through the points (–2, 6) and (4, 5). Find the equation of a perpendicular line that passes through the point (4, 5).
Solution
From the two points of the given line, we can calculate the slope of that line.Find the negative reciprocal of the slope.
We can then solve for the y-intercept of the line passing through the point (4, 5).
The equation for the line that is perpendicular to the line passing through the two given points and also passes through point (4, 5) is
Try It 6
A line passes through the points, (–2, –15) and (2, –3). Find the equation of a perpendicular line that passes through the point, (6, 4).
SolutionSolving a System of Linear Equations Using a Graph
A system of linear equations includes two or more linear equations. The graphs of two lines will intersect at a single point if they are not parallel. Two parallel lines can also intersect if they are coincident, which means they are the same line and they intersect at every point. For two lines that are not parallel, the single point of intersection will satisfy both equations and therefore represent the solution to the system.
To find this point when the equations are given as functions, we can solve for an input value so that
Example 12: Finding a Point of Intersection Algebraically
Find the point of intersection of the lines
Solution
Set
This tells us the lines intersect when the input is
We can then find the output value of the intersection point by evaluating either function at this input.
These lines intersect at the point
Analysis of the Solution
Looking at Figure 24, this result seems reasonable.
Q & A
If we were asked to find the point of intersection of two distinct parallel lines, should something in the solution process alert us to the fact that there are no solutions?
Yes. After setting the two equations equal to one another, the result would be the contradiction "0 = non-zero real number".
Try It 8
Using the graph in the Analysis of the Solution for Example 12, identify the following for the function
a. y-intercept
b. x-intercept(s)
c. slope
d. Is
e. Is
f. Write a transformation description for
Example 13: Finding a Break-Even Point
A company sells sports helmets. The company incurs a one-time fixed cost for $250,000. Each helmet costs $120 to produce, and sells for $140.
- Find the cost function, C, to produce x helmets, in dollars.
- Find the revenue function, R, from the sales of x helmets, in dollars.
- Find the break-even point, the point of intersection of the two graphs C and R.
Solution
- The cost function in the sum of the fixed cost, $125,000, and the variable cost, $120 per helmet.
- The revenue function is the total revenue from the sale of helmets,.
- The break-even point is the point of intersection of the graph of the cost and revenue functions. To find the x-coordinate of the coordinate pair of the point of intersection, set the two equations equal, and solve for x.
To find
, evaluate either the revenue or the cost function at 12,500.
The break-even point is (12,500, 1,750,000).
Analysis of the Solution
This means if the company sells 12,500 helmets, they break even; both the sales and cost incurred equaled 1.75 million dollars.
Key Concepts
- Linear functions may be graphed by plotting points or by using the y-intercept and slope.
- Graphs of linear functions may be transformed by using shifts up, down, left, or right, as well as through stretches, compressions, and reflections.
- The y-intercept and slope of a line may be used to write the equation of a line.
- The x-intercept is the point at which the graph of a linear function crosses the x-axis.
- Horizontal lines are written in the form, f(x) = b.
- Vertical lines are written in the form, x = b.
- Parallel lines have the same slope.
- Perpendicular lines have negative reciprocal slopes, assuming neither is vertical.
- A line parallel to another line, passing through a given point, may be found by substituting the slope value of the line and the x- and y-values of the given point into the equation, , and using the b that results. Similarly, the point-slope form of an equation can also be used.
- A line perpendicular to another line, passing through a given point, may be found in the same manner, with the exception of using the negative reciprocal slope.
- A system of linear equations may be solved setting the two equations equal to one another and solving for x. The y-value may be found by evaluating either one of the original equations using this x-value.
- A system of linear equations may also be solved by finding the point of intersection on a graph.
Glossary
- horizontal line
- a line defined by , where b is a real number. The slope of a horizontal line is 0.
- parallel lines
- two or more lines with the same slope
- perpendicular lines
- two lines that intersect at right angles and have slopes that are negative reciprocals of each other
- vertical line
- a line defined by x = a, where a is a real number. The slope of a vertical line is undefined.
- x-intercept
- the point on the graph of a linear function when the output value is 0; the point at which the graph crosses the horizontal axis
Problem Set
1. If the graphs of two linear functions are parallel, describe the relationship between the slopes and the y-intercepts.2. If the graphs of two linear functions are perpendicular, describe the relationship between the slopes and the y-intercepts.
3. If a horizontal line has the equation
4. Explain how to find a line parallel to a linear function that passes through a given point.
5. Explain how to find a line perpendicular to a linear function that passes through a given point.
For the following exercises, determine whether the lines given by the equations below are parallel, perpendicular, or neither parallel nor perpendicular:
6.
7.
8.
9.
10.
11.
For the following exercises, find the x- and y-intercepts of each equation.
12.
13.
14.
15.
16.
17.
For the following exercises, use the descriptions of each pair of lines given below to find the slopes of Line 1 and Line 2. Is each pair of lines parallel, perpendicular, or neither?
18. Line 1: Passes through
Line 2: Passes through
19. Line 1: Passes through
Line 2: Passes through
20. Line 1: Passes through
Line 2: Passes through
21. Line 1: Passes through
Line 2: Passes through
22. Line 1: Passes through
Line 2: Passes through
23. Line 1: Passes through
Line 2: Passes through
24. Write an equation for a line parallel to
25. Write an equation for a line parallel to
26. Write an equation for a line perpendicular to
27. Write an equation for a line perpendicular to
28. Find the point at which the line
29. Find the point at which the line
30. Use algebra to find the point at which the line
31. Use algebra to find the point at which the line
For the following exercises, the given linear equation with its graph.

33.
34.
35.
36.
37.
For the following exercises, sketch a line with the given features.
38. An x-intercept of
39. An x-intercept of
40. A y-intercept of
41. A y-intercept of
42. Passing through the points
43. Passing through the points
For the following exercises, sketch the graph of each equation.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59. If
a. Write an equation for
b. What is the slope of this line?
c. Find the y-intercept of this line.
60. Ifa. Write an equation for
b. What is the slope of this line?
c. Find the y-intercept of this line.
For the following exercises, write the equation of the line shown in the graph.61.




65.
66.
67.
68.
69.
70. Find the equation of the line parallel to the line
71. Find the equation of the line perpendicular to the line
For the following exercises, use the functions
72. Find the point of intersection of the lines f and g.
73. Where is
74. A car rental company offers two plans for renting a car.
Plan A: $30 per day and $0.18 per mile
Plan B: $50 per day with free unlimited mileage
How many miles would you need to drive for plan B to save you money?
75. A cell phone company offers two plans for minutes.
Plan A: $20 per month and $1 for every one hundred texts.
Plan B: $50 per month with free unlimited texts.
How many texts would you need to send per month for plan B to save you money?
76. A cell phone company offers two plans for minutes.
Plan A: $15 per month and $2 for every 300 texts.
Plan B: $25 per month and $0.50 for every 100 texts.
How many texts would you need to send per month for plan B to save you money?
Analysis of the Solution
The graph of the function is a line as expected for a linear function. In addition, the graph has a downward slant, which indicates a negative slope. This is also expected from the negative constant rate of change in the equation for the function.