Mathematics · Book 1 · Grades 1–9

Primary & Middle School Mathematics

Primary & Middle School Mathematics · Grades 1–9

67Linear and Affine Functions

“Three kilograms cost three times as much as one”: that is proportionality, the simplest way two quantities can be related. Linear functions are proportionality in the language of functions; affine functions 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 aa:

f(x)=ax.f(x) = a x .

The number aa is the coefficient of ff. Two quantities are proportional exactly when one is a linear function of the other.

Example 67.2

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

Conversely, if a linear function satisfies f(4)=10f(4) = 10, then a=104=2.5a = \frac{10}{4} = 2.5 and f(x)=2.5xf(x) = 2.5x: one value determines a linear function completely.

Proposition 67.3 (Graph of a linear function)

The graph of f(x)=axf(x) = ax is a straight line through the origin. Conversely, every non-vertical line through the origin is the graph of a linear function.

Proof. Admitted at this level.

Two linear functions: both graphs pass through the origin; the coefficient a is the height reached at x = 1.
Two linear functions: both graphs pass through the origin; the coefficient aa is the height reached at x=1x = 1.

67.2 Affine functions

Definition 67.4 (Affine function)

An affine function has the form

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

where aa and bb are fixed numbers. Linear functions are the special case b=0b = 0; constant functions the case a=0a = 0.

Example 67.5

A gym charges a registration fee of 2020, then 55 per visit: the total cost of xx visits is f(x)=5x+20f(x) = 5x + 20. The cost is not proportional to the number of visits (10 visits do not cost twice as much as 5), but each extra visit adds the same amount, 55.

Proposition 67.6 (Graph of an affine function)

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

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

Proof of the last point. f(v)f(u)=(av+b)(au+b)=a(vu)f(v) - f(u) = (av + b) - (au + b) = a(v - u); divide by vuv - u. The rest is admitted at this level (the High School volume gives a full treatment of lines and their equations).

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).
Reading y=ax+by = ax + b on its graph: the line crosses the yy-axis at height bb, and climbs aa for each unit step to the right (here a=1a = 1, b=1b = 1).

Method 67.7 (Finding an affine function from two values)

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

  1. compute the slope a=f(v)f(u)vua = \dfrac{f(v) - f(u)}{v - u};
  2. substitute one of the two known values into f(x)=ax+bf(x) = ax + b to find bb;
  3. check with the other value.

Example 67.8

Find the affine function with f(2)=7f(2) = 7 and f(5)=16f(5) = 16.

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

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

67.3 Percentages

Proposition 67.9 (Percentage change)

Increasing a quantity by t%t\,\% multiplies it by 1+t1001 + \dfrac{t}{100}; decreasing it by t%t\,\% multiplies it by 1t1001 - \dfrac{t}{100}. Percentage changes are linear functions.

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

x+t100x=(1+t100)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 8080 increases by 15%15\%: new price 80×1.15=9280 \times 1.15 = 92. A price of 6060 decreases by 30%30\%: 60×0.7=4260 \times 0.7 = 42.

Chaining changes multiplies the factors. A 20%20\% increase followed by a 20%20\% decrease gives 1.2×0.8=0.961.2 \times 0.8 = 0.96: a 4%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,g(x)=3x5,h(x)=x2,k(x)=x2,m(x)=7.f(x) = 4x, \qquad g(x) = 3x - 5, \qquad h(x) = x^2, \qquad k(x) = -\tfrac x2, \qquad m(x) = 7 .
Solution

Solution of Exercise 67.1.

Linear: ff and kk (form axax). Affine but not linear: gg (slope 33, intercept 5-5) and mm (constant, slope 00). Neither: hh, because of the square.

Exercise 67.2

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

Solution

Solution of Exercise 67.2.

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

Exercise 67.3

A linear function satisfies f(6)=15f(6) = 15. Find its coefficient, then compute f(10)f(10) and f(2)f(-2).

Solution

Solution of Exercise 67.3.

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

Exercise 67.4

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

Solution

Solution of Exercise 67.4.

ff passes through the origin with slope 22; gg has the same slope but crosses the yy-axis at 33; hh decreases from (0,4)(0, 4) with slope 1-1. The graphs of ff and gg are parallel lines (same slope, different intercepts).

Exercise 67.5

Find the affine function such that f(1)=5f(1) = 5 and f(3)=11f(3) = 11; then the one such that g(0)=4g(0) = 4 and g(2)=0g(2) = 0.

Solution

Solution of Exercise 67.5.

