Skip to main content
Mathematics LibreTexts

5.1 Linear Functions and Rate of Change

  • Page ID
    153753
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \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}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives

    By the end of this section, you will be able to:

    • recognize a linear function and identify its important characteristics
    • connect linear functions to everything we know about lines and linear equations
    • understand the concept of a secant line and relate it to average rate of change
    • recognize a line tangent to a graphed curve at a point
    • construct and use mathematical models using linear functions

    Omg, you say, enough about lines already???? I know, I know, I hear you. What I want to do in this section is just round up what we know about lines and linear equations, write it in the language of functions real quick, and actually then move on to some concepts that are probably going to show up in the first week of your Calc I courses. When your professor is like, "Blah blah secant line blah blah tangent line," you can nod emphatically and make a good first impression. You're welcome.

    Linear Functions

    A linear function is a first-degree polynomial function, i.e. it can be written in the form

    \[ f(x) = a_1 x + a_0 \notag \]

    where \(a_1( \neq 0)\) and \( a_0\) are constant coefficients. Fun facts about linear functions:

    • Both the domain and the range of a linear function (unless specified due to an application) are all real numbers, \( \mathbb{R}\).
    • The graphs of linear functions are straight lines. If you rename \(a_1 = m\) and \(a_0 = b\), you can recognize the slope-intercept equation of a line.
    • Consequently, the leading coefficient \(a_1\) gives the slope of the line, and the constant term \(a_0\) gives the \(y\)-intercept \( (0, a_0) \) of the graph.
    • Because of what we know about positive and negative slopes, if \(a_1 < 0 \), the function is decreasing (going downhill from left to right) and if \( a_1 > 0 \), the function is increasing (going uphill from left to right).

    Linear functions are then extremely easy to graph by hand, and hopefully by now that process is pretty second nature.

    Example \(\PageIndex{1}\)

    1. Describe what you know about the function \( f(x) = 5x \) just based on looking at him.

    2. Write the linear function whose graph is shown below.

    5.1.png

    3. Graph the linear function \( f(x) = -\frac{1}{2} x + 3 \).

    Solution

    1. We see that this is certainly a linear function, with \(a_1 = 5\) and \(a_0 = 0\). The former tells us that the slope is \(5\), which is a) uphill and b) pretty steep, being greater than 1... The latter tells us that the \(y\)-intercept is the origin \( (0,0) \), which is also the \(x\)-intercept.

    2. This line passes through the \(y\)-intercept \( (0,1) \), which tells us that \(a_0 = 1\). If we travel from \( (0,1) \) to \( (3,3)\), we see it requires three steps in the \(x\) direction and two steps in the \(y\) direction, so it's pretty clear that the slope is \( \frac{\text{rise}}{\text{run}} = \frac{2}{3} \), but you could also calculate it with the slope formula using these two points:

    \[ a_1 = m = \frac{ y_2 - y_1} {x_2 - x_1} = \frac{ 3-1}{3-0} = \frac{2}{3} \notag \]

    Thus the function must be \(f(x) = \frac{2}{3}x + 1 \).

    3. We immediately identify the \(y \)-intercept either by knowing the \(y = mx + b\) formula, or by plugging in \(x = 0\) (remember, in order to be intercepting the \(y\)-axis, you darn well better have an \(x\)-value of 0, so you can always find \(y\)-intercepts this way). It's \( (0,3)\), so we plot that point. We then use the slope \( \frac{-1}{2}\) by taking two steps to the right (run) and one step down (negative rise) and plot another point, \( (2,2)\). Connect the dots with a straight line.

    5.2.png

    Something we definitely need to be able to do is identify what functions are linear and what aren't! It's all about being able to match the defining form.

    Exercise \(\PageIndex{1}\)

    Are the functions linear?

    1. \( f(x) = 2-3x\)
    2. \( f(x) = x + 1 + x^2 \)
    3. \( f(x) = 4^x \)
    4. \( f(x) = 4x \)
    5. \( f(x) = 6\sqrt{x} + 1\)
    Answer
    1. Yes, this function has an \(x\) term to the first power and a constant term and nothing else.
    2. No, this function has an \(x^2\) term!
    3. No, this function has the \(x\) stuck in an exponent.
    4. Yes, this function has no constant term but that's okay. In the form \(f(x) = a_1 x + a_0\), we would just say that \(a_0 = 0\).
    5. No, this function has an \(x^{\frac{1}{2}}\) term.

    Rate of Change

    The discussion below will feel reminiscent of our discussion of variation, but the term "rate of change" is going to come up a lot in your future, so we're going to connect ideas here.

    When two variables depend on each other in some way, making a change in the independent variable will induce a change in the dependent variable. Exactly how and how much the dependent variable will react to a change in the independent variable depends on the nature of the relationship. We work with this idea intuitively all the time in daily life. For example,

    • The more washing machines I sell, the more money I make. The quantity "money I have" depends on the quantity "number of machines sold." The rate at which my money is increasing is directly related to the rate at which my sales are increasing. If each washing machine costs $999, then the money I make can be written as a function of the number of machines sold, via \( M(x) = 999x \). Every time I sell just one more machine, I make $999 more.
    • The longer I drive on the highway, the more ground I cover. The quantity "distance covered" depends on the quantity "time I've been driving." In fact, I have a word for this dependence, because I know about the concept of speed. Speed is the rate at which my distance changes, relative to how time is changing. A speed of 70mph means that when time changes from 0hr to 1hr, my distance covered will change from 0mi to 70mi.
    • If I pump water into a pool using a hose, then the volume of water in the pool will increase as time goes on. The quantity "volume" is related to the quantity "time," and the rate at which the volume increases will depend directly on how long I let the hose flow into the pool. If the hose is adding 10 gallons per minute, then whenever a minute of time passes, my dependent variable volume will increase by 10 gallons.

    In math language, we write the dependent variable as a function of the independent variable, and then talk about the rate of change of [dependent quantity] with respect to [independent quantity].

    • We have the function \( M(x) = 999x \). The rate of change of money, \(M\), with respect to number of machines sold, \(x\), is $999 per machine.
    • Remembering "distance equals speed times time," we write a function \(d(t) = 70t\). Speed is the rate of change of distance with respect to time. (The rate at which my distance is changing as time goes on.)
    • Say I started with 100 gallons in the pool, and I'm adding 10 more every minute. We could write volume \(V\) in gallons as a function of time \(t\) in minutes, \(V(t) = 100 + 10t \). The rate of change of volume with respect to time is 10 gallons per minute.

    Notice that the word "per" shows up when talking about these changing quantities. "Miles per hour," "gallons per minute." This is a clue about how rate of change is calculated, because "per" can indicate division.

    The average rate of change of a function \(y = f(x)\) between \(x=a\) and \(x = b\) is
    \[ \frac{ \text{ change in } y}{\text{ change in }x} = \frac{ f(b)-f(a)}{b-a} \notag \]

    In the examples I gave above, the rates of change are actually all constant. A constant $999 per machine, constant 70 miles per hour, constant 10 gallons per minute. Notice what kind of functions we were using... In each one, the independent variable appears only to the first power, with a constant coefficient. That's right, those are linear functions!

    Linear functions have constant rate of change.

    Now, maybe you've already noticed something interesting about the way we calculate rate of change. We've seen the language "change in \(y\) vs change in \(x\)" before, when calculating slope! Study the graphs below.

    roc.png

    The formula \( \dfrac{ \text{ change in } y}{\text{ change in } x} = \dfrac{ f(b) - f(a)}{b-a} \) is exactly the rise-over-run calculation of the slope of the blue line through \( (a,f(a))\) and \( (b,f(b))\)! And on the right, when the function is linear, the rate of change calculation will give the exact same answer every single time, because the slope of the line never changes.

    When you draw a straight line through two points on the graph of a function, like on the left above, it's called a secant line. The average rate of change of \(f\) between two points \(x = a\) and \( x = b\) is the slope of the secant line between those points \( (a,f(a))\) and \( (b,f(b)) \).

    We're going to do practice problems shortly that are inspired by real-life linear functions, but before that I want to give you a spoiler to help you out in Calc I later. It starts with a secant line between two points on a curve. I'm going to hold the first point stable, and gradually scootch the second point back closer and closer to the first point. Observe.

    seclines.png

    As I move the \( (b,f(b)) \) point, the slopes of my secant lines change. The closer I come to the \( (a,f(a))\) point, the more they approach a special kind of line, shown in red below.

    tanlines.png

    This red line is called the line tangent to the curve \(y = f(x)\) at the point \( (a, f(a)) \). You agree with me that while you're driving your car, you have a certain "instantaneous" speed at any split second in time? In a similar way, at the exact point \( (a,f(a))\), this red line has exactly the same instantaneous slope as the black graphed curve. This idea of instantaneous rate of change is huge in a Calc I class. So get hype.

    Constructing and Using Linear Functions

    Let's practice setting up and using linear functions in application problems, since like, all the algebra of working with linear functions is pretty much covered by everything we learned in lines and equations... This will help us practice our reasoning and interpretation skills as well. Double whammy, as my father would say.

    Example \(\PageIndex{2}\)

    I am going on a trip and I need to pay a petsitter to take care of my cat. Petsitter A charges a flat fee of $20 and then $20 per day of the trip. Petsitter B charges a flat fee of $80 and then $10 per day. For each option, write the total cost of the petsitting as a function of \(n\), the number of days I am gone. If I go on a 4-day trip, which petsitter should I choose? What about a two-week trip? For which trip length will the cost for each petsitter be the same? Graph both functions.

    Solution

    To calculate the cost of using Petsitter A, I start with the flat fee and add on $20 for every day of my trip. I can write the function performing this calculation as \(A(n) = 20 + 20n \). Similarly, the function giving the cost of Petsitter B is \( B(n) = 80 + 10n\). These are linear functions, because the variable \(n\) appears to the first power.

    If I go on a 4-day trip, that means \(n = 4\). Plugging that value into my functions will tell me the cost of each option. We have \( A(4) = 100 \) and \( B(4) = 120 \). Since Petsitter A costs less, I should use them for this trip.

    If I go on a two-week trip, that's \(n = 14\). We plug in again to find that \( A(14) = 300 \) and \( B(14) = 220 \). In this case, I should use Petsitter B.

    Now, how could I go about finding the \(n\) value for which the costs turn out the same? I just notice that if the two costs are \(A(n)\) and \(B(n)\), then my goal is to have

    \[ A(n) = B(n) \quad \longrightarrow \quad 20+20n = 80+10n \notag\]

    All we have to do is solve for \(n\), finding that a \(n = 6\) day trip will result in equal costs. Wait...did that process seem familiar somehow? Let's graph these functions and see if we notice anything.

    petlines.png

    Oh duh, finding that \(n\)-value that yields equal costs is just finding the point of intersection of these two lines!

    Exercise \(\PageIndex{2}\)

    My younger cousin and I are having a foot race. To be fair, I let her starting line be 15 feet ahead of my starting line. We start sprinting at the same time, and my speed is 15 feet per second, while hers is 10 ft/s. Write a function for each of us, giving our positions as a function of time after the clock starts. At what time will I catch up to her? Graph both functions.

    Answer

    Let's say that my starting line is position zero. Then my cousin is starting at a position value of \(15\). It doesn't matter what you name your functions...I guess I'll use \(X_m\) for my position and \(X_c\) for my cousin's. Then \( X_m(t) = 0 + 15t \) and \( X_c(t) = 15 + 10t \).

    The question of when I will catch up is asking, "At what time value will our positions be equal?" Whoop, just an intersection problem again. You should get \(t = 3\) seconds. Finally, your graph should look like this:

    racelines.png

    Example \(\PageIndex{3}\)

    At time \(t = 0\), an object is dropped from the top of a skyscraper and falls freely under the influence of gravity. The table below gives the velocity and height values at different times. Determine in this scenario whether velocity is a linear function of time, and whether position is a linear function of time. If one or both is a linear function, write the function in standard form.

    \(t\) in seconds \( v(t) \) in meters/second \( h(t) \) in meters
    0 0 50
    0.5 -4.9 48.775
    1 -9.8 45.1
    1.5 -14.7 38.975
    2 -19.6 30.4
    2.5 -24.5 19.375
    3 -29.4 5.9
    Solution

    One thing we could do here is plot these data points on a coordinate plane and try to visually identify whether they lie on a straight line. Let's do that at the end to confirm our answer, but not rely on that strategy, because in real life like this, the numbers are kinda gross. Instead, let's use the fun fact that linear functions have constant rates of change. Let's try computing rate of change for \(v(t)\) and \( h(t)\) using different pairs of numbers, and see if either of them have a single consistent answer. For these calculations, feel free to use a calculator since the numbers aren't cooked.

    First, let's check out \( v(t)\)... Choosing the data points \( (0,0)\) and \( (0.5, -4.9) \), we do a quick slope calculation

    \[ \frac{ v(0.5) - v(0)}{0.5 - 0} = \frac{ -4.9 - 0}{0.5} = \frac{ -4.9}{0.5} = -9.8 \notag\]

    of the rate of change of \(v(t)\) between those points. Picking another pair, say, \( (1.5, -14.7) \) and \( (3, -29.4) \), we get

    \[ \frac{ v(3) - v(1.5)}{3 - 1.5} = \frac{-29.4 -( -14.7)}{1.5} = \frac{ -14.7}{1.5} = -9.8 \notag\]

    Oh interesting, that's the same... You can check some more pairs of points, but any time you do this slope-esque rate of change calculation, you will get a constant \(-9.8\)! That indicates that \(v(t)\) is a linear function here. It must have a form something like \( v(t) = a_1 t + a_0 \). We know that the constant slope IS the rate of change, so that value can go in for \(a_1\). How can we find \(a_0\)? Notice that when \(t = 0,\) the table says \( v(0) = 0\). So we should be able to plug in \(0\) to the function and get the initial velocity we want.

    \[ v(0) = -9.8(0) + a_0 = a_0 \quad \rightarrow \quad \text{ since } v(0) = 0, \text{ we must have } a_0 = 0. \notag\]

    We update our velocity function to be \( v(t) = -9.8t \).

    Okay, now let's check \( h(t)\)... With the data points \( (0,50)\) and \( (1,45.1)\), we calculate a rate of change of

    \[ \frac{ h(1)-h(0)}{1-0} = \frac{ 45.1 - 50}{1-0} = -4.9 \notag\]

    but if we use another pair of points, say \( (0,50) \) and \( (3, 5.9) \), we get

    \[ \frac{ h(3) - h(0)}{3 - 0} = \frac{ 5.9 - 50}{3} = \frac{-44.1}{3} = -14.7 \notag\]

    That's a different number! This position function \(h(t)\) does not have constant rate of change, so it must not be a linear function. The graph below shows some of the data points for \(h(t)\), and you can see that they lie on a curve rather than a straight line. In fact, the function for height is \(h(t) = 50-4.9t^2\), as you may know from studying physics. Since the independent variable \(t\) appears squared, this is indeed NOT a linear function.

    heigh.png

    On the other hand, the data points for velocity certainly lie on the straight line whose function we found.

    vel.png

    Exercise \(\PageIndex{3}\)

    The table below gives the perimeters and areas of squares with various side lengths. Determine whether perimeter is a linear function of side length, and whether area is a linear function of side length. If one or both is a linear function, write the function in standard form.

    \(x\) in inches \( P(x) \) in inches \( A(x) \) in square inches
    1 4 1
    2 8 4
    3 12 9
    4 16 16
    5 20 25
    Answer

    With any pair of data points chosen, the rate of change of \(P(x)\) should turn out to be \(4\). With a constant rate of change, we have a linear function, \( P(x) = 4x\). On the other hand, calculating rate of change of \(A(x)\) with different choices of points yields a variety of answers. In fact, you already know how area depends on side length for a square! \(A(x) = x^2\), which is clearly not a linear function at all, because the \(x\) appears to the second power.

    Check out the exercises section for more practice with identifying, setting up, and using linear functions!


    This page titled 5.1 Linear Functions and Rate of Change is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Lydia de Wolf.

    • Was this article helpful?