---
title: "Linear and Affine Functions"
book: "Primary & Middle School Mathematics"
subject: math
language: en
chapter: 67
exercises: 10
source: https://one-course.com/books/math/1/en/chapter/67-linear-and-affine-functions
---

# Chapter 67 — Linear and Affine Functions

“Three kilograms cost three times as much as one”: that is [proportionality](#def-g9-linfunc-linear), the simplest way two quantities can be related. [Linear functions](#def-g9-linfunc-linear) are [proportionality](#def-g9-linfunc-linear) in the language of functions; [affine functions](#def-g9-linfunc-affine) add a fixed starting amount. Their graphs are straight lines, and reading those lines is the skill this chapter builds.

## 67.1 Proportionality and linear functions

**Definition 67.1 (Linear function).**

A *linear function* multiplies every number by a fixed number $a$:

$$
f(x) = a x .
$$

The number $a$ is the *coefficient* of $f$. Two quantities are *proportional* exactly when one is a linear function of the other.

**Example 67.2.**

If apples cost $3$ per kilogram, the price of $x$ kilograms is $f(x) = 3x$: buying twice as much costs twice as much, and the price of $2.5$ kg is $f(2.5) = 7.5$.

Conversely, if a [linear function](#def-g9-linfunc-linear) satisfies $f(4) = 10$, then $a = \frac{10}{4} = 2.5$ and $f(x) = 2.5x$: *one value determines a [linear function](#def-g9-linfunc-linear) completely.*

**Proposition 67.3 (Graph of a linear function).**

The graph of $f(x) = ax$ is a straight line *through the origin*. Conversely, every non-vertical line through the origin is the graph of a [linear function](#def-g9-linfunc-linear).

**Proof.** *Admitted at this level.* ∎

![Two linear functions: both graphs pass through the origin; the coefficient a is the height reached at x = 1.](https://one-course.com/images/onecourse/chapters/math-1/g9-linfunc/fig-08e8aadc66eb.svg)

*Two [linear functions](#def-g9-linfunc-linear): both graphs pass through the origin; the coefficient $a$ is the height reached at $x = 1$.*

## 67.2 Affine functions

**Definition 67.4 (Affine function).**

An *affine function* has the form

$$
f(x) = a x + b ,
$$

where $a$ and $b$ are fixed numbers. [Linear functions](#def-g9-linfunc-linear) are the special case $b = 0$; constant functions the case $a = 0$.

**Example 67.5.**

A gym charges a registration fee of $20$, then $5$ per visit: the total cost of $x$ visits is $f(x) = 5x + 20$. The cost is *not* [proportional](#def-g9-linfunc-linear) to the number of visits (10 visits do not cost twice as much as 5), but each extra visit adds the same amount, $5$.

**Proposition 67.6 (Graph of an affine function).**

The graph of $f(x) = ax + b$ is a straight line:

- $b = f(0)$ is the *$y$-intercept* : the line crosses the vertical axis at $(0, b)$ ;
- $a$ is the *slope* : moving one unit to the right moves $a$ units up (down if $a < 0$ ); the function is increasing when $a > 0$ , decreasing when $a < 0$ ;
- for any two inputs $u \neq v$ , $a = \dfrac{f(v) - f(u)}{v - u}$ .

**Proof of the last point.** $f(v) - f(u) = (av + b) - (au + b) = a(v - u)$; divide by $v - u$. The rest is admitted at this level (the High School volume gives a full treatment of lines and their [equations](https://one-course.com/books/math/1/en/chapter/57-literal-calculation-and-equations#def-g8-equations-def)). ∎

![Reading y = ax + b on its graph: the line crosses the y-axis at height b, and climbs a for each unit step to the right (here a = 1, b = 1).](https://one-course.com/images/onecourse/chapters/math-1/g9-linfunc/fig-01bf255d3837.svg)

*Reading $y = ax + b$ on its graph: the line crosses the $y$-axis at height $b$, and climbs $a$ for each unit step to the right (here $a = 1$, $b = 1$).*

**Method 67.7 (Finding an affine function from two values).**

Given $f(u)$ and $f(v)$ with $u \neq v$:

1. compute the [slope](#prop-g9-linfunc-affinegraph) $a = \dfrac{f(v) - f(u)}{v - u}$ ;
2. substitute one of the two known values into $f(x) = ax + b$ to find $b$ ;
3. check with the other value.

**Example 67.8.**

Find the [affine function](#def-g9-linfunc-affine) with $f(2) = 7$ and $f(5) = 16$.

$$
a = \frac{16 - 7}{5 - 2} = \frac93 = 3 ,
$$

then $f(2) = 3 \times 2 + b = 7$ gives $b = 1$: $f(x) = 3x + 1$. Check: $f(5) = 15 + 1 = 16$.

## 67.3 Percentages

**Proposition 67.9 (Percentage change).**

Increasing a quantity by $t\,\%$ multiplies it by $1 + \dfrac{t}{100}$; decreasing it by $t\,\%$ multiplies it by $1 - \dfrac{t}{100}$. Percentage changes are [linear functions](#def-g9-linfunc-linear).

**Proof.** Increasing $x$ by $t\,\%$ means adding $\frac{t}{100}\,x$:

$$
x + \frac{t}{100}\,x = \left(1 + \frac{t}{100}\right) x .
$$

Same computation with a minus sign for a decrease. ∎

**Example 67.10.**

A price of $80$ increases by $15\%$: new price $80 \times 1.15 = 92$. A price of $60$ decreases by $30\%$: $60 \times 0.7 = 42$.

*Chaining changes multiplies the factors.* A $20\%$ increase followed by a $20\%$ decrease gives $1.2 \times 0.8 = 0.96$: a $4\%$ *decrease* overall, not a return to the start!

## 67.4 Exercises

**Exercise 67.1 ★.**

Among these functions, which are linear? affine? neither?

$$
f(x) = 4x, \qquad
g(x) = 3x - 5, \qquad
h(x) = x^2, \qquad
k(x) = -\tfrac x2, \qquad
m(x) = 7 .
$$

**Solution of Exercise 67.1.**

Linear: $f$ and $k$ (form $ax$). Affine but not linear: $g$ ([slope](#prop-g9-linfunc-affinegraph) $3$, intercept $-5$) and $m$ (constant, [slope](#prop-g9-linfunc-affinegraph) $0$). Neither: $h$, because of the square.

**Exercise 67.2 ★.**

Let $f(x) = 2x - 3$. Compute $f(0)$, $f(4)$, $f(-1)$, and find the number $x$ such that $f(x) = 9$.

**Solution of Exercise 67.2.**

$f(0) = -3$; $f(4) = 5$; $f(-1) = -5$. And $f(x) = 9$ means $2x - 3 = 9$, so $2x = 12$ and $x = 6$.

**Exercise 67.3 ★.**

A [linear function](#def-g9-linfunc-linear) satisfies $f(6) = 15$. Find its coefficient, then compute $f(10)$ and $f(-2)$.

**Solution of Exercise 67.3.**

$a = \frac{15}{6} = 2.5$, so $f(x) = 2.5x$. Then $f(10) = 25$ and $f(-2) = -5$.

**Exercise 67.4 ★.**

Draw on the same coordinate system the graphs of $f(x) = 2x$, $g(x) = 2x + 3$ and $h(x) = -x + 4$. What can be said about the graphs of $f$ and $g$?

**Solution of Exercise 67.4.**

$f$ passes through the origin with [slope](#prop-g9-linfunc-affinegraph) $2$; $g$ has the same [slope](#prop-g9-linfunc-affinegraph) but crosses the $y$-axis at $3$; $h$ decreases from $(0, 4)$ with [slope](#prop-g9-linfunc-affinegraph) $-1$. The graphs of $f$ and $g$ are *[parallel lines](https://one-course.com/books/math/1/en/chapter/40-lines-circles-and-angles#def-g6-lines-perp)* (same [slope](#prop-g9-linfunc-affinegraph), different intercepts).

**Exercise 67.5 ★.**

Find the [affine function](#def-g9-linfunc-affine) such that $f(1) = 5$ and $f(3) = 11$; then the one such that $g(0) = 4$ and $g(2) = 0$.

**Solution of Exercise 67.5.**

For $f$: [slope](#prop-g9-linfunc-affinegraph) $\frac{11 - 5}{3 - 1} = 3$, then $5 = 3 \times 1 + b$ gives $b = 2$: $f(x) = 3x + 2$.

For $g$: [slope](#prop-g9-linfunc-affinegraph) $\frac{0 - 4}{2 - 0} = -2$, and $g(0) = 4$ is already the intercept: $g(x) = -2x + 4$.

**Exercise 67.6 ★★.**

Compute: the price after a $25\%$ increase on $120$; the price after a $40\%$ discount on $65$; the original price if an article costs $69$ after a $25\%$ discount.

**Solution of Exercise 67.6.**

Increase of $25\%$: $120 \times 1.25 = 150$.

Discount of $40\%$: $65 \times 0.6 = 39$.

Original price $p$ with $p \times 0.75 = 69$: $p = \frac{69}{0.75} = 92$.

**Exercise 67.7 ★★.**

A phone plan A costs $10$ per month plus $0.05$ per minute of calls; plan B costs $25$ per month with unlimited calls.

1. Express the monthly cost of plan A as a function of the number $x$ of minutes.
2. From how many minutes per month is plan B cheaper?

**Solution of Exercise 67.7.**

*1.* $f(x) = 0.05x + 10$.

*2.* Plan B is cheaper when $25 < 0.05x + 10$, i.e. $15 < 0.05x$, i.e. $x > 300$. From $301$ minutes ($5$ hours) per month onward, plan B wins.

**Exercise 67.8 ★★.**

A population of $2000$ bacteria increases by $10\%$ every hour.

1. How many bacteria are there after one hour? After two hours?
2. Explain why the answer after two hours is not $2400$ .

**Solution of Exercise 67.8.**

*1.* After one hour: $2000 \times 1.1 = 2200$. After two hours: $2200 \times 1.1 = 2420$.

*2.* The second increase applies to $2200$, not to $2000$: growing by $10\%$ twice multiplies by $1.1^2 = 1.21$, a $21\%$ increase, not $20\%$.

**Exercise 67.9 ★★.**

The graph of an [affine function](#def-g9-linfunc-affine) passes through the points $(2, 3)$ and $(6, 1)$.

1. Compute its [slope](#prop-g9-linfunc-affinegraph) . Is the function increasing or decreasing?
2. Give its expression, and compute the input for which the output is $0$ .

**Solution of Exercise 67.9.**

*1.* [Slope](#prop-g9-linfunc-affinegraph): $\frac{1 - 3}{6 - 2} = \frac{-2}{4} = -0.5$: the function is decreasing.

*2.* $f(x) = -0.5x + b$ with $f(2) = 3$: $-1 + b = 3$, so $b = 4$ and $f(x) = -0.5x + 4$. Output $0$: $-0.5x + 4 = 0$ gives $x = 8$.

**Exercise 67.10 ★★★.**

A shop first raises a price by $t\,\%$, then lowers the new price by $t\,\%$.

1. Show that the final price equals the original multiplied by $1 - \dfrac{t^2}{10000}$ .
2. Deduce that the final price is always *lower* than the original (for $0 < t \leq 100$ ), and find the overall percentage change for $t = 10$ .

**Solution of Exercise 67.10.**

*1.* The two changes multiply the price by

$$
\left(1 + \frac{t}{100}\right)\left(1 - \frac{t}{100}\right)
= 1 - \frac{t^2}{10000}
$$

(third identity with $a = 1$, $b = \frac{t}{100}$).

*2.* For $0 < t \leq 100$, $\frac{t^2}{10000} > 0$, so the factor is less than $1$: the final price is lower than the original. For $t = 10$: factor $1 - \frac{100}{10000} = 0.99$, i.e. an overall decrease of $1\%$.

## 67.5 Problem: The two thermometers

**Problem 67.1.**

Weekend problem — Celsius, Fahrenheit and the affine functions of daily life: one temperature reads the same on both scales, and constant slope is the signature of straightness

Americans hear “$68$ degrees” and dress lightly; Europeans hear it and grab a coat. The two thermometers of the world are linked by an [affine function](#def-g9-linfunc-affine) — and building it from two facts is exactly the skill of [Method 67.7](#met-g9-linfunc-findaffine). This problem constructs the conversion, finds the eerie temperature at which the two [scales](https://one-course.com/books/math/1/en/chapter/49-proportionality#def-g7-prop-scale) agree, then reads taxis, crickets and candles with the same pair of glasses, and ends with the test that recognizes straightness itself.

**Part I — Building the conversion.** Two facts pin the Fahrenheit [scale](https://one-course.com/books/math/1/en/chapter/49-proportionality#def-g7-prop-scale): water freezes at $32\,^\circ$F and boils at $212\,^\circ$F (at $0\,^\circ$C and $100\,^\circ$C).

1. Find the [affine function](#def-g9-linfunc-affine) $F = f(C)$ converting Celsius into Fahrenheit ( [Method 67.7](#met-g9-linfunc-findaffine) with the values $f(0) = 32$ and $f(100) = 212$ ).
2. Convert to Fahrenheit: a mild $20\,^\circ$ C day; the body’s $37\,^\circ$ C; a freezing $-10\,^\circ$ C.
3. Solve for $C$ to build the return conversion, and use it on $50\,^\circ$ F and on $98.6\,^\circ$ F.
4. Is $f$ a *linear* function ( [Definition 67.1](#def-g9-linfunc-linear) )? Test the tell-tale signs: what is $f(0)$ , and does doubling the Celsius reading double the Fahrenheit one? Conclude with the right word ( [Definition 67.4](#def-g9-linfunc-affine) ).
5. The classic riddle: is there a temperature that reads *the same number* on both [scales](https://one-course.com/books/math/1/en/chapter/49-proportionality#def-g7-prop-scale) ? Solve $f(x) = x$ , and describe what your solution means on the graph of $f$ (which line does the graph cross there?).

**Part II — [Affine functions](#def-g9-linfunc-affine) in the wild.**

6. Taxi A charges $3$ euros plus $1.50$ per km; taxi B charges a flat $2$ euros per km. Write the two price functions and compare them for a $4$ km ride and an $8$ km ride.
7. Find the [break-even](https://one-course.com/books/math/1/en/chapter/14-numbers-up-to-10-000#def-g3-numbers-evenodd) distance at which the two taxis cost the same, and describe the situation on a graph (two lines — what happens at the crossing point, before it, after it?).
8. Naturalists’ rule of thumb: a cricket chirps about $N = 7T - 30$ times per minute at temperature $T\,^\circ$ C. How many chirps on a $20\,^\circ$ C evening? You count $82$ chirps in a minute: what temperature does the cricket announce?
9. A phone bought $600$ euros loses value by $15$ euros per month: write the value function $v(t)$ , find when the phone is worth $240$ euros, and when the model says it is worth nothing. Does the formula still mean anything after that date?
10. Percentage moves are [linear functions](#def-g9-linfunc-linear) : $+25\,\%$ is multiplication by $1.25$ , and $-20\,\%$ by $0.8$ ( [Proposition 67.9](#prop-g9-linfunc-percent) ). Compose them: what does a $+25\,\%$ rise followed by a $-20\,\%$ cut do to a price? Explain the little miracle, and compare with [Exercise 67.10](#exo-g9-linfunc-10) .

**Part III — The [slope](#prop-g9-linfunc-affinegraph) is everything.**

11. A candle measures $20$ cm when lit and $17$ cm [half](https://one-course.com/books/math/1/en/chapter/17-sharing-and-division#def-g3-division-half) an hour later. Assuming affine melting, find $h(t)$ (height in cm, $t$ in minutes), and predict when the candle dies.
12. Two cyclists ride the same road: the first’s distance is $d_1(t) = 24t$ (km after $t$ hours), the second’s is $d_2(t) = 10 + 18t$ . Who started with a head start, who rides faster, and at what time and kilometer does the first catch the second?
13. Let $f(x) = 2x + 3$ and $g(x) = -0.5x + 7$ . Compute $f(x) + g(x)$ and check it is affine again. What are the [slope](#prop-g9-linfunc-affinegraph) and intercept of a [sum](https://one-course.com/books/math/1/en/chapter/2-addition-first-steps#def-g1-addition-def) , in general?
14. Discuss completely the [equation](https://one-course.com/books/math/1/en/chapter/57-literal-calculation-and-equations#def-g8-equations-def) $mx + p = 0$ : how many solutions when $m \neq 0$ (and which one)? When $m = 0$ and $p \neq 0$ ? When $m = 0$ and $p = 0$ ? (Every case has a graph story: where does a line of [slope](#prop-g9-linfunc-affinegraph) $m$ cross the horizontal axis?)
15. The alignment test: are the points $(1, 5)$ , $(3, 9)$ , $(7, 17)$ on one straight line? Are $(1, 5)$ , $(3, 9)$ , $(6, 16)$ ? Compute rates of change between pairs and decide. State the moral: a *constant rate of change* is the signature of [affine functions](#def-g9-linfunc-affine) — curved graphs change their rate, and measuring *that* is a story for the High School volume.

**Solution of Problem 67.1.**

**1.** [Slope](#prop-g9-linfunc-affinegraph): $\frac{f(100) - f(0)}{100 - 0} =
\frac{212 - 32}{100} = 1.8$; intercept $f(0) = 32$. Hence

$$
f(C) = 1.8\,C + 32 .
$$

**2.** $f(20) = 68\,^\circ$F (the famous mild day); $f(37) = 98.6\,^\circ$F; $f(-10) = 14\,^\circ$F.

**3.** From $F = 1.8C + 32$: $C = \frac{F - 32}{1.8}$. Then $50\,^\circ$F $\to \frac{18}{1.8} = 10\,^\circ$C, and $98.6\,^\circ$F $\to \frac{66.6}{1.8} = 37\,^\circ$C.

**4.** $f(0) = 32 \neq 0$, and $f(20) = 68$ is not the double of $f(10) = 50$: not linear. The graph is a straight line missing the origin: $f$ is *affine*, not linear.

**5.** $1.8x + 32 = x$ gives $0.8x = -32$, so $x = -40$: at forty below, both thermometers read $-40$. On the graph, the line of $f$ crosses the diagonal line $y = x$ exactly there.

**6.** $p_A(k) = 1.5k + 3$ and $p_B(k) = 2k$. For $4$ km: $9$ euros against $8$: B cheaper. For $8$ km: $15$ against $16$: A cheaper.

**7.** $1.5k + 3 = 2k$ gives $k = 6$: at six kilometers both cost $12$ euros. Graphically, B’s line (through the origin, steeper) starts below A’s and crosses it at $(6, 12)$: B wins short rides, A wins long ones.

**8.** $N = 7 \times 20 - 30 = 110$ chirps per minute. From $82 = 7T - 30$: $T = \frac{112}{7} = 16\,^\circ$C.

**9.** $v(t) = 600 - 15t$. Worth $240$: $600 - 15t = 240$, $t = 24$ months. Worth $0$: $t = 40$ months. Beyond $40$ months the formula goes negative — but a phone’s value stops at [zero](https://one-course.com/books/math/1/en/chapter/1-counting-to-20#def-g1-counting-zero): every affine model has a domain where it makes sense.

**10.** Composing: $\times 1.25$ then $\times 0.8$ multiplies by $1.25 \times 0.8 = 1$: the price returns exactly to its start. No miracle: the percentages act on different references (the cut applies to the raised price), and here the multipliers happen to cancel — the general story, with its built-in loss $1 - \frac{t^2}{10\,000}$, is [Exercise 67.10](#exo-g9-linfunc-10).

**11.** [Slope](#prop-g9-linfunc-affinegraph): $\frac{17 - 20}{30} = -0.1$ cm per minute; $h(t) = 20 - 0.1t$. It dies at $h(t) = 0$: $t = 200$ minutes — three hours and twenty minutes of light.

**12.** The second started $10$ km ahead (intercept); the first is faster ($24 > 18$ km/h). Catch-up: $24t = 10 + 18t$ gives $6t = 10$, $t = \frac53$ h $= 1$ h $40$ min, at kilometer $24 \times \frac53 = 40$.

**13.** $f(x) + g(x) = (2 - 0.5)x + (3 + 7) = 1.5x + 10$: affine, with [slope](#prop-g9-linfunc-affinegraph) the *[sum](https://one-course.com/books/math/1/en/chapter/2-addition-first-steps#def-g1-addition-def) of the [slopes](#prop-g9-linfunc-affinegraph)* and intercept the [sum](https://one-course.com/books/math/1/en/chapter/2-addition-first-steps#def-g1-addition-def) of the intercepts — clear from collecting like terms in $(mx + p) + (m'x + p')$.

**14.** If $m \neq 0$: exactly one solution, $x = -\frac pm$ — a non-horizontal line crosses the axis once. If $m = 0$, $p \neq 0$: no solution — a horizontal line above or below the axis never touches it. If $m = 0$, $p = 0$: every $x$ is a solution — the line *is* the axis.

**15.** First triple: rates $\frac{9 - 5}{3 - 1} = 2$ and $\frac{17 - 9}{7 - 3} = 2$: equal, the points are aligned (on $y = 2x + 3$). Second triple: $\frac{9-5}{2} = 2$ but $\frac{16 - 9}{3} = \frac73 \neq 2$: not aligned. [Affine functions](#def-g9-linfunc-affine) are exactly those with a constant rate of change — one number, the [slope](#prop-g9-linfunc-affinegraph), tells the whole story; for curves the rate itself changes from point to point, and chasing it leads to the derivative, in the High School volume.