For ff: slope 11531=3\frac{11 - 5}{3 - 1} = 3, then 5=3×1+b5 = 3 \times 1 + b gives b=2b = 2: f(x)=3x+2f(x) = 3x + 2.

For gg: slope 0420=2\frac{0 - 4}{2 - 0} = -2, and g(0)=4g(0) = 4 is already the intercept: g(x)=2x+4g(x) = -2x + 4.

Exercise 67.6 ★★

Compute: the price after a 25%25\% increase on 120120; the price after a 40%40\% discount on 6565; the original price if an article costs 6969 after a 25%25\% discount.

Solution

Solution of Exercise 67.6.

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

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

Original price pp with p×0.75=69p \times 0.75 = 69: p=690.75=92p = \frac{69}{0.75} = 92.

Exercise 67.7 ★★

A phone plan A costs 1010 per month plus 0.050.05 per minute of calls; plan B costs 2525 per month with unlimited calls.

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

Solution of Exercise 67.7.

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

2. Plan B is cheaper when 25<0.05x+1025 < 0.05x + 10, i.e. 15<0.05x15 < 0.05x, i.e. x>300x > 300. From 301301 minutes (55 hours) per month onward, plan B wins.

Exercise 67.8 ★★

A population of 20002000 bacteria increases by 10%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 24002400.
Solution

Solution of Exercise 67.8.

1. After one hour: 2000×1.1=22002000 \times 1.1 = 2200. After two hours: 2200×1.1=24202200 \times 1.1 = 2420.

2. The second increase applies to 22002200, not to 20002000: growing by 10%10\% twice multiplies by 1.12=1.211.1^2 = 1.21, a 21%21\% increase, not 20%20\%.

Exercise 67.9 ★★

The graph of an affine function passes through the points (2,3)(2, 3) and (6,1)(6, 1).

  1. Compute its slope. Is the function increasing or decreasing?
  2. Give its expression, and compute the input for which the output is 00.
Solution

Solution of Exercise 67.9.

1. Slope: 1362=24=0.5\frac{1 - 3}{6 - 2} = \frac{-2}{4} = -0.5: the function is decreasing.

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

Exercise 67.10 ★★★

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

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

Solution of Exercise 67.10.

1. The two changes multiply the price by

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

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

2. For 0<t1000 < t \leq 100, t210000>0\frac{t^2}{10000} > 0, so the factor is less than 11: the final price is lower than the original. For t=10t = 10: factor 110010000=0.991 - \frac{100}{10000} = 0.99, i.e. an overall decrease of 1%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 “6868 degrees” and dress lightly; Europeans hear it and grab a coat. The two thermometers of the world are linked by an affine function — and building it from two facts is exactly the skill of Method 67.7. This problem constructs the conversion, finds the eerie temperature at which the two scales 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: water freezes at 3232\,^\circF and boils at 212212\,^\circF (at 00\,^\circC and 100100\,^\circC).

  1. Find the affine function F=f(C)F = f(C) converting Celsius into Fahrenheit (Method 67.7 with the values f(0)=32f(0) = 32 and f(100)=212f(100) = 212).
  2. Convert to Fahrenheit: a mild 2020\,^\circC day; the body’s 3737\,^\circC; a freezing 10-10\,^\circC.
  3. Solve for CC to build the return conversion, and use it on 5050\,^\circF and on 98.698.6\,^\circF.
  4. Is ff a linear function (Definition 67.1)? Test the tell-tale signs: what is f(0)f(0), and does doubling the Celsius reading double the Fahrenheit one? Conclude with the right word (Definition 67.4).
  5. The classic riddle: is there a temperature that reads the same number on both scales? Solve f(x)=xf(x) = x, and describe what your solution means on the graph of ff (which line does the graph cross there?).

Part II — Affine functions in the wild.

  1. Taxi A charges 33 euros plus 1.501.50 per km; taxi B charges a flat 22 euros per km. Write the two price functions and compare them for a 44 km ride and an 88 km ride.
  2. Find the break-even 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?).
  3. Naturalists’ rule of thumb: a cricket chirps about N=7T30N = 7T - 30 times per minute at temperature TT\,^\circC. How many chirps on a 2020\,^\circC evening? You count 8282 chirps in a minute: what temperature does the cricket announce?
  4. A phone bought 600600 euros loses value by 1515 euros per month: write the value function v(t)v(t), find when the phone is worth 240240 euros, and when the model says it is worth nothing. Does the formula still mean anything after that date?
  5. Percentage moves are linear functions: +25%+25\,\% is multiplication by 1.251.25, and 20%-20\,\% by 0.80.8 (Proposition 67.9). Compose them: what does a +25%+25\,\% rise followed by a 20%-20\,\% cut do to a price? Explain the little miracle, and compare with Exercise 67.10.

