Chapter 4 β Linear Functions
Linear functions are the simplest and most widely used type of function. They model any situation where there is a constant rate of change β from the speed of a car, to the cost of a subscription, to the depreciation of an asset. A deep understanding of linear functions is a gateway to all higher mathematics.
Table of Contents
1 β Linear Functions
- 1.1 What Is a Linear Function?
- 1.2 Slope as a Rate of Change
- 1.3 Increasing, Decreasing, and Constant Functions
- 1.4 Interpreting Slope and y-Intercept
- 1.5 Graphing a Linear Function
2 β Writing Linear Equations
- 2.1 Slope-Intercept Form
- 2.2 Point-Slope Form
- 2.3 Standard Form
- 2.4 Writing Equations from Two Points
- 2.5 Writing Equations from a Graph
3 β Parallel and Perpendicular Lines
- 3.1 Parallel Lines
- 3.2 Perpendicular Lines
- 3.3 Writing Equations of Parallel and Perpendicular Lines
4 β Modeling with Linear Functions
- 4.1 Building Linear Models from Words
- 4.2 Using a Diagram to Build a Model
- 4.3 Cost, Revenue, and Profit Models
5 β Fitting Linear Models to Data
Glossary
| Term | Definition |
|---|---|
| Linear function | A function of the form $f(x) = mx + b$ whose graph is a straight line |
| Slope | The ratio $m = \dfrac{\Delta y}{\Delta x}$ measuring steepness and direction |
| $y$-intercept | The point $(0, b)$ where the line crosses the $y$-axis |
| $x$-intercept | The point where $y = 0$; found by solving $0 = mx + b$ |
| Slope-intercept form | $y = mx + b$ |
| Point-slope form | $y - y_1 = m(x - x_1)$ |
| Standard form | $Ax + By = C$ where $A, B, C$ are integers and $A \ge 0$ |
| Parallel lines | Lines with the same slope ($m_1 = m_2$) that never intersect |
| Perpendicular lines | Lines whose slopes are negative reciprocals ($m_1 \cdot m_2 = -1$) |
| Scatter plot | A graph displaying paired data points on a coordinate plane |
| Line of best fit | The line that minimizes the sum of squared vertical distances from data points |
| Correlation coefficient ($r$) | A value in $[-1, 1]$ measuring the strength and direction of a linear relationship |
| Interpolation | Predicting values within the range of observed data |
| Extrapolation | Predicting values outside the range of observed data |
| Horizontal line | $y = c$ β slope is $0$ |
| Vertical line | $x = c$ β slope is undefined |
1 β Linear Functions
1.1 What Is a Linear Function?
Definition β Linear Function: A function $f$ is linear if it can be written as
\[f(x) = mx + b\]where $m$ and $b$ are real constants. Its graph is always a straight line.
The constant $m$ is the slope (rate of change), and $b$ is the $y$-intercept (the value of $f$ when $x = 0$).
Any equation that can be rearranged into $y = mx + b$ represents a linear function. Equations like $2x + 3y = 6$ are linear because solving for $y$ gives $y = -\tfrac{2}{3}x + 2$.
Not linear: $y = x^2$, $y = \sqrt{x}$, $y = \dfrac{1}{x}$, $y = 2^x$. These involve powers, roots, reciprocals, or exponentials β none produce straight-line graphs.
1.2 Slope as a Rate of Change
Definition β Slope: Given two points $(x_1, y_1)$ and $(x_2, y_2)$ on a line,
\(m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\Delta y}{\Delta x} = \frac{\text{rise}}{\text{run}}\)
Slope tells you how much $y$ changes for every 1-unit increase in $x$.
Example: Find the slope of the line through $(2, 3)$ and $(5, 9)$.
\[m = \frac{9 - 3}{5 - 2} = \frac{6}{3} = 2\]Interpretation: For every 1-unit increase in $x$, the $y$-value increases by 2.
Special slopes:
| Slope | Type | Graph behavior |
|---|---|---|
| $m > 0$ | Positive | Line rises left to right |
| $m < 0$ | Negative | Line falls left to right |
| $m = 0$ | Zero | Horizontal line ($y = b$) |
| $m$ undefined | Undefined | Vertical line ($x = a$, not a function) |
Common mistake: Swapping the order of subtraction. If you compute $\dfrac{y_2 - y_1}{x_2 - x_1}$, you must subtract in the same order in both numerator and denominator. Using $\dfrac{y_2 - y_1}{x_1 - x_2}$ gives the negative of the correct slope.
1.3 Increasing, Decreasing, and Constant Functions
For a linear function $f(x) = mx + b$:
- Increasing on $(-\infty, \infty)$ when $m > 0$
- Decreasing on $(-\infty, \infty)$ when $m < 0$
- Constant on $(-\infty, \infty)$ when $m = 0$
Unlike nonlinear functions (which can increase on some intervals and decrease on others), a linear function is globally increasing, decreasing, or constant β never a mix.
1.4 Interpreting Slope and y-Intercept
In real-world contexts, slope and intercept carry meaning:
Example: A gym charges a $50 enrollment fee plus $30 per month. The cost function is
\[C(m) = 30m + 50\]- Slope ($30$): Each additional month costs $30.
- $y$-intercept ($50$): The initial cost at month 0 (enrollment fee).
- $C(6) = 30(6) + 50 = 230$: After 6 months youβve paid $230 total.
Units of slope: Always βoutput units per input unit.β If $y$ is in dollars and $x$ is in months, then slope is βdollars per month.β
1.5 Graphing a Linear Function
Method 1 β Intercepts:
- Find the $y$-intercept: set $x = 0$, compute $y = b$. Plot $(0, b)$.
- Find the $x$-intercept: set $y = 0$, solve $0 = mx + b \Rightarrow x = -\tfrac{b}{m}$. Plot $\left(-\tfrac{b}{m}, 0\right)$.
- Draw the line through both points.
Method 2 β Slope + Point:
- Plot the $y$-intercept $(0, b)$.
- From that point, use slope $m = \dfrac{\text{rise}}{\text{run}}$: move rise units vertically and run units horizontally to get a second point.
- Draw the line.
Example: Graph $f(x) = -\dfrac{2}{3}x + 4$.
- $y$-intercept: $(0, 4)$.
- Slope $= -\dfrac{2}{3}$: from $(0, 4)$, go down 2, right 3 β $(3, 2)$.
- Draw a line through $(0, 4)$ and $(3, 2)$.
$x$-intercept: $0 = -\dfrac{2}{3}x + 4 \Rightarrow x = 6$. The line crosses the $x$-axis at $(6, 0)$. β
2 β Writing Linear Equations
2.1 Slope-Intercept Form
Slope-Intercept Form:
\[y = mx + b\]where $m$ is the slope and $b$ is the $y$-intercept.
This is the most common form. You can read $m$ and $b$ directly.
| Equation | Slope $m$ | $y$-intercept $b$ |
|---|---|---|
| $y = 3x - 7$ | $3$ | $-7$ |
| $y = -\tfrac{1}{2}x + 4$ | $-\tfrac{1}{2}$ | $4$ |
| $y = 5$ | $0$ | $5$ |
2.2 Point-Slope Form
Point-Slope Form: Given slope $m$ and a point $(x_1, y_1)$ on the line,
\(y - y_1 = m(x - x_1)\)
This is the most efficient form when you know one point and the slope (or two points, since you can compute slope first).
Example: Write the equation of the line through $(3, -2)$ with slope $4$.
\(y - (-2) = 4(x - 3)\) \(y + 2 = 4x - 12\) \(y = 4x - 14\)
2.3 Standard Form
Standard Form:
\[Ax + By = C\]where $A$, $B$, $C$ are integers and $A \ge 0$ (by convention).
Advantages of standard form:
- Easy to find both intercepts: set $y = 0$ gives $x = C/A$; set $x = 0$ gives $y = C/B$.
- Naturally handles vertical lines ($x = c$), which slope-intercept cannot express.
Example: Convert $y = \dfrac{3}{4}x - 2$ to standard form.
Multiply through by 4: $4y = 3x - 8$
Rearrange: $-3x + 4y = -8$
Multiply by $-1$ (to make $A > 0$): $3x - 4y = 8$
Standard form: $3x - 4y = 8$.
2.4 Writing Equations from Two Points
Steps:
- Compute the slope: $m = \dfrac{y_2 - y_1}{x_2 - x_1}$
- Use point-slope form with either point: $y - y_1 = m(x - x_1)$
- Simplify to desired form.
Example: Find the equation of the line through $(1, 5)$ and $(4, -1)$.
Step 1: $m = \dfrac{-1 - 5}{4 - 1} = \dfrac{-6}{3} = -2$
Step 2: $y - 5 = -2(x - 1)$
Step 3: $y = -2x + 2 + 5 = -2x + 7$
Answer: $y = -2x + 7$ β
2.5 Writing Equations from a Graph
- Identify two lattice points (points with integer coordinates) on the line.
- Calculate slope from those two points.
- Read the $y$-intercept from the graph (or use point-slope form).
- Write the equation.
If the graph clearly shows the $y$-intercept, just read $b$ from the graph and compute $m$ from any two points β then write $y = mx + b$ directly.
3 β Parallel and Perpendicular Lines
3.1 Parallel Lines
Parallel Lines: Two distinct lines are parallel if and only if they have the same slope.
\(\ell_1 \parallel \ell_2 \iff m_1 = m_2 \text{ (and } b_1 \ne b_2\text{)}\)
Parallel lines never intersect. They always maintain the same distance apart.
Example: Are the lines $y = 3x + 1$ and $6x - 2y = 10$ parallel?
Rewrite the second: $-2y = -6x + 10 \Rightarrow y = 3x - 5$.
Both slopes are $3$, and intercepts differ ($1 \ne -5$) β Yes, they are parallel. β
3.2 Perpendicular Lines
Perpendicular Lines: Two lines are perpendicular if and only if their slopes are negative reciprocals:
\(m_1 \cdot m_2 = -1 \qquad \text{or equivalently} \qquad m_2 = -\frac{1}{m_1}\)
Perpendicular lines intersect at a 90Β° angle.
| $m_1$ | $m_2$ (perpendicular) |
|---|---|
| $2$ | $-\tfrac{1}{2}$ |
| $-\tfrac{3}{4}$ | $\tfrac{4}{3}$ |
| $1$ | $-1$ |
| $\tfrac{1}{5}$ | $-5$ |
Special case: A horizontal line ($m = 0$) is perpendicular to a vertical line ($m$ undefined). The negative reciprocal rule doesnβt apply in the usual algebraic sense for this case β just remember horizontal β₯ vertical.
3.3 Writing Equations of Parallel and Perpendicular Lines
Example 1 β Parallel: Write the equation of the line through $(2, -3)$ parallel to $y = \tfrac{1}{2}x + 7$.
Parallel β same slope: $m = \tfrac{1}{2}$.
$y - (-3) = \tfrac{1}{2}(x - 2)$
$y + 3 = \tfrac{1}{2}x - 1$
$y = \tfrac{1}{2}x - 4$ β
Example 2 β Perpendicular: Write the equation of the line through $(6, 1)$ perpendicular to $y = -3x + 4$.
Perpendicular β negative reciprocal: $m = -\dfrac{1}{-3} = \dfrac{1}{3}$.
$y - 1 = \dfrac{1}{3}(x - 6)$
$y = \dfrac{1}{3}x - 2 + 1 = \dfrac{1}{3}x - 1$ β
4 β Modeling with Linear Functions
4.1 Building Linear Models from Words
Many real-world situations involve a constant rate of change. To build a model:
- Identify the variables: What is the input ($x$)? What is the output ($y$ or $f(x)$)?
- Find the rate of change (slope $m$) from the problem.
- Find the initial value ($y$-intercept $b$) β the value when $x = 0$.
- Write $f(x) = mx + b$.
Example: A plumber charges $45 for a service call plus $70 per hour of labor. Write a function for total cost $C(h)$ in terms of hours $h$.
- Slope $= 70$ (dollars per hour)
- $y$-intercept $= 45$ (initial call fee)
How much for 3 hours? $C(3) = 70(3) + 45 = 255$ dollars.
What does $C(0) = 45$ mean? Even with zero hours of labor, you pay the $45 service call fee.
4.2 Using a Diagram to Build a Model
Sometimes the relationship is embedded in a geometric or physical situation.
Example: A 300-gallon tank is being drained at 20 gallons per minute. Write a function for the volume $V(t)$ after $t$ minutes. When will the tank be empty?
- Initial value: $V(0) = 300$ β $b = 300$
- Rate of change: losing water β $m = -20$
When empty? Set $V(t) = 0$: $-20t + 300 = 0 \Rightarrow t = 15$ minutes.
Domain restriction: $0 \le t \le 15$ (volume canβt be negative).
4.3 Cost, Revenue, and Profit Models
These are classic business applications.
- Cost function: $C(x) = (\text{variable cost per unit}) \cdot x + (\text{fixed costs})$
- Revenue function: $R(x) = (\text{price per unit}) \cdot x$
- Profit function: $P(x) = R(x) - C(x)$
- Break-even point: where $P(x) = 0$, i.e., $R(x) = C(x)$
Example: A company produces widgets. Fixed costs are $2000/month. Each widget costs $5 to make and sells for $12.
\[C(x) = 5x + 2000, \quad R(x) = 12x\] \[P(x) = 12x - (5x + 2000) = 7x - 2000\]Break-even: $7x - 2000 = 0 \Rightarrow x \approx 286$ widgets.
The company must sell at least 286 widgets per month to avoid a loss.
Key insight: In linear cost/revenue models, profit is also linear. The slope of the profit function equals (price per unit) β (variable cost per unit), often called the contribution margin.
5 β Fitting Linear Models to Data
5.1 Scatter Plots
Scatter Plot: A graph with data points plotted as ordered pairs $(x, y)$ on a coordinate plane. Used to visualize relationships between two quantitative variables.
Patterns to look for:
- Linear (positive): Points cluster around a line sloping upward.
- Linear (negative): Points cluster around a line sloping downward.
- No linear pattern: Points are scattered with no discernible direction.
- Nonlinear: Points follow a curve (quadratic, exponential, etc.).
5.2 Line of Best Fit (Least-Squares Regression)
Least-Squares Regression Line: The line $\hat{y} = mx + b$ that minimizes the sum of the squared residuals:
\[\text{SSE} = \sum_{i=1}^{n} (y_i - \hat{y}_i)^2\]The formulas for slope and intercept are:
\[m = \frac{n \sum x_i y_i - \sum x_i \sum y_i}{n \sum x_i^2 - \left(\sum x_i\right)^2}\] \[b = \bar{y} - m\bar{x}\]where $\bar{x}$ and $\bar{y}$ are the means of the $x$- and $y$-values.
In practice, you use a calculator or software (Excel, Python, etc.) to compute this.
Example: Five studentsβ study hours and exam scores:
| Hours ($x$) | Score ($y$) |
|---|---|
| 1 | 55 |
| 2 | 60 |
| 3 | 70 |
| 4 | 75 |
| 5 | 85 |
$\bar{x} = 3$, $\bar{y} = 69$
$\sum x_i y_i = 1(55) + 2(60) + 3(70) + 4(75) + 5(85) = 55 + 120 + 210 + 300 + 425 = 1110$
$\sum x_i = 15$, $\sum y_i = 345$, $\sum x_i^2 = 55$
\[m = \frac{5(1110) - (15)(345)}{5(55) - 15^2} = \frac{5550 - 5175}{275 - 225} = \frac{375}{50} = 7.5\] \[b = 69 - 7.5(3) = 69 - 22.5 = 46.5\]Regression line: $\hat{y} = 7.5x + 46.5$
Interpretation: Each additional hour of study is associated with a 7.5-point increase in exam score. A student who studies 0 hours would be predicted to score 46.5 (the modelβs baseline).
5.3 Interpolation vs. Extrapolation
- Interpolation: Using the model to predict within the range of observed $x$-values. Generally reliable.
- Extrapolation: Using the model to predict outside the range of observed data. Can be highly unreliable.
Extrapolation danger: In the study-hours example ($x$ ranged 1β5), predicting the score for $x = 20$ hours gives $\hat{y} = 7.5(20) + 46.5 = 196.5$, which is impossible for a 100-point exam. Linear models break down outside their valid range.
5.4 Correlation Coefficient
Correlation Coefficient ($r$): A number in $[-1, 1]$ that measures the strength and direction of the linear relationship between $x$ and $y$.
\(r = \frac{n\sum x_i y_i - \sum x_i \sum y_i}{\sqrt{\left[n\sum x_i^2 - (\sum x_i)^2\right]\left[n\sum y_i^2 - (\sum y_i)^2\right]}}\)
Interpreting $r$:
| $r$ value | Meaning |
|---|---|
| $r = 1$ | Perfect positive linear relationship |
| $0.7 \le r < 1$ | Strong positive correlation |
| $0.3 \le r < 0.7$ | Moderate positive correlation |
| $0 < r < 0.3$ | Weak positive correlation |
| $r = 0$ | No linear correlation |
| $-1 < r < 0$ | Negative correlation (same strength scale) |
| $r = -1$ | Perfect negative linear relationship |
Coefficient of Determination ($r^2$): The fraction of the variation in $y$ that is explained by the linear model.
If $r = 0.9$, then $r^2 = 0.81$, meaning 81% of the variation in $y$ is explained by the linear relationship with $x$.
Correlation β Causation: A high $|r|$ does not imply that $x$ causes $y$. There may be confounding variables or coincidental patterns. Correlation measures association, not causation.
Key Takeaways
- Linear functions have the form $f(x) = mx + b$ β constant rate of change, straight-line graph.
- Slope $= \dfrac{\text{rise}}{\text{run}} = \dfrac{\Delta y}{\Delta x}$ tells you how much $y$ changes per unit increase in $x$.
- Three forms of linear equations serve different purposes:
- Slope-intercept ($y = mx + b$): easiest for graphing and reading slope/$y$-intercept.
- Point-slope ($y - y_1 = m(x - x_1)$): best when you know a point and slope.
- Standard form ($Ax + By = C$): useful for finding intercepts and handling vertical lines.
- Parallel lines have equal slopes; perpendicular lines have slopes that are negative reciprocals.
- Modeling: Look for constant rates of change in real-world problems β those are linear models.
- Line of best fit minimizes squared residuals; the correlation coefficient $r$ measures fit strength.
- Interpolation (within data range) is trustworthy; extrapolation (outside data range) is risky.
Practice Questions
Q1. Find the slope of the line passing through $(-3, 7)$ and $(5, -1)$.
Answer:
\(m = \frac{-1 - 7}{5 - (-3)} = \frac{-8}{8} = -1\)
Q2. Write the equation of the line with slope $-\dfrac{2}{5}$ passing through $(10, 3)$ in slope-intercept form.
Answer:
$y - 3 = -\dfrac{2}{5}(x - 10)$
$y - 3 = -\dfrac{2}{5}x + 4$
$y = -\dfrac{2}{5}x + 7$
Q3. Are the lines $4x - 6y = 12$ and $2x - 3y = 9$ parallel, perpendicular, or neither?
Answer:
Line 1: $-6y = -4x + 12 \Rightarrow y = \dfrac{2}{3}x - 2$, so $m_1 = \dfrac{2}{3}$.
Line 2: $-3y = -2x + 9 \Rightarrow y = \dfrac{2}{3}x - 3$, so $m_2 = \dfrac{2}{3}$.
$m_1 = m_2$ and intercepts differ β Parallel.
Q4. Write the equation of the line perpendicular to $y = 4x - 1$ that passes through $(8, 2)$.
Answer:
Perpendicular slope: $m = -\dfrac{1}{4}$
$y - 2 = -\dfrac{1}{4}(x - 8)$
$y = -\dfrac{1}{4}x + 2 + 2 = -\dfrac{1}{4}x + 4$
Q5. A car rental company charges $35 per day plus $0.15 per mile. Write a linear model for total cost $C(m)$ in terms of miles driven $m$ for a one-day rental. What is the cost for 200 miles?
Answer:
\(C(m) = 0.15m + 35\)
$C(200) = 0.15(200) + 35 = 30 + 35 = 65$ dollars.
Q6. Given the regression line $\hat{y} = -2.5x + 80$ fitted to data where $x$ ranges from 0 to 10, predict $y$ when $x = 7$. Is this interpolation or extrapolation?
Answer:
$\hat{y} = -2.5(7) + 80 = -17.5 + 80 = 62.5$
Since $x = 7$ is within the data range $[0, 10]$, this is interpolation.
Q7. If the correlation coefficient between two variables is $r = -0.85$, describe the relationship and find $r^2$.
Answer:
$r = -0.85$ indicates a strong negative linear relationship β as $x$ increases, $y$ tends to decrease.
$r^2 = (-0.85)^2 = 0.7225$
About 72.25% of the variation in $y$ is explained by the linear relationship with $x$.