We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

Study Guides > College Algebra

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, [latex]{x}_{1}[/latex] and [latex]{x}_{2}[/latex], and two corresponding values for the output, [latex]{y}_{1}[/latex] and [latex]{y}_{2}[/latex] —which can be represented by a set of points, [latex]\left({x}_{1}\text{, }{y}_{1}\right)[/latex] and [latex]\left({x}_{2}\text{, }{y}_{2}\right)[/latex]—we can calculate the slope [latex]m[/latex], as follows [latex-display]m=\frac{\text{change in output (rise)}}{\text{change in input (run)}}=\frac{\Delta y}{\Delta x}=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}[/latex-display] where [latex]\Delta y[/latex] is the vertical displacement and [latex]\Delta x[/latex] is the horizontal displacement. Note in function notation two corresponding values for the output [latex]{y}_{1}[/latex] and [latex]{y}_{2}[/latex] for the function [latex]f[/latex], [latex]{y}_{1}=f\left({x}_{1}\right)[/latex] and [latex]{y}_{2}=f\left({x}_{2}\right)[/latex], so we could equivalently write [latex-display]m=\frac{f\left({x}_{2}\right)-f\left({x}_{1}\right)}{{x}_{2}-{x}_{1}}[/latex-display] The graph in Figure 5 indicates how the slope of the line between the points, [latex]\left({x}_{1,}{y}_{1}\right)[/latex] and [latex]\left({x}_{2,}{y}_{2}\right)[/latex], is calculated. Recall that the slope measures steepness. The greater the absolute value of the slope, the steeper the line is.
Graph depicting how to calculate the slope of a line The slope of a function is calculated by the change in [latex]y[/latex] divided by the change in [latex]x[/latex]. It does not matter which coordinate is used as the [latex]\left({x}_{2,\text{ }}{y}_{2}\right)[/latex] and which is the [latex]\left({x}_{1},\text{ }{y}_{1}\right)[/latex], as long as each calculation is started with the elements from the same coordinate pair.

Q & A

Are the units for slope always [latex]\frac{\text{units for the output}}{\text{units for the input}}[/latex] ? 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 [latex]m[/latex] can be calculated according to the following: [latex-display]m=\frac{\text{change in output (rise)}}{\text{change in input (run)}}=\frac{\Delta y}{\Delta x}=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}[/latex-display] where [latex]{x}_{1}[/latex] and [latex]{x}_{2}[/latex] are input values, [latex]{y}_{1}[/latex] and [latex]{y}_{2}[/latex] are output values.

How To: Given two points from a linear function, calculate and interpret the slope.

  1. Determine the units for output and input values.
  2. Calculate the change of output values and change of input values.
  3. Interpret the slope as the change in output values per unit of the input value.

Example: Finding the Slope of a Linear Function

If [latex]f\left(x\right)[/latex] is a linear function, and [latex]\left(3,-2\right)[/latex] and [latex]\left(8,1\right)[/latex] are points on the line, find the slope. Is this function increasing or decreasing?

Answer: The coordinate pairs are [latex]\left(3,-2\right)[/latex] and [latex]\left(8,1\right)[/latex]. To find the rate of change, we divide the change in output by the change in input. [latex-display]m=\frac{\text{change in output}}{\text{change in input}}=\frac{1-\left(-2\right)}{8 - 3}=\frac{3}{5}[/latex-display] We could also write the slope as [latex]m=0.6[/latex]. The function is increasing because [latex]m>0[/latex].

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 [latex]f\left(x\right)[/latex] is a linear function, and [latex]\left(2,3\right)[/latex] and [latex]\left(0,4\right)[/latex] are points on the line, find the slope. Is this function increasing or decreasing?

Answer: [latex-display]m=\frac{4 - 3}{0 - 2}=\frac{1}{-2}=-\frac{1}{2}[/latex] ; decreasing because [latex]m<0[/latex-display]

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 [latex]27,800-23,400=4400[/latex] 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. [latex-display]\frac{4,400\text{ people}}{4\text{ years}}=1,100\text{ }\frac{\text{people}}{\text{year}}[/latex-display] 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: [latex-display]m=\frac{1,868 - 1,442}{2,012 - 2,009}=\frac{426}{3}=142\text{ people per year}[/latex-display]

Licenses & Attributions

CC licensed content, Original

  • Revision and Adaptation. Provided by: Lumen Learning License: CC BY: Attribution.
  • Question ID 113460, 76345. Authored by: Lumen Learning. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.

CC licensed content, Shared previously

  • College Algebra. Provided by: OpenStax Authored by: Abramson, Jay et al.. Located at: https://openstax.org/books/college-algebra/pages/1-introduction-to-prerequisites. License: CC BY: Attribution. License terms: Download for free at http://cnx.org/contents/[email protected].
  • Question ID 2100, 2102. Authored by: Morales,Lawrence. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.