Composition and inverse functions
Two functions set one behind the other, and one function run backwards. See why f(g(x)) is not g(f(x)), how the monotonicity of a composition follows from its parts, when a function can be inverted at all, and why the graph of the inverse is a reflection in the line y = x.
Before you start
This topic builds on earlier ideas. Before you start, it's worth working through the lessons below — they'll make everything click:
- What a function isA function is an unambiguous assignment: every argument gets exactly one value. Meet the f(x) notation, the domain and the range, the four ways to define a function, and the vertical line test on a graph.
- Exponential and logarithmic functionsGrain on a chessboard, a loan, radioactive decay and the decibel scale — one pair of functions describes them all. See what the graph of y = bˣ looks like and why y = log_b x is its mirror image, how solving an exponential equation comes down to comparing exponents, and where the domain of a logarithm comes from.
Where this is used
Real situations where you count exactly the way this lesson teaches:
- A currency desk with a commissionAn exchange office converts euros to zloty at g(x) = 4.30x and then takes a 2% commission, f(y) = 0.98y. A customer changing 500 € receives f(g(500)) = 0.98 · 2150 = 2107 zloty. The reverse operation answers "how many euros must I sell to get 3000 zloty": from 4.214x = 3000 we get 711.91 €, and that is precisely the inverse of the composition.
- Rescaling temperature in a laboratoryA sensor reports a voltage U, converted to degrees Celsius by T = 25U − 40, while the report needs Fahrenheit: F = 1.8T + 32. The composition gives F = 1.8(25U − 40) + 32 = 45U − 40, so at U = 2 V the report shows 50 °F. Inverting 45U − 40 = 100 tells the technician that 100 °F corresponds to 3.11 V.
- Price after a discount and taxA shop grants a 20% discount, r(x) = 0.8x, and the till adds 23% VAT, v(y) = 1.23y. For a net price of 500 zloty the composition gives v(r(500)) = 1.23 · 400 = 492 zloty. Here the order happens not to matter, since both steps are multiplications — but with a flat discount ("minus 100 zloty") v(r(500)) = 492 while r(v(500)) = 515, a difference of 23 zloty.
- Cryptography and the inverse keyA simple affine cipher encodes the letter numbered x as f(x) = (5x + 8) mod 26. The recipient has to compute the inverse function: f⁻¹(y) = 21(y − 8) mod 26, because 21 is the inverse of 5 modulo 26. The letter "K", numbered 10, encrypts to 58 mod 26 = 6, and decrypting 21·(6 − 8) mod 26 = 10 returns the original — the whole mechanism is one function and its inverse.
All formulas
Composition of functions
g first, then f — read from the inside out
Order matters
composition is not commutative
One-to-one
the condition for an inverse to exist
The inverse function
undoes exactly what f did
Roles swapped
domain and range change places
The graph of the inverse
a reflection in the line y = x
A coffee machine works in two stages: it grinds the beans, then brews them. Put beans in and a drink comes out — but the order cannot be swapped, and no cup gives the beans back. Composition and the inverse function are exactly those two questions.
Composing functions
The output of one function can be the argument of another:
The notation is read from the inside out: acts first, then . We call the inner function and the outer one.
The formula of a composition
Instead of computing point by point, substitute the whole inner function for the argument:
Two different polynomials — formal confirmation that composition is not commutative:
The chain rule in the lesson on the derivative differentiates expressions of exactly this shape — and only now is it clear what they are.
The domain of a composition
This is where mistakes are easiest. The domain of consists of those arguments for which:
- lies in the domain of , and
- the value lies in the domain of .
The second condition can narrow things sharply. For and the function is defined everywhere, but the composition needs , so the domain is .
Monotonicity of a composition
A composition inherits its monotonicity from its parts — and the proof is short, because it fits entirely inside the definition.
Theorem. If is increasing and is increasing, then is increasing.
Proof. Take any in the domain of the composition.
The inequality between the arguments passed through both functions untouched, so . That is exactly the definition of an increasing function.
The same scheme with the inequalities reversed gives the remaining three cases:
| increasing | increasing | increasing |
| increasing | decreasing | decreasing |
| decreasing | increasing | decreasing |
| decreasing | decreasing | increasing |
The last row surprises, but it behaves like multiplying negative numbers: two reversals cancel each other out.
One-to-one functions
For a function to be undoable, every value must come from exactly one argument:
Such a function is called one-to-one. On a graph this is checked by the horizontal-line test: if any horizontal line meets the graph more than once, the function is not one-to-one.
The function on the whole line fails the test — the line hits it twice. Every strictly monotone function passes it, because a direction once chosen is never reversed.
The inverse function
For a one-to-one function there is a function that undoes :
Domain and range swap roles in the process: what used to be the output becomes the input.
Mind the notation. does not mean . For we have , while — two entirely different functions.
Finding the formula
Three steps, always the same:
- write ;
- solve that equation for ;
- swap the names of the variables.
The graph
Since maps , the inverse maps . The point therefore goes to , and swapping the coordinates is a reflection in the line .
When the domain has to be restricted
A function that fails the horizontal-line test is not lost — it is enough to cut part of it away.
The same move stands behind three other pairs you have met or will meet:
- for and the square root ;
- and the logarithm — here no restriction is needed, because the exponential function is one-to-one on the whole line;
- restricted to and the inverse trigonometric functions, that is arcsine and its siblings.
The last case is the best test of this lesson: the sine repeats every , so the equation has infinitely many solutions. Only restricting the domain to a single full run makes the function one-to-one and therefore invertible — and the graph of is the reflection of that restricted sine in the line , exactly as in the picture above.
Practice
The set checks four skills: the value of a composition at a point (work from the inside out), the formula of a composition after substitution, the formula of an inverse function, and one value of it — the last of which needs no formula at all, only the question "for which does the function give this value". Formulas may be typed in any equivalent spelling: (x−3)/2 and 0.5x−1.5 are both accepted. Proving the monotonicity of a composition stays with the theorem above — its answer is a chain of reasoning, not a number.
Practice
Work through a set of exercises — they get harder as you go. At the end you'll see your score and the mistakes worth reviewing.
Common mistakes
- Reading from the left — always start with the inner function, that is with .
- Assuming commutativity — and are in general two different functions.
- Skipping the domain of the composition — " is defined everywhere" is not enough; the value has to land in the domain of .
- Treating as — it is the inverse function, not the reciprocal.
- Inverting a function that is not one-to-one — without restricting the domain there is no inverse.
- Forgetting the third step — after solving for the variables have to be renamed so that the argument is called again.
Formula card
Topic: Composition and inverse functions
Composition of functions
g first, then f — read from the inside out
Order matters
composition is not commutative
One-to-one
the condition for an inverse to exist
The inverse function
undoes exactly what f did
Roles swapped
domain and range change places
The graph of the inverse
a reflection in the line y = x
