Skip to main content
Mathematics LibreTexts

12.5: Linear Models

  • Page ID
    248098
  • \( \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{\longvect}{\overrightarrow}\)

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

    \(\newcommand{\ket}[1]{\left| #1 \right>}\)
    \(\newcommand{\bra}[1]{\left< #1 \right|}\)
    \(\newcommand{\braket}[2]{\left< #1 \vphantom{#2} \right| \left. #2 \vphantom{#1} \right>}\)
    \(\newcommand{\braopket}[3]{\left< #1 \vphantom{#2}\vphantom{#3} \right| #2 \vphantom{#1}\vphantom{#3} \left| #3 \vphantom{#1}\vphantom{#2} \right>}\)
    \(\newcommand{\qmvec}[1]{\mathbf{\vec{#1}}}\)
    \(\newcommand{\op}[1]{\hat{\mathbf{#1}}}\)
    \(\newcommand{\expect}[1]{\langle #1 \rangle}\)
    \(\newcommand{\dfn}[1]{\emph{\textbf{#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}\)

    Videos

    Lecture: Building and Using Linear Models (level = intermediate algebra)

    Example: Find the Equation for a Linear Model Given a Line Graph (level = intermediate algebra)

    Example: Building and Using Linear Models (level = intermediate algebra)

    Example: Creating a Linear Model for Cell Phone Plan Costs (level = intermediate algebra)

    Example: Creating a Linear Model for Credit Card Payments (level = intermediate algebra)

    Definitions and Theorems

    Definition: Linear Function

    A linear function is a function that can be written in the form \(f(x)=mx+b\), where \(m\) and \(b\) are real constants. The graph of a linear function is a straight line.

    Definition: Linear Model

    A linear model is a linear function \(f(x)=mx+b\) used to describe a real-world quantity that changes at a constant rate. The coefficient \(m\) is the rate of change of the quantity per one-unit increase in \(x\), and the constant \(b=f(0)\) is the initial value of the quantity.

    Definition: Slope

    The slope of the line through two distinct points \((x_1,y_1)\) and \((x_2,y_2)\) is\[m=\dfrac{y_2-y_1}{x_2-x_1},\nonumber\]provided \(x_1\neq x_2\). For a linear model, the slope is the constant rate of change of the output with respect to the input.

    Theorem: Slope-Intercept Form

    The graph of the linear function \(f(x)=mx+b\) is the line whose slope is \(m\) and whose \(y\)-intercept is the point \((0,b)\).

    Theorem: Point-Slope Form

    The line with slope \(m\) passing through the point \((x_1,y_1)\) is the set of all points \((x,y)\) satisfying\[y-y_1=m(x-x_1).\nonumber\]

    Interpreting the Slope

    When a linear model \(f(x)=mx+b\) describes a real quantity, the slope \(m\) carries units of output per one unit of input. A positive slope means the quantity increases as \(x\) increases; a negative slope means it decreases. The intercept \(b\) is the value of the quantity at \(x=0\).

    Caution: Constant Rate Assumption

    A linear model assumes the rate of change stays constant. Predictions made far outside the range of inputs for which this assumption holds may be unreliable, and the initial value \(b=f(0)\) is meaningful only when \(x=0\) lies within a sensible domain for the situation.

    Examples

    Example \(\PageIndex{1}\): Writing a Cost Model

    A bakery has fixed daily costs of $40 and spends $2 in ingredients on each loaf of bread it produces. Write a linear model for the bakery's total daily cost as a function of the number of loaves produced, and identify the slope and the intercept.

    Solution

    Let \(n\) represent the number of loaves produced in a day, and let \(f(n)\) represent the total daily cost, in dollars. Each loaf adds a constant $2 to the cost, so the rate of change is \(m=2\); the $40 fixed cost is incurred even when no loaves are made, so the initial value is \(b=40\). Therefore\[f(n)=2n+40.\nonumber\]The slope \(m=2\) is the cost per loaf (dollars per loaf), and the intercept \(b=40\) is the fixed daily cost—the cost when \(n=0\).

    Example \(\PageIndex{2}\): A Distance Model

    A car begins a trip 20 miles from home and drives directly away from home at a constant 55 miles per hour. Write a linear model for the car's distance from home as a function of time, then find its distance from home after 3 hours.

    Solution

    Let \(t\) represent the time traveled, in hours, and let \(f(t)\) represent the distance from home, in miles. The car starts \(20\) miles from home, so \(b=20\); it moves away at a constant \(55\) miles per hour, so \(m=55\). Thus\[f(t)=55t+20.\nonumber\]After \(3\) hours,\[f(3)=55(3)+20=165+20=185.\nonumber\]The car is \(185\) miles from home.

    Example \(\PageIndex{3}\): Straight-Line Depreciation

    A company purchases equipment for $18,000. Using straight-line depreciation, the equipment loses a fixed $1,500 of value each year. Write a linear model for the value of the equipment as a function of its age, find its value after 4 years, and determine when its value reaches $0.

    Solution

    Let \(t\) represent the age of the equipment, in years, and let \(f(t)\) represent its value, in dollars. The initial value is \(b=18000\), and the value decreases by $1,500 per year, so the rate of change is \(m=-1500\). Thus\[f(t)=-1500t+18000.\nonumber\]After \(4\) years,\[f(4)=-1500(4)+18000=-6000+18000=12000,\nonumber\]so the equipment is worth $12,000.

    The value reaches $0 when \(f(t)=0\):\[-1500t+18000=0 \implies 1500t=18000 \implies t=12.\nonumber\]The equipment is fully depreciated after \(12\) years.

    Graph showing a diagonal line from point (0, 18000) to (12, 6) on a V-t graph with labeled axes.
    Figure \(\PageIndex{1}\): The graph of \(V = f(t)=-1500t+18000\) on \(0\le t\le 12\).
    Example \(\PageIndex{4}\): Interpreting a Model in Context

    A gym charges a one-time sign-up fee plus a fixed monthly rate. The total amount a member has paid after \(x\) months is modeled by\[f(x)=25x+50,\nonumber\]where \(f(x)\) is measured in dollars. Interpret the slope and the intercept in the context of the situation.

    Solution

    The slope is \(m=25\). Because the input \(x\) is measured in months and the output in dollars, the slope has units of dollars per month; it represents the monthly rate of $25 charged to the member. The intercept is \(b=50\), the value of \(f\) when \(x=0\). Since no months have passed at \(x=0\), this $50 is the one-time sign-up fee charged at the start of the membership.

    Example \(\PageIndex{5}\): Building a Model from Two Data Points

    A plumber charges a fixed service fee plus an hourly rate. A job lasting 2 hours costs $190, and a job lasting 5 hours costs $340. Assuming the charge is a linear function of the number of hours worked, find the model and interpret its slope and intercept.

    Solution

    Let \(t\) represent the number of hours worked, and let \(f(t)\) represent the total charge, in dollars. The two given jobs correspond to the points \((2,190)\) and \((5,340)\). The slope is the rate of change between these points:\[m=\dfrac{340-190}{5-2}=\dfrac{150}{3}=50.\nonumber\]To find the intercept, substitute one point into \(f(t)=50t+b\); using \((2,190)\),\[190=50(2)+b \implies 190=100+b \implies b=90.\nonumber\]Therefore\[f(t)=50t+90.\nonumber\]The slope \(m=50\) is the hourly rate ($50 per hour), and the intercept \(b=90\) is the fixed service fee—the charge for a job of \(0\) hours. As a check, \(f(5)=50(5)+90=340\), which matches the second data point.

    Example \(\PageIndex{6}\): Comparing Two Models

    A car-rental company offers two plans. Plan A charges a $30 flat fee plus $0.20 per mile. Plan B charges a $50 flat fee plus $0.10 per mile. Write a linear model for each plan, and determine the number of miles at which the two plans cost the same.

    Solution

    Let \(x\) represent the number of miles driven, and let \(f(x)\) and \(g(x)\) represent the cost, in dollars, of Plan A and Plan B respectively. Plan A has initial value \(30\) and rate \(0.20\), and Plan B has initial value \(50\) and rate \(0.10\):\[f(x)=0.20x+30, \qquad g(x)=0.10x+50.\nonumber\]The plans cost the same when \(f(x)=g(x)\):\[0.20x+30=0.10x+50 \implies 0.10x=20 \implies x=200.\nonumber\]At \(x=200\) miles, both plans cost\[f(200)=0.20(200)+30=70\nonumber\]dollars. For fewer than \(200\) miles Plan A is cheaper; for more than \(200\) miles Plan B is cheaper.

    Graph showing two intersecting lines labeled C, with a red point indicating the coordinates (200, 70) on the x-y axis.
    Figure \(\PageIndex{2}\): The graphs of \(f(x)=0.20x+30\) (blue) and \(g(x)=0.10x+50\) (green) on \(0\le x\le 400\), two lines intersecting at the point \((200,70)\).

    MyOpenMath Practice


    Sources

    Several parts of this text use modifications from the following source:

    This source is released under the Creative Commons Attribution-Share-Alike License 4.0.


    This page titled 12.5: Linear Models was last modified on Mon, 02 Nov 2026 20:17:18 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Kristine Woods.