Skip to main content
Mathematics LibreTexts

5.2: Linear Functions

  • Page ID
    45053
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Previously, we discussed graphing linear equations. Putting it all together with functions, we now discuss linear functions. We treat linear functions in the same manner as linear equations, except for the condition that linear functions have only one output for every input.

    Definition: Linear Function

    A linear function is a function of the form \[f(x)=mx+b\nonumber\]

    The graph of a linear function is a line and the coefficients \(m\) represents the slope of the line and \(b\) represents the \(y\)-intercept.

    We can rewrite the slope formula using function notation as \[m=\dfrac{f(x_2)-f(x_1)}{x_2-x_1}\nonumber\] where \((x_1, f(x_1))\) and \((x_2, f(x_2))\) are ordered-pairs on the line.

    Example 5.2.1

    If \(f(x)\) is a linear function and given \(f(7) = 9\) and \(f(12) = −2\), determine the linear function.

    Solution

    The first thing we want to do is rewrite the function values as ordered-pairs on the line.

    \[\begin{array}{rl}f(7)=9&\text{Rewrite as an ordered-pair} \\ (7,9)&\text{This is }(x_1,f(x_1))\end{array}\nonumber\]

    \[\begin{array}{rl}f(12)=-2&\text{Rewrite as an ordered-pair} \\ (12,-2)&\text{This is }(x_2,f(x_2))\end{array}\nonumber\]

    Next, we see that we have two points in which we need to find the equation of the line. Hence, we use the same techniques as usual, but now in function notation. Let’s find the slope using \((7, 9)\) and \((12, −2)\) as the ordered-pairs.

    \[\begin{array}{rl}m=\dfrac{f(x_2)-f(x_1)}{x_2-x_1}&\text{Plug-n-chug the ordered-pairs} \\ m=\dfrac{-2-9}{12-7}&\text{Simplify} \\ m=\dfrac{-11}{5}&\text{Slope of the line, }m\end{array}\nonumber\]

    Using the point-slope formula, let’s plug-n-chug one of the points, \((7, 9)\), and the slope \(m=-\dfrac{11}{5}\).

    \[\begin{array}{rl}y-y_1=m(x-x_1)&\text{Point-slope formula} \\ y-\color{blue}{9}\color{black}{}=\color{blue}{-\dfrac{11}{5}}\color{black}{}(x-\color{blue}{7}\color{black}{})&\text{Simplify} \\ y-\color{blue}{9}\color{black}{}=-\dfrac{11}{5}x+\dfrac{77}{5}&\text{Isolate }y \\ y=-\dfrac{11}{5}x+\dfrac{77}{5}\color{blue}{+9}\color{black}{}&\text{Simplify} \\ y=-\dfrac{11}{5}x+\dfrac{122}{5}&\text{Equation of a line}\end{array}\nonumber\]

    Notice, we have \(y\) isolated on the left. However, we need to rewrite the equation in function notation, so we need to replace the \(y\) with \(f(x)\):

    \[f(x)=-\dfrac{11}{5}x+\dfrac{122}{5}\nonumber\]

    Note

    In Example 5.2.1 , we used the point-slope formula to find the equation of the linear function, and then rewrote it, in the final step, using \(f(x)\). To use the point-slope formula in function notation, we can use the formula \[f(x)=m(x-x_1)+y_1\nonumber\] where \(m\) is the slope, and \((x_1, y_1)\) is a point on the line.

    Example 5.2.2

    Let’s redo Example 5.2.1 using the function notation of the point-slope formula to find the equation of the line.

    Solution

    Using the formula, let’s plug-n-chug one of the points, \((7, 9)\), and the slope \(m = −\dfrac{11}{5}\).

    \[\begin{array}{rl}f(x)=m(x-x_1)+y_1&\text{Point-slope formula in function notation} \\ f(x)=\color{blue}{-\dfrac{11}{5}}\color{black}{}(x-\color{blue}{7}\color{black}{})+\color{blue}{9}\color{black}{}&\text{Simplify} \\ f(x)=-\dfrac{11}{5}x+\dfrac{77}{5}+9 \\ f(x)=-\dfrac{11}{5}x+\dfrac{122}{5}&\text{Equation of a line in function notation}\end{array}\nonumber\]

    So, we can see the advantage of using the point-slope formula in function notation when trying to obtain a linear function. We easily plug-n-chug the slope and a point, then simplify to obtain the linear function. Students are encouraged to use this formula when appropriate.

    Linear Functions as Applications

    We use functions mostly for applications to the real world, usually called linear modeling. The slope is no longer thought of as a formula, or rise over run, but as an average rate of change. Furthermore, the \(y\)-intercept, \(b\), is thought of as an initial, fixed, or start-up value.

    Definition: Average Rate of Change

    The average rate of change for linear functions is represented by the formula \[m=\dfrac{\text{change in outputs}}{\text{change in inputs}}\nonumber\] and the units are interpreted as [output units] per [input units], e.g., miles per hour, where miles are the output units and hour is the input unit.

    Example 5.2.3

    The cost \(C(x)\), where \(x\) is the number of miles driven, of renting a car for a day is $21 plus $1.05 per mile.

    1. What is the slope of the linear function and its units?
    2. What is the \(y\)-intercept and its units?
    3. What is the linear function, \(C(x)\)?

    Solution

    1. The slope is the average rate of change where the units for the average rate of change is [output units] per [input units]. From the above given parameters, the slope is \(1.05\). Its units are dollars per mile.
    2. The \(y\)-intercept is the initial/fixed/start-up value. In this case, whether the car is driven or not, the daily cost is $21. Hence, the \(y\)-intercept is \(20\). Its units are dollars.
    3. The linear function is given as \(f(x) = mx + b\), but in this case, we have \(C(x) = mx + b\). Since the slope is \(1.05\) and the \(y\)-intercept is \(20\), then \(C(x) = 1.05x + 20\) and its units is dollars.

    Graphing Linear Functions

    Now that we’ve seen and interpreted graphs of linear equations, let’s take a look at graphing linear functions. We can use the techniques from a previous chapter: plotting points and then drawing a line through the points or use the \(y\)-intercept and slope. We will demonstrate both.

    Example 5.2.4

    Graph \(f(x)\) by point-plotting: \(f(x)=-2x+1\)

    Solution

    Usually, we pick three \(x\)-coordinates, and find corresponding \(y\)-values. Each \(x\)-value being positive, negative, and zero. This is common practice, but not required.

    Table 5.2.1
    \(x\) \(f(x)=-2x+1\) \((x,f(x))\)
    \(-1\) \(f(\color{blue}{-1}\color{black}{})=-2(\color{blue}{-1}\color{black}{})+1=2+1=3\) \((-1,3)\)
    \(0\) \(f(\color{blue}{0}\color{black}{})=-2(\color{blue}{0}\color{black}{})+1=0+1=1\) \((0,1)\)
    \(1\) \(f(\color{blue}{1}\color{black}{})=-2(\color{blue}{1}\color{black}{})+1=-2+1=-1\) \((1,-1)\)
    clipboard_e43063f8d60d174310bed0425e7001d21.png
    Figure 5.2.1

    Plot the three ordered-pairs from the table. To connect the points, be sure to connect them from smallest \(x\)-value to largest \(x\)-value, i.e., left to right. Draw the line to fill the grid and put arrows at the ends. It is recommended to purchase a small \(6\)-inch ruler to make nice straight lines.

    Example 5.2.5

    Graph \(g(t) =\dfrac{1}{2}t −\dfrac{3}{2}\) by using the slope and \(y\)-intercept.

    Solution

    The \(y\)-intercept, or \(b\), is where the graph crosses the \(y\)-axis. The \(y\)-intercept is \(−\dfrac{3}{2}\) and the line will cross the \(y\)-axis at \(\left(0,-\dfrac{3}{2}\right)\). The slope is \(\dfrac{1}{2}\), and, using \(\dfrac{rise}{run}\), we need to rise upward \(1\) unit and run to the right \(2\) units to reach the next point. We continue the pattern to obtain a third point. Now we can connect the dots and create a well-defined line. Be sure to draw it to fill the grid.

    clipboard_e765679ed2aed3d280a237a8eb20b483e.png
    Figure 5.2.2
    Note

    Notice when graphing linear functions, it is similar when graphing linear equations. The only difference is the \(y\)-axis units changes to its function notation, i.e., in Example 5.2.4 , instead of labeling \(y\) on the vertical axis, we labeled it \(f(x)\).

    Linear Functions Homework

    Exercise 5.2.1

    If \(f(x)\) is a linear function and given \(f(3) = 2\) and \(f(13) = 4\), determine the linear function.

    Exercise 5.2.2

    If \(f(x)\) is a linear function and given \(f(4) = −9\) and \(f(12) = 3\), determine the linear function.

    Exercise 5.2.3

    The cost \(C(x)\), where \(x\) is the number of miles driven, of renting a car for a day is $50 plus $1.85 per mile.

    1. What is the slope of the linear function and its units?
    2. What is the \(y\)-intercept and its units?
    3. What is the linear function, \(C(x)\)?
    Exercise 5.2.4

    The cost \(C(x)\), where \(x\) is the number of miles driven, of renting a car for a day is $25 plus $0.65 per mile.

    1. What is the slope of the linear function and its units?
    2. What is the \(y\)-intercept and its units?
    3. What is the linear function, \(C(x)\)?

    Graph each linear function.

    Exercise 5.2.5

    \(f(x)=2x-1\)

    Exercise 5.2.6

    \(f(x)=3-x\)

    Exercise 5.2.7

    \(g(x)=\dfrac{1}{3}x-3\)

    Exercise 5.2.8

    \(h(t)=\dfrac{1}{5}t+1\)

    Exercise 5.2.9

    \(p(n)=\dfrac{2}{3}n+\dfrac{1}{3}\)

    Exercise 5.2.10

    \(f(t)=\dfrac{1-t}{2}\)

    Exercise 5.2.11

    \(k(x)=-2x\)

    Exercise 5.2.12

    \(r(t)=3\)

    Exercise 5.2.13

    \(a(n)=0\)

    Extending the Concepts: Complete the exercises.

    Exercise 5.2.14

    Jeff can walk comfortably at \(3\) miles per hour. Find a linear function \(d\) that represents the total distance Jeff can walk in \(t\) hours, assuming he doesn’t take any breaks.

    Exercise 5.2.15

    Carl can stuff \(6\) envelopes per minute. Find a linear function \(E\) that represents the total number of envelopes Carl can stuff after \(t\) hours, assuming he doesn’t take any breaks.

    Exercise 5.2.16

    A landscaping company charges $45 per cubic yard of mulch plus a delivery charge of $20. Find a linear function which computes the total cost \(C\) (in dollars) to deliver \(x\) cubic yards of mulch.

    Exercise 5.2.17

    A plumber charges $50 for a service call plus $80 per hour. If she spends no longer than \(8\) hours a day at any one site, find a linear function that represents her total daily charges \(C\) (in dollars) as a function of time \(t\) (in hours) spent at any one given location.

    Exercise 5.2.18

    A salesperson is paid $200 per week plus 5% commission on her weekly sales of \(x\) dollars. Find a linear function that represents her total weekly pay, \(W\) (in dollars) in terms of \(x\).

    Exercise 5.2.19

    An on-demand publisher charges $22.50 to print a \(600\)-page book and $15.50 to print a \(400\)-page book. Find a linear function which models the cost of a book \(C\) as a function of the number of pages \(p\). Interpret the slope of the linear function and find and interpret \(C(0)\).


    This page titled 5.2: Linear Functions is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Darlene Diaz (ASCCC Open Educational Resources Initiative) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.