Part III — The slope is everything.

  1. A candle measures 2020 cm when lit and 1717 cm half an hour later. Assuming affine melting, find h(t)h(t) (height in cm, tt in minutes), and predict when the candle dies.
  2. Two cyclists ride the same road: the first’s distance is d1(t)=24td_1(t) = 24t (km after tt hours), the second’s is d2(t)=10+18td_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?
  3. Let f(x)=2x+3f(x) = 2x + 3 and g(x)=0.5x+7g(x) = -0.5x + 7. Compute f(x)+g(x)f(x) + g(x) and check it is affine again. What are the slope and intercept of a sum, in general?
  4. Discuss completely the equation mx+p=0mx + p = 0: how many solutions when m0m \neq 0 (and which one)? When m=0m = 0 and p0p \neq 0? When m=0m = 0 and p=0p = 0? (Every case has a graph story: where does a line of slope mm cross the horizontal axis?)
  5. The alignment test: are the points (1,5)(1, 5), (3,9)(3, 9), (7,17)(7, 17) on one straight line? Are (1,5)(1, 5), (3,9)(3, 9), (6,16)(6, 16)? Compute rates of change between pairs and decide. State the moral: a constant rate of change is the signature of affine functions — curved graphs change their rate, and measuring that is a story for the High School volume.
Solution

Solution of Problem 67.1.

1. Slope: f(100)f(0)1000=21232100=1.8\frac{f(100) - f(0)}{100 - 0} = \frac{212 - 32}{100} = 1.8; intercept f(0)=32f(0) = 32. Hence

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

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

3. From F=1.8C+32F = 1.8C + 32: C=F321.8C = \frac{F - 32}{1.8}. Then 5050\,^\circF 181.8=10\to \frac{18}{1.8} = 10\,^\circC, and 98.698.6\,^\circF 66.61.8=37\to \frac{66.6}{1.8} = 37\,^\circC.

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

5. 1.8x+32=x1.8x + 32 = x gives 0.8x=320.8x = -32, so x=40x = -40: at forty below, both thermometers read 40-40. On the graph, the line of ff crosses the diagonal line y=xy = x exactly there.

6. pA(k)=1.5k+3p_A(k) = 1.5k + 3 and pB(k)=2kp_B(k) = 2k. For 44 km: 99 euros against 88: B cheaper. For 88 km: 1515 against 1616: A cheaper.

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

8. N=7×2030=110N = 7 \times 20 - 30 = 110 chirps per minute. From 82=7T3082 = 7T - 30: T=1127=16T = \frac{112}{7} = 16\,^\circC.

9. v(t)=60015tv(t) = 600 - 15t. Worth 240240: 60015t=240600 - 15t = 240, t=24t = 24 months. Worth 00: t=40t = 40 months. Beyond 4040 months the formula goes negative — but a phone’s value stops at zero: every affine model has a domain where it makes sense.

10. Composing: ×1.25\times 1.25 then ×0.8\times 0.8 multiplies by 1.25×0.8=11.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 1t2100001 - \frac{t^2}{10\,000}, is Exercise 67.10.

11. Slope: 172030=0.1\frac{17 - 20}{30} = -0.1 cm per minute; h(t)=200.1th(t) = 20 - 0.1t. It dies at h(t)=0h(t) = 0: t=200t = 200 minutes — three hours and twenty minutes of light.

12. The second started 1010 km ahead (intercept); the first is faster (24>1824 > 18 km/h). Catch-up: 24t=10+18t24t = 10 + 18t gives 6t=106t = 10, t=53t = \frac53 h =1= 1 h 4040 min, at kilometer 24×53=4024 \times \frac53 = 40.

13. f(x)+g(x)=(20.5)x+(3+7)=1.5x+10f(x) + g(x) = (2 - 0.5)x + (3 + 7) = 1.5x + 10: affine, with slope the sum of the slopes and intercept the sum of the intercepts — clear from collecting like terms in (mx+p)+(mx+p)(mx + p) + (m'x + p').

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

15. First triple: rates 9531=2\frac{9 - 5}{3 - 1} = 2 and 17973=2\frac{17 - 9}{7 - 3} = 2: equal, the points are aligned (on y=2x+3y = 2x + 3). Second triple: 952=2\frac{9-5}{2} = 2 but 1693=732\frac{16 - 9}{3} = \frac73 \neq 2: not aligned. Affine functions are exactly those with a constant rate of change — one number, the slope, 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.