Study Companion: Programme F.10 — Functions
You have used functions since your first calculator: press 4, then the x^2 key, and 16 appears. Programme F.10 takes that picture seriously. A function is a machine, a box with one instruction inside, that turns each number fed in into exactly one number out. Everything in the chapter is a question about such boxes: which inputs a box accepts and which outputs it can produce (domain and range), how to run a box backwards (the inverse), and what happens when boxes are joined in a chain (composition). The one idea that makes the rules forced rather than arbitrary is that undoing is running the arrows backwards. It explains why f^{-1} is not \frac1f, why the graph of an inverse is a mirror image, and why a chain has to be undone in the reverse order.
The rules, procedures and drill are in the companion reference sheet, which follows the book's topic order. This file tells the story in 6 units instead, because the programme's many topics are really 6 ideas.
Scope, as in the book: the functions here are algebraic (powers, roots, fractions). Trigonometric, exponential and logarithmic functions follow in Programme F.11.
How to use this companion
Each unit is an argument: a real situation and a question, the attempt a sensible person would make first, the picture that settles it, a check with numbers, and only then the rule. Read it once front to back. The Narration spine at the end of each unit summarises what the video shows.
Unit 01: A Function Is a Rule with One Answer
The problem
Type 4 into a calculator and press the \sqrt{\ } key: it shows 2. But (-2)^2=4 as well, so "the number whose square is 4" has two answers. Why does the calculator show only one, and would a machine that honestly returned both still deserve the name function?
First attempt
A function, surely, is any formula that gives y in terms of x. Then the rule "take both square roots", y=\pm\sqrt x, is a function like any other. Feed it x=4 and it hands on two numbers, 2 and -2. Now pass its output to the next machine in a chain, one that multiplies by 3: out comes "6 or -6". A controller at the end of that chain cannot act on "6 or -6". A formula has been written down, but it does not tell the next stage what to do.
The picture
Draw the machine as two number lines, inputs on one and outputs on the other, with an arrow from each input to what the machine makes of it. For the x^2 key:
Arrows may merge: -2 and 2 both land on 4, and nothing is ambiguous, because anyone holding an input knows exactly where it goes. What the right-hand rule does is different: one input's arrow splits. That is the whole distinction. A machine may send many inputs to one output, but it may not send one input to two outputs.
Now turn every arrow into a point: the arrow from a to b becomes the point (a,b). The arrows of the x^2 key become the parabola y=x^2; the arrows of the both-roots rule become the parabola on its side, y^2=x. The points whose input is a are exactly the points on the vertical line x=a. So one output for the input a means one meeting with that line, and a split arrow means two. That is the vertical-line test: a graph belongs to a function exactly when no vertical line meets it more than once. One offending line is enough to disqualify it.
Check it with numbers
For the x^2 key, f(-2)=f(2)=4 and f(-1)=f(1)=1: two pairs of merging arrows, and every vertical line meets y=x^2 once. For the both-roots rule, the line x=4 meets y^2=x at (4,2) and at (4,-2), and x=9 meets it at (9,3) and (9,-3). The calculator's key follows only the upper arrow: it computes the positive root, \sqrt4=2, and that rule is a function.
The rule it gives
A function of x is a rule that turns each input x into a unique output y, usually written y=f(x). The book calls this being single valued. Several inputs may share an output; one input may never have two. (The book adds that "different outputs are associated with different inputs". Read it as a restatement of single-valuedness, not as "different inputs must give different outputs": x^2 gives 4 for both 2 and -2 and is a function.)
The box diagram is the book's picture of the rule:
"y is a function of x" is how everyone reads y=f(x), but strictly the function is the rule f, the box or the calculator key. y is the number it produces, and x is the number fed in. Four more boxes from the book: y=\frac1x is the reciprocal key, y=x-6 subtracts 6, y=4x multiplies by 4, and y=x^{1/3} takes the cube root.
A convention the book does not share. In these notes, as in F.1 Unit 07 and F.4 Unit 01, \sqrt x and x^{1/2} both mean the non-negative root, the calculator's answer. So y=x^{1/2} is a function on x\ge0. Stroud keeps \sqrt{\ } for the positive root but reads x^{1/2} as both roots, \pm\sqrt x, so the book says that y=x^{1/2}, y=x^{1/6} and y=x^{-1/4} are not functions. Both verdicts are correct about different rules: the two-valued rule "take both even roots" is not a function; the principal root is. When checking your answers against the book's, read an even root written as a fractional power as \pm. Odd roots are single valued in either convention, negative inputs included: (-8)^{1/3}=-2.
Worked example
Is y=7x^{1/3}-3x^{-1} a function? The cube root is single valued for every real x, and x^{-1}=\frac1x is single valued for every x\ne0. So yes, for x\ne0. At x=8, y=7\times2-\frac38=13.625; at x=-8, y=7\times(-2)+\frac38=-13.625.
Compare y=5x^2+2x^{-1/4}. The term x^{-1/4}=\frac1{x^{1/4}} is an even root. The book reads it as two-valued and answers "not a function"; with principal roots it is a function for x>0.
Where this shows up
A full-wave rectifier turns an alternating voltage v into |v| (the modulus of F.4 Unit 05). An input of +3 V and an input of -3 V both give 3 V: the arrows merge, and the rectifier is a perfectly good function. Ask the reverse question, "which input produced this 3 V?", and the arrow splits into +3 V and -3 V. That is why a rectified signal cannot be un-rectified without extra information, a point Unit 04 returns to. A temperature sensor, on the other hand, must be a function of temperature: the TMP36 chip outputs V=0.5+0.01T volts at T °C, so 25 °C gives exactly 0.75 V. Try the \sqrt{\ } key on any calculator: it always returns the one non-negative root.
Narration spine. A calculator's root key shows 2 for 4, though -2 squares to 4 as well. Two number lines appear with arrows for the x^2 key: -2 and 2 merge onto 4, which is allowed. The both-roots rule sends 4 to 2 and to -2, its arrow splits, and it is struck out. The arrows collapse into points, the points into the two parabolas, and a vertical line sweeping across meets y=x^2 once but the sideways parabola twice. The lower branch fades and the upper one, the calculator's positive root, is kept. The rule arrives: one input, one output.
Unit 02: Domain and Range Are Part of the Function
The problem
A ball is thrown straight up from the floor of an atrium at 20 m/s and is caught 3 s later by someone on a balcony 15 m up. Taking g\approx10 m/s^2, its height is
Which heights does the ball pass through? In particular, how tall must the atrium be for the ball to miss the roof?
First attempt
The clock runs from t=0 to t=3, so the heights run from h(0)=0 to h(3)=60-45=15 m. The range is 0 to 15 m, and a 16 m roof is safe. But at t=2, h(2)=40-20=20 m: the ball hits a 16 m roof with 4 m to spare. End values say where the ball starts and finishes, not where it goes in between.
The picture
A function is not just its formula. It is the formula together with the inputs it is allowed to take, its domain, here 0\le t\le3: a bar on the t-axis. Now let t run along that bar and watch the output. Project the moving point across onto the h-axis; its shadow paints out every height the ball reaches:
The shadow climbs from 0 to 20 and falls back to 15. It reaches past both end values because the curve turns round inside the domain. The heights between 15 and 20 are each passed twice, on the way up and on the way down: merging arrows again, which a function may have.
One honest remark: that the shadow covers every height from 0 to 20, with no gaps, relies on the curve being unbroken. The ball cannot jump from one height to another. Here that is an intuition, not a proof; the proof (the intermediate value theorem) belongs to later mathematics, and the book relies on the same intuition.
Check it with numbers
h(0)=0, h(1)=15, h(2)=20, h(2.5)=18.75, h(3)=15. The range is 0\le h\le20 m, so the atrium needs more than 20 m of height. The heights h(1) and h(3) are both 15, the up-and-down pair.
The rule it gives
The domain of a function is the collection of all inputs it may process; the range is the collection of all outputs it actually produces. The book writes both as inequalities: 0\le t\le3, -8\le y<27.
- A stated domain is part of the definition: y=x^3 on -2\le x<3 is a different function from y=x^3 on all x.
- No domain stated means all finite x, -\infty<x<\infty, less any point where the rule is undefined. So y=x^4 has domain -\infty<x<\infty and, since an even power is never negative, range 0\le y<\infty. The book's y=\sqrt{1-x^2} is real only for -1\le x\le1, which is its domain, and its range is 0\le y\le1.
- To find the range, sweep the domain: the end values, any turning point inside, and any break where the function runs off to infinity.
- A function that only ever rises (or only falls) has no turning point, so its end values do give the range. y=x^3 on -2\le x<3 has range -8\le y<27. The strict "<" survives: 3 is not in the domain, so 27 is never produced.
- A vertical asymptote is removed from the domain, and it can split the range into two pieces (see the worked example).
Range and co-domain. In these notes the co-domain is the set the outputs are declared to lie in (all real numbers, say, or the 0 to 5 V an instrument accepts), and the range is the part of it actually produced. They can differ. Stroud writes "range (or co-domain)" and uses the words as synonyms; where the book says co-domain, read range.
Functions and the arithmetic operations. Two functions combine as (f+g)(x)=f(x)+g(x), and likewise for f-g, fg and \frac fg. A combination can only be evaluated where both machines accept x, which is the overlap of the two domain bars. A quotient must also drop every x that makes its denominator zero. The book's example is f(x)=x^2-1 on -2\le x<4 and g(x)=\frac2{x+3} on 0<x\le5:
So h=f+g is h(x)=x^2-1+\frac2{x+3} on 0<x<4. For k=\frac gf, k(x)=\frac2{(x+3)(x^2-1)} on 0<x<4 with x\ne1 as well, because f(1)=0.
Worked example
The book's y=\frac1{(x-1)(x+2)} on 0\le x\le6. At x=1 the denominator is zero: a vertical asymptote, so the domain is 0\le x<1 and 1<x\le6.
On the left piece the denominator (x-1)(x+2)=x^2+x-2 rises from -2 towards 0, so y runs from y(0)=-0.5 down towards -\infty: the range piece is -\infty<y\le-0.5. On the right piece the denominator rises from 0 to 40, so y falls from +\infty to y(6)=\frac1{40}=0.025: the range piece is 0.025\le y<\infty. The range is split, and no input at all produces a value between -0.5 and 0.025.
Where this shows up
The TMP36 temperature sensor outputs V=0.5+0.01T volts and is rated for -40\le T\le125 °C. It only rises, so its range comes from the end values: 0.1\le V\le1.75 V. The microcontroller's converter accepts anything from 0 to 5 V, which is the co-domain. A reading of 0.02 V lies in the co-domain but outside the range: no temperature produces it. The firmware should flag a fault, typically a broken wire, rather than report -48 °C. Knowing the range turns a wrong number into a detected fault.
Narration spine. A ball is thrown up in an atrium and caught on a balcony. The graph of its height is drawn over the domain bar 0\le t\le3, and the guess from the end values, 0 to 15 m, is painted in red on a gauge beside the curve. A tracker runs t across the domain while the ball's height is projected onto the gauge and a green bar paints every height reached; it overshoots the guess to 20 m at t=2, and the guess is struck out. The ball falls back to 15 m, and the green bar is named the range, 0\le h\le20.
Unit 03: Inverses Run the Machine Backwards
The problem
A drawing gives a bolt length as 38.1 mm, and the tape measure in your hand has inches along one edge and millimetres along the other. Inches to millimetres is the one-box machine f(x)=25.4x: 1.5 in becomes 38.1 mm. What machine goes the other way, and how should it be written?
First attempt
The book writes the reverse machine as f^{-1}. Since x^{-1} means \frac1x, the natural reading is f^{-1}(x)=\frac1{f(x)}=\frac1{25.4x}. Feed in 38.1:
a thousandth of an inch, for a bolt you can hold in your hand. Whatever the -1 in f^{-1} means, it is not a power.
The picture
The tape is two number lines side by side. The function f is the set of arrows straight across the tape, from each inch mark to its millimetre mark: 1\to25.4, 1.5\to38.1, 2\to50.8. Reading the tape the other way uses the same arrows, reversed. Nothing on the tape changes; only the direction of travel does.
In a box diagram, reversing the arrows means replacing the instruction by the one that cancels it:
Dividing by 25.4 is the right replacement because, whatever x went in, \frac{25.4x}{25.4}=x. The reversed box hands back exactly the input, which is the one thing an inverse has to do. The reciprocal did not: it turned 38.1 into 0.001033, not 1.5.
Check it with numbers
f(1.5)=38.1 and f^{-1}(38.1)=\frac{38.1}{25.4}=1.5. Likewise f(2)=50.8 and f^{-1}(50.8)=2. Round trip: f^{-1}(f(1.5))=1.5. The reciprocal gives \frac1{f(38.1)}=0.001033, which is not even close.
The rule it gives
The inverse of a function f, written f^{-1} (the book also writes \operatorname{arc}f), reverses the flow of information: the output becomes the input, and the original input comes back out.
f^{-1}(x) is not \frac1{f(x)}. The -1 is a label meaning "reversed".
To build the inverse of a one-box function, replace the operation by its inverse operation. They come in cancelling pairs:
| Operation | Inverse operation | Because |
|---|---|---|
| add a | subtract a | (x+a)-a=x |
| multiply by a (a\ne0) | divide by a | \frac{ax}a=x |
| raise to the power k | raise to the power \frac1k | (x^k)^{1/k}=x |
So f(x)=x+5 has f^{-1}(x)=x-5, f(x)=6x has f^{-1}(x)=\frac x6, and f(x)=x^3 has f^{-1}(x)=x^{1/3}. (The last pair needs care with even k: Unit 04.)
Swap and solve, a second route not in the book, gives the same answer. Write y=25.4x, swap the names, x=25.4y, and solve: y=\frac x{25.4}. Swapping the names is reversing the arrows, since outputs become inputs, and solving is applying the cancelling operation. The two methods are one move written two ways.
Self-inverse functions. Two functions are their own inverses. f(x)=x sends every input to itself, so reversing its arrows changes nothing. f(x)=\frac1x has reversed box \frac1x again, because \frac1{1/x}=x: 4\to0.25\to4. Here is the notation trap once more: for f(x)=x, \frac1{f(x)}=\frac1x, but f^{-1}(x)=x.
Worked example
The book's three: the inverses of 6x, x^3 and \frac x2.
- \times6 reverses to \div6: f^{-1}(x)=\frac x6. Check: f(2)=12 and \frac{12}6=2.
- Cubing reverses to the cube root: f^{-1}(x)=x^{1/3}. Check: f(2)=8 and 8^{1/3}=2.
- \div2 reverses to \times2: f^{-1}(x)=2x. Check: f(5)=2.5 and 2\times2.5=5.
Where this shows up
A car speedometer marked in both mph and km/h is the same picture: two number lines, one needle. One mile is 1.609344 km, so the machine is \text{km/h}=1.609344\times\text{mph}, and 70 mph is 112.65 km/h. Its inverse is the box \div1.609344, so a 100 km/h limit is 62.14 mph. Every conversion chart, tape measure and dual-scale dial is a function and its inverse printed on one strip, read in opposite directions.
Narration spine. A tape measure with an inch scale over a millimetre scale; arrows run across it from inches to millimetres, 1.5 in landing on 38.1 mm. The reciprocal guess sends 38.1 to 0.001033 and is struck out. Every arrow then reverses at once, the tape unchanged, and the box \times25.4 turns into \div25.4. The number checks it, 38.1 back to 1.5, and the rule f(a)=b\Leftrightarrow f^{-1}(b)=a is written with the warning f^{-1}\ne\frac1f.
Unit 04: The Graph of an Inverse Is a Reflection
The problem
A cubic tank of side s metres holds V=s^3 cubic metres. A designer has the graph of V against s, but to choose a tank for a required volume they need the graph of s against V, the inverse. Must it be replotted point by point, as the book does by swapping the columns of a spreadsheet (F.4 Unit 03), or is it already hiding in the first graph?
First attempt
"Inverse" sounds like "opposite", so flip the graph over, reflecting it in the horizontal axis to get V=-s^3. The point (2,8), a 2 m tank holding 8 m^3, goes to (2,-8). But the inverse must send 8 back to 2, so its graph has to contain (8,2), not (2,-8). Reflecting in an axis changes a sign; the inverse swaps the roles of the two numbers.
The picture
Unit 03 reversed every arrow. An arrow a\to b of f is the point (a,b) on its graph, and the reversed arrow b\to a is the point (b,a). So the graph of f^{-1} is the graph of f with every pair of coordinates swapped. What does swapping coordinates do to a point? Take (2,8) and (8,2):
- The step from (2,8) to (8,2) is 6 across and 6 down: the diagonal of a square. The line y=x runs 1 across and 1 up, along the other diagonal direction of the squares. The two diagonals of a square cross at right angles, so the segment is perpendicular to y=x.
- The midpoint of the segment is \left(\frac{2+8}2,\frac{8+2}2\right)=(5,5). Its two coordinates are equal, so it lies on y=x.
So y=x crosses the segment at right angles, through its middle. That is exactly where a mirror would have to stand to show (8,2) as the image of (2,8). Nothing depended on 2 and 8: for any (a,b) the step to (b,a) is b-a across and a-b down, the diagonal of a square, and the midpoint \left(\frac{a+b}2,\frac{a+b}2\right) has equal coordinates. Every point of the graph swaps, so the whole graph is reflected in the line y=x. The book calls the two graphs "reflection symmetric about y=x", like images in a double-sided mirror laid along that line.
Check it with numbers
On y=x^3, the point (1.4,2.744) swaps to (2.744,1.4), and 2.744^{1/3}=1.4: the reflected point lies on y=x^{1/3}, as it must. The midpoint (2.072,2.072) is on the mirror. The points (-1,-1), (0,0) and (1,1) lie on the mirror already, so they stay put, which is why the graphs of x^3 and x^{1/3} cross there.
The rule it gives
The graph of the inverse is the graph of the function reflected in the line y=x. Draw y=x, fold the page along it, and the curve lands on its inverse.
The inverse of a function, and the inverse function. Reflect y=x^2. The result is the parabola on its side, and the vertical line x=4 meets it at (4,2) and (4,-2). The reflected rule is y=\pm\sqrt x, two-valued, so by Unit 01 it is not a function. The book calls this reflected curve the inverse of the function. Remove the lower branch and what remains, y=\sqrt x, is single valued: the book calls it the inverse function. In general, the inverse function is what is left of the inverse after pruning branches until no vertical line meets it twice. Pruning the inverse's lower branch is the same as keeping only x\ge0 in the original.
Since reflecting in y=x turns horizontal lines into vertical ones, the test can be run on the original graph (beyond the book): a function has an inverse function exactly when no horizontal line meets its graph more than once. y=x^3 passes, so x^{1/3} is a function on all x with no pruning; y=x^2 fails.
The book's harder case is y=x^4-x^2+1, a W shape with a local peak of 1 at x=0 and two dips to \frac34 at x=\pm0.7071. The horizontal line y=0.9 meets it four times, at x=\pm0.3357 and x=\pm0.9420, so after reflection the vertical line x=0.9 meets the inverse four times. Is the inverse of the function the inverse function? No. To get one, keep a piece on which the curve only rises, such as x\ge0.7071, and reflect that.
The book's x^{1/6} verdict, reconciled. Reflecting y=x^6 gives the two-valued y=\pm x^{1/6}, and the book answers "x^{1/6}, not a function", reading an even root as two-valued (Unit 01). In our convention x^{1/6} is the non-negative root: the pruned upper branch, which is the inverse function of x^6 on x\ge0. It is the same picture with two vocabularies.
Worked example
Find the inverse function of f(x)=x^2 on the domain x\le0, the left half of the parabola. The reflection of that half is the lower branch of the sideways parabola, so f^{-1}(x)=-\sqrt x for x\ge0. Check: f(-3)=9, and f^{-1}(9)=-\sqrt9=-3; the points (-3,9) and (9,-3) are mirror images in y=x. The domain chosen for f decides which branch survives.
Where this shows up
The kinetic energy of a 1000 kg car is E=\frac12mv^2=500v^2 J. As a function of velocity, forwards or backwards, E(20)=E(-20)=200\,000 J: recovering velocity from energy means facing the sideways parabola, which has two branches. Physics prunes it. Speed is never negative, so the inverse function is v=\sqrt{E/500}, and 200 kJ gives v=\sqrt{400}=20 m/s. The cubic tank needs no pruning: s^3 only rises, so a 2 m^3 tank has side s=2^{1/3}=1.260 m.
Narration spine. The graph of V=s^3 with the point (2,8). The flip-it-over guess would send the point to (2,-8), not the needed (8,2), and is struck out. The point (2,8) and its swap (8,2) are joined, and the square with corners (2,2) and (8,8) is drawn: the segment is one diagonal, y=x carries the other, and a right-angle mark and the midpoint (5,5) appear where they cross. A tracker then runs a point along x^3 while its swapped twin traces x^{1/3}. Finally x^2 is reflected, a vertical line meets the sideways parabola twice, the lower branch is pruned, and \sqrt x remains as the inverse function.
Unit 05: Composition Is Machines in Series
The problem
A till adds 20\% VAT (multiply by 1.2) and takes off a £5 voucher. Does it matter which it does first? And how should "one function applied after another" be written?
First attempt
Surely not: 3\times4=4\times3, and the two steps just combine. Try it on a £50 item. VAT then voucher: 50\to60\to55. Voucher then VAT: 50\to45\to54. The customer pays £55 one way and £54 the other. Order matters, and the question is why, and whether it always does.
The picture
A graph shows one machine; for a chain, stack one number line per stage. Price on the top line, the price after the first machine on the second, the price after the second machine on the third. A marker on each line, joined by arrows. Moving the top marker drags the others along, because each stage's output is the next stage's input.
Build the two stacks side by side and drag the price. At every price the two bottom markers stay exactly £1 apart. The algebra down the right-hand stack says why: when the voucher comes first, the VAT stage multiplies the -5 as well, and 1.2\times5=6. The extra £1 is the VAT charged on the voucher. The order matters because the second machine acts on everything the first one produced, including what the first one added.
Check it with numbers
£50: 55 against 54. £100: 1.2\times100-5=115 against 1.2\times95=114. One pound apart both times, and 1.2x-5 minus (1.2x-6) is 1 for every x.
The rule it gives
Chaining machines, so that the output of one is the input of the next, is called composition; the result is a function of a function. With a(x)=1.2x and b(x)=x-5, doing a first and b second gives
The book writes the inner call in square brackets, b[a(x)], to keep the layers apart. Notice that the algebraic order is the reverse of the diagram order. In the diagram, x enters on the left and meets a first. In b[a(x)], x sits at the right, innermost, so the machine that acts first is written nearest to it. Read b\circ a from the right.
Order matters: b[a(x)] and a[b(x)] are in general different. The book's pair a(x)=x+3 and b(x)=4x gives b[a(x)]=4(x+3)=4x+12 but a[b(x)]=4x+3; at x=2 that is 20 against 11.
Chains of three or more work the same way, innermost first: d[c(b[a(x)])] means a, then b, then c, then d.
Decomposition asks the reverse question: given f, find the boxes. Think of the key presses you would make to evaluate it. For f(x)=3(2x+7)^4 at x=1: \times2 gives 2, +7 gives 9, ^4 gives 6561, \times3 gives 19683. So
A decomposition is not unique. (x+5)^4 is b[a(x)] with a(x)=x+5 and b(x)=x^4, but it is equally b(b[a(x)]) with b(x)=x^2, since squaring twice is a fourth power.
The domain of a chain (beyond the book): x must be accepted by the first machine, and what that machine produces must be accepted by the second. \sqrt{x-3} is "subtract 3, then take the root", so it needs x-3\ge0, that is x\ge3.
Worked example
The book's chain: a(x)=x^3, b(x)=2x, c(x)=x-5.
- a(b[c(x)]): c first, then b, then a: x\to x-5\to2(x-5)\to8(x-5)^3.
- c(a[b(x)]): b, then a, then c: x\to2x\to8x^3\to8x^3-5.
At x=6 the first gives 8\times1^3=8 and the second 8\times216-5=1723. The same three machines in a different order build a different function.
Where this shows up
A TMP36 sensor feeding an amplifier with a gain of 4 is a chain of three boxes: a(T)=0.01T (the sensor's 10 mV per degree), b(x)=x+0.5 (its 0.5 V offset), and c(x)=4x (the amplifier). The output is V=c(b[a(T)])=4(0.01T+0.5)=0.04T+2 volts. At 25 °C: 25\to0.25\to0.75\to3.00 V. Put the amplifier before the offset instead and 4(0.01T)+0.5=0.04T+0.5 gives 1.50 V at the same temperature: a different instrument. The order of the stages is part of the design.
Narration spine. A till, a price, VAT and a voucher. The guess that the order cannot matter is written, then struck out when the two orders give £55 and £54. Two stacks of three number lines appear, one per order, with markers joined by arrows; a tracker drags the price and the two bottom markers move in lock-step, always £1 apart. The notation b\circ a=b[a(x)] is written over the left-hand stack and a\circ b=1.2(x-5)=1.2x-6 over the right, where the -6 is lit up as the reason: VAT charged on the voucher.
Unit 06: Undoing a Chain Reverses Its Order
The problem
A US recipe says to bake at 350 °F, and your oven is marked in °C. Fahrenheit is a chain of two boxes: F=1.8C+32, that is \times1.8 and then +32. What setting should you use?
First attempt
Undo each step, in the same order: divide by 1.8, then subtract 32.
Check it by running it forwards: 162.44\times1.8=292.4, and 292.4+32=324.4 °F, not 350. The right inverse steps have been applied in the wrong order: the division acted on the 32 as well as on 1.8C.
The picture
Draw the chain, then draw the reversed chain under it, each box replaced by its inverse (Unit 03) and every arrow pointing back:
The +32 was the last thing done on the way out, so it is the outermost layer, and it has to come off first. It is socks and shoes: socks go on before shoes, and shoes come off before socks. Walking the reversed chain meets the same middle value, 318, as the forward walk, because each reversed box undoes exactly the box directly above it. The wrong attempt divided 350, a number that still had the 32 inside it.
This is transposition, the idea of F.3 Unit 02, now seen as functions.
Check it with numbers
350-32=318 and 318\div1.8=176.67 °C, so set the oven to about 177 °C. Forwards: 176.67\times1.8=318, and 318+32=350 °F. It checks.
The rule it gives
The algebra follows the picture. Let y=b[a(x)]. Apply b^{-1} to both sides; it cancels the outer machine b and leaves b^{-1}(y)=a(x). Now apply a^{-1}: a^{-1}\left(b^{-1}(y)\right)=x. Therefore
For three machines, in the book's form:
Notice the reversal of the order of the components. The inverse is a function only if every stage has an inverse function; a squaring stage needs its branch pruned first (Unit 04).
The book's example, and swap-and-solve reconciled. f(x)=(3x-5)^{1/3} is a(x)=3x, then b(x)=x-5, then c(x)=x^{1/3}. The inverses are a^{-1}(x)=\frac x3, b^{-1}(x)=x+5 and c^{-1}(x)=x^3, applied in reverse:
Swap and solve gives x=(3y-5)^{1/3}, so x^3=3y-5, so 3y=x^3+5, so y=\frac{x^3+5}3. Its three steps, cube, add 5 and divide by 3, are exactly the reversed boxes in the reversed order. Solving an equation is walking the chain backwards. Check: f(2)=1^{1/3}=1 and f^{-1}(1)=\frac{1+5}3=2.
Worked example
Invert f(x)=\left(\frac{x+2}4\right)^5. The boxes are +2, \div4 and ^5. Reversed and inverted, they are ^{1/5}, \times4 and -2:
Check at x=6: f(6)=\left(\frac84\right)^5=2^5=32, and f^{-1}(32)=4\times2-2=6.
Where this shows up
The firmware reading the amplified TMP36 of Unit 05 has to decode V=4(0.01T+0.5). It walks the chain backwards: \div4, then -0.5, then \div0.01. A reading of 2.6 V gives 2.6\to0.65\to0.15\to15 °C. As one formula, T=100\left(\frac V4-0.5\right)=25V-50, and 25\times2.6-50=15. Every calibration in a measurement chain is undone this way, from the last stage back to the first.
Narration spine. An oven dial in °C and a recipe at 350 °F. The Fahrenheit chain is built as two boxes. The same-order guess is built beneath it, with \div1.8 under +32; it turns 350 into 162.4, which run forwards returns 324.4, not 350, and is struck out. The two undo boxes swap places, so each sits under the box it cancels, and 350 walks back through them to 318 and then 176.67. Run forwards, 176.67 meets the same 318 and arrives at 350. The rule (b\circ a)^{-1}=a^{-1}\circ b^{-1} is written under the two chains.