Write a Linear Function
Learning Objectives
- Calculate slope for a linear function given two points
- Write the equation of a linear function given two points and a slope

Calculate and Interpret Slope
In the examples we have seen so far, we have had the slope provided for us. However, we often need to calculate the slope given input and output values. Given two values for the input, and , and two corresponding values for the output, and —which can be represented by a set of points, and —we can calculate the slope , as follows where is the vertical displacement and is the horizontal displacement. Note in function notation two corresponding values for the output and for the function , and , so we could equivalently write The graph in Figure 5 indicates how the slope of the line between the points, and , is calculated. Recall that the slope measures steepness. The greater the absolute value of the slope, the steeper the line is.
Q & A
Are the units for slope always ? Yes. Think of the units as the change of output value for each unit of change in input value. An example of slope could be miles per hour or dollars per day. Notice the units appear as a ratio of units for the output per units for the input.A General Note: Calculate Slope
The slope, or rate of change, of a function can be calculated according to the following: where and are input values, and are output values.How To: Given two points from a linear function, calculate and interpret the slope.
- Determine the units for output and input values.
- Calculate the change of output values and change of input values.
- Interpret the slope as the change in output values per unit of the input value.
Example: Finding the Slope of a Linear Function
If is a linear function, and and are points on the line, find the slope. Is this function increasing or decreasing?Answer: The coordinate pairs are and . To find the rate of change, we divide the change in output by the change in input. We could also write the slope as . The function is increasing because .
Analysis of the Solution
As noted earlier, the order in which we write the points does not matter when we compute the slope of the line as long as the first output value, or y-coordinate, used corresponds with the first input value, or x-coordinate, used.Try It
If is a linear function, and and are points on the line, find the slope. Is this function increasing or decreasing?Answer:
Example: Finding the Population Change from a Linear Function
The population of a city increased from 23,400 to 27,800 between 2008 and 2012. Find the change of population per year if we assume the change was constant from 2008 to 2012.Answer: The rate of change relates the change in population to the change in time. The population increased by people over the four-year time interval. To find the rate of change, divide the change in the number of people by the number of years. So the population increased by 1,100 people per year.
Analysis of the Solution
Because we are told that the population increased, we would expect the slope to be positive. This positive slope we calculated is therefore reasonable.Try It
The population of a small town increased from 1,442 to 1,868 between 2009 and 2012. Find the change of population per year if we assume the change was constant from 2009 to 2012.Answer: