Form and evaluate composite functions, find their domain and range, find inverse functions algebraically, and split a function into a composite of simpler ones.
IB Mathematics: Analysis and Approaches
Part of 2 Functions
SL and HL
Key terms introduced here
Each is in the Maths AA glossary, with every other term in the subject.
, and explain why the order of composition matters.
Determine the domain and range of a composite function.
Use the identity function to verify that two functions are inverses of each other.
Find the inverse function f−1(x) algebraically and state its domain.
Find the inverse of a composite function using (f∘g)−1=g−1∘f−1.
Write a given function as a composite of two or more simpler functions.
Many processes happen in stages, with the output of one stage becoming the input of the next. A circular oil slick spreads so that its radius depends on time, and its area depends on its radius, so its area depends on time through the radius. Joining two functions in this way is called composition, and the result is a single new function.
Composition gives a precise way to describe what an inverse function does: it undoes the original function, so applying both in turn leaves every input unchanged. Composition also appears throughout calculus, where recognising a function as "a function of a function" is the first step of the chain rule.
Combining functions by composition
Function notation as substitution
The notation f(x) describes a rule applied to an input. Whatever appears inside the brackets replaces every x in the rule. For f(x)=3x−1, the input can be a number, an expression or another function's output:
f(4)=3(4)−1=11,f(a+2)=3(a+2)−1=3a+5,f(x2)=3x2−1
The input is always placed in brackets before it is substituted. Without brackets, f(a+2) would be written as 3a+2−1, which is a different expression. The same care is needed in every composite function, because the input of the second function is a whole expression.
The composite function f∘g
When the output of one function is used as the input of another, the result is a composite function. In the function machine, an input x first passes through g. Its output g(x) then passes through f, giving f(g(x)).
In f ∘ g the function written on the right, g, acts first. The two machines together behave as one function.
In f(g(x)), the function g is the inner function and f is the outer function. The order of the letters can seem backwards at first: f∘g is written with f first, but g acts first. Reading from the inside of the brackets outwards, as in f(g(x)), gives the correct order.
The notation f∘f means applying f twice: (f∘f)(x)=f(f(x)). Three or more functions can also be composed. For example, (f∘g∘h)(x)=f(g(h(x))), in which h acts first, then g, then f.
Evaluating a composite function at a number
To find the value of a composite function at a given input, work from the inside out: evaluate the inner function first, then use that value as the input of the outer function.
Finding an expression for a composite function
To find (f∘g)(x) as a single expression, substitute the whole expression for g(x) in place of every x in the rule for f. Brackets around the substituted expression prevent errors with signs and powers. Then simplify.
The two composites 2x2+1 and 4x2+12x+8 are different functions. In general f∘g=g∘f: composition, unlike addition or multiplication of numbers, is not commutative. A few pairs of functions do give the same composite in both orders, for example a function and its inverse, or two functions of the form x+a and x+b, but these are special cases that have to be checked.
Composite functions from a table or a graph
A function does not need a formula to be composed. When values are given in a table or read from a graph, the same inside-out rule applies: find the inner output, then look up that value as an input of the outer function.
The functions f and g in the next example are defined on the set {0,1,2,3,4} by this table of values.
x
0
1
2
3
4
f(x)
3
4
0
2
1
g(x)
2
0
4
1
3
Solving an equation such as (g∘f)(x)=4 reverses the process: undo the outer function first, then the inner one. This is the same order in which inverse functions are applied, an idea made precise later in the work on inverses of composites.
Unknowns inside a composite
Some problems give a composite and ask for one of the functions, or ask for a constant that makes two composites equal. Form the composite with the unknown in place and compare it with the given expression.
The domain and range of a composite function
When a composite function exists
A composite f∘g only makes sense for inputs x that g can accept, and whose outputs g(x) then lie in the domain of f. If some output of g falls outside the domain of f, then f cannot act on it and f(g(x)) is undefined for that x.
When the whole range of g lies inside the domain of f, every output of g can be used as an input of f, so f ∘ g is defined on the whole domain of g.
Finding the domain of a composite
The domain of f∘g is found in two steps:
Start with the domain of the inner function g.
Keep only those x for which g(x) is an allowed input of f.
Simplifying the final expression can hide a restriction, so the domain is found from the two functions, not from the simplified formula alone.
A restriction can come from a denominator as well as from a square root. When the outer function has a denominator, every x for which the inner function's output makes that denominator zero has to be excluded.
Finding the range of a composite
The range of f∘g is the set of values that f produces from the outputs of g. Find the range of g on its domain first, then find what f does to that set of values. Sketching the composite, or graphing it with a graphic display calculator (GDC), is a useful check.
The identity function and inverse functions
The identity function
The simplest of all functions leaves every input unchanged.
Composing any function with the identity function gives the same function back: (f∘I)(x)=f(x) and (I∘f)(x)=f(x). The identity plays the same role for composition that 0 plays for addition and 1 plays for multiplication.
Composing a function with its inverse
An inverse function f−1 reverses the effect of a one-to-one function f: if f maps a to b, then f−1 maps b back to a. Applying f and then f−1 therefore returns every input to where it started, and so does applying f−1 and then f.
(f∘f−1)(x)=(f−1∘f)(x)=x
The first composite holds for every x in the domain of f−1, and the second for every x in the domain of f. This gives an algebraic test: two functions f and g are inverses of each other when f(g(x))=x and g(f(x))=x on the relevant domains.
The domain matters in these identities. Consider f(x)=x2 with domain x≥0, whose inverse is f−1(x)=x. For any x≥0, f−1(f(x))=x2=x. If the same formulas are used with x=−3, then (−3)2=3, not −3. The identity fails because −3 is outside the domain of f, which was restricted to make f one-to-one. Restricting a domain in this way is developed in 2.14 (HL).
Finding an inverse function algebraically
The method
A function and its inverse swap the roles of input and output. Swapping x and y in the equation y=f(x) therefore gives an equation for the inverse, which is then rearranged to make y the subject.
Write y=f(x).
Interchange x and y.
Rearrange to make y the subject.
Write the result as f−1(x)=…
State the domain of f−1, which is the range of f.
Rearranging first and swapping afterwards gives the same result. The order of operations in f also shows what the inverse must do: f(x)=3x−4 multiplies by 3 and then subtracts 4, so f−1 adds 4 and then divides by 3, giving f−1(x)=3x+4.
The key algebraic step in that example is factorising out y after collecting all the y-terms on one side. The same step is used for every function of the form cx+dax+b, which are studied in 2.8.
Inverses of functions with roots and exponentials
When f involves a square root, the inverse involves a square. The domain of the inverse must then be stated with care, because a squaring function on its own is many-to-one.
An exponential function is undone by a logarithm, using ln(eu)=u from 1.5. The same five steps apply.
Choosing the correct square root
When the rule for f contains a square, rearranging produces a ± sign. The domain of f decides which sign to keep, because the outputs of f−1 must be the original inputs of f.
Where a graph meets its inverse
The graphs of y=f(x) and y=f−1(x) are reflections of each other in y=x, so any point where the graph of f crosses the line y=x is also on the graph of f−1. For an increasing function, every intersection of the two graphs lies on y=x, so the equation f(x)=f−1(x) can be replaced by the simpler equation f(x)=x. For a decreasing function, the graphs can also meet at pairs of points off the line y=x, so this shortcut is not valid in general.
The inverse of a composite function
To undo two processes carried out one after the other, they must be undone in the reverse order, in the same way that shoes are taken off before socks. If f∘g applies g first and f second, its inverse must undo f first and g second.
(f∘g)−1=g−1∘f−1
Decomposing a function into a composite
Recognising the inner and outer functions
Many complicated functions are built from simple ones by composition. Writing a function h as f∘g is called decomposing it. The inner function g is usually the expression that appears "inside" something else (inside a bracket raised to a power, under a root, in a denominator or in an exponent), and the outer function f describes what is done to it.
Function h(x)
Inner function g(x)
Outer function f(x)
(3x+1)5
3x+1
x5
x2+4
x2+4
(2x−7)31
2x−7
x31
ex2
x2
ex
ln(5−x)
5−x
lnx
Decomposition is a way of seeing structure, a theme of representation that runs through the course: the same rule can be read as one function or as a chain of simpler ones. It is used directly in the chain rule for differentiation (5.6), which differentiates f(g(x)) by treating the outer and inner functions separately.
A decomposition is not unique. The function (3x+1)5 could also be written with g(x)=(3x+1)2 and f(x)=x5/2 for suitable inputs, but such choices do not make anything simpler. A trivial decomposition such as g(x)=x and f=h is always possible and never useful. The helpful decomposition is the one in which both parts are standard functions whose behaviour is already known.
Composite functions in context
A quantity that depends on time through another quantity
In modelling, composition links quantities that depend on each other in a chain. If a quantity A depends on r, and r depends on time t, then A depends on t through the composite A(r(t)).
The order of operations in context
In a context, f∘g and g∘f describe two different procedures, and the order is often a real choice with real consequences.
Exam-style questions on composite and inverse functions
The first question rewards working that is set out in the order of the composition. The second shows how a simplified formula can carry a restriction from its inner function.
When a question asks for f−1(x), the domain of the inverse is often worth a separate mark. Find the range of f before rearranging, so that the domain of f−1 is ready to state at the end.
Self-check
To do:
I can find (f∘g)(a) by working from the inside out, using formulas, tables or graphs.
To do:
I can find expressions for (f∘g)(x), (g∘f)(x) and (f∘f)(x), and explain why f∘g and g∘f usually differ.
To do:
I can find the domain and range of a composite function, including restrictions from roots, denominators and logarithms.
To do:
I can use (f∘f−1)(x)=(f−1∘f)(x)=x
To do:
I can find f−1(x) by interchanging x and y and rearranging, and state its domain as the range of f.
To do:
I can find the inverse of a composite using (f∘g)−1=g−1∘f−1
To do:
I can write a function as a composite of simpler functions, ready for the chain rule.
To do:
I can set up and interpret a composite function in a real-life context.
, for
x∈R
.
(a)(i)
Find (g∘f)(x).
[1]1 mark
Markscheme (a)(i)
(g∘f)(x)=3sin(2x+1)A1
(a)(ii)
Find (f∘g)(x).
[1]1 mark
Markscheme (a)(ii)
(f∘g)(x)=6sinx+1
(b)
Solve the equation (g∘f)(x)=2, for 0≤x≤π.
[3]3 marks
Markscheme (b)
sin(2x+1)=32
(c)
Solve the equation (f∘g)(x)=(g∘f)(x), for 0≤x≤π
Question 2 · AA-00373HL only · 7 marks
Consider the expression cos(arcsinx), where −1≤x≤1.
Parts (a) and (b) give different answers, so composing the same two functions in a different order gives a different result.
.
(f∘g)(x)=f(x2−1)=2(x2−1)+3=2x2+1
(b) Replace x in g(x)=x2−1 by f(x)=2x+3.
(g∘f)(x)=g(2x+3)=(2x+3)2−1=4x2+12x+9−1=4x2+12x+8
(c) Replace x in f(x) by f(x) itself.
(f∘f)(x)=f(2x+3)=2(2x+3)+3=4x+9
Check: (g∘f)(2)=4(4)+12(2)+8=16+24+8=48, which agrees with the value found by working from the inside out.
, so
(g∘f)(1)=g(4)=3
. Also
f(3)=2
, so
(f∘f)(3)=f(2)=0
.
(c) Work from the outside in. The outer function is g, and the table shows g(2)=4, so the input of g must be 2. That means f(x)=2, and the table shows f(3)=2. So x=3.
Check: (g∘f)(3)=g(f(3))=g(2)=4.
(d) f−1(0) is the input of f that gives the output 0. Since f(2)=0, f−1(0)=2.
for all
x
. Find the value of
a
.
Check: f(3x2−2)=2(3x2−2)+1=6x2−3.
(b) Find both composites.
(p∘q)(x)=2(3x−1)+a=6x−2+a
(q∘p)(x)=3(2x+a)−1=6x+3a−1
Both have x-coefficient 6, so they are equal for all x exactly when the constant terms are equal.
−2+a=3a−1⇒−1=2a⇒a=−21
.
The input of f must be non-negative, so x−3≥0, which gives x≥3. The domain of f∘g is x≥3.
(b) (g∘f)(x)=g(x)=x−3.
Here the inner function is f, whose domain is x≥0. Every output of f is a real number, which g accepts, so the domain of g∘f is x≥0.
For the range: as x runs through x≥0, x takes every value x≥0, so x−3 takes every value from −3 upwards. The range of g∘f is y≥−3.
.
The input of f cannot be 2, so g(x)=2.
x2+1=2⇒x2=1⇒x=±1
The domain of f∘g is x∈R, x=±1.
(b) (g∘f)(x)=g(x−21)=(x−2)21+1.
The inner function f is defined for x=2, and g accepts every real number, so the domain of g∘f is x∈R, x=2.
.
(b) The input of ln must be positive.
4−x2>0⇒x2<4⇒−2<x<2
(c) For −2<x<2, the inner function 4−x2 takes its largest value 4 at x=0 and approaches 0 as x approaches ±2. So the outputs of g on this domain are 0<g(x)≤4.
The function ln is increasing, so it maps 0<u≤4 to all values up to ln4, and takes arbitrarily large negative values as u approaches 0. The range of f∘g is y≤ln4.
y = ln(4 − x²)
The composite exists only for −2 < x < 2, where 4 − x² is positive. Its greatest value is ln 4 at x = 0, and it falls without limit near x = ±2.
(g∘f)(x)=g(2x+3)=2(2x+3)−3=x+3−3=x
Both composites equal the identity function for all real x, so f and g are inverses of each other: g=f−1.
.
x=y−32y+1
Multiply both sides by y−3, then collect the terms in y on one side.
(b) The formula is undefined at x=2. This matches the range of f: the graph of f has a horizontal asymptote y=2, so f(x) takes every real value except 2. The domain of f−1 is x∈R, x=2.
(c) f(4)=19=9 and f−1(9)=9−227+1=728=4, which returns the original input.
upwards, so
f(x)≥2
. The range of
f
is
y≥2
.
(b) Write y=x−1+2 and interchange x and y.
xx−2(x−2)2y=y−1+2=y−1=y−1=(x−2)2+1
So f−1(x)=(x−2)2+1, with domain x≥2 (the range of f).
Without the domain, (x−2)2+1 would be a whole parabola, which is not the inverse of f.
(c) The graph of f−1 is the reflection of the graph of f in the line y=x. The endpoint (1,2) of f reflects to the endpoint (2,1) of f−1, and the point (5,4) reflects to (4,5).
y = f(x)
y = f⁻¹(x), x ≥ 2
y = x
Each point (a, b) on y = f(x) has a partner (b, a) on y = f⁻¹(x). Only the right half of the parabola is the inverse, because its domain is the range of f.
.
Write y=e2x+1 and interchange x and y.
xx−1ln(x−1)y=e2y+1=e2y=2y=21ln(x−1)
So f−1(x)=21ln(x−1), with domain x>1. The formula itself needs x−1>0, which agrees with the range of f.
y≥3
.
Write y=(x−1)2+3 and interchange x and y.
x=(y−1)2+3⇒(y−1)2=x−3⇒y−1=±x−3
The outputs of f−1 are the inputs of f, so y≥1, which means y−1≥0. Keep the positive root.
f−1(x)=1+x−3,x≥3
and
y
in
y=2x+6
gives
x=2y+6
, so
(f∘g)−1(x)=2x−6
.
Method 2: use (f∘g)−1=g−1∘f−1, with f−1(x)=2x and g−1(x)=x−3.
(g−1∘f−1)(x)=g−1(2x)=2x−3=2x−6
Both methods give 2x−6. Using f−1∘g−1 instead would give 2x−3, which is wrong.
x
, each of which performs a single operation.
Check: f(g(x))=f(2x−5)=2x−5=h(x).
(b) Follow what happens to x, in order: add 2, then square, then multiply by 3 and subtract 4.
Other answers are possible, for example p could itself be split into "multiply by 3" and "subtract 4".
. It gives the area of the slick, in square metres,
t
minutes after the leak starts.
(b) (A∘r)(10)=9π(100)=900π≈2830m2 (3 s.f.).
(c) Solve 9πt2=1000.
t2=9π1000=35.367…⇒t=5.9470…
The negative root is rejected because t≥0. The area reaches 1000m2 after about 5.95 minutes.
. The voucher is applied first, then the discount is taken off the reduced price.
(V∘D)(x)=V(0.8x)=0.8x−10. The discount is applied first, then the voucher is taken off.
(b) (D∘V)(x)−(V∘D)(x)=(0.8x−8)−(0.8x−10)=2. Applying the discount first and then the voucher is cheaper by USD 2, whatever the full price. The discount reduces the voucher's value when the voucher is applied first, because only 80% of the USD 10 is then saved.
(b) "Hence" means use the answer to (a). Factorise (M1).
4x2+12x+5=(2x+1)(2x+5)=0
So x=−21 or x=−25 (A1).
Check: f(−21)=2 and g(2)=0.
(c) Interchange x and y in y=2x+3 (M1): x=2y+3, so f−1(x)=2x−3 (A1).
(d) g(3)=9−4=5 (M1), so (f−1∘g)(3)=f−1(5)=25−3=1 (A1).
(e) From (a), (g∘f)(x)=(2x+3)2−4. Since (2x+3)2≥0, with equality when x=−23, the smallest value is −4 (M1). The range is (g∘f)(x)≥−4 (A1).
, as given. Every line is written, because "show that" needs each step towards the given answer.
(b) The inner function is f, so the domain of g∘f is the domain of f: x≥2. On this domain x−1≥1, so the range is (g∘f)(x)≥1.
(c) Two functions are equal only if they have the same rule and the same domain. The function h is defined for all real x, but g∘f is defined only for x≥2.
(d) (f∘g)(x)=f(x2+1)=x2+1−2=x2−1.
The input of f must be at least 2, so x2+1≥2, which gives x2≥1. The largest possible domain is x≤−1 or x≥1.
(e) The range of f is y≥0. Interchange x and y in y=x−2: x=y−2, so x2=y−2 and f−1(x)=x2+2, with domain x≥0.
to verify that two functions are inverses.
.
A1
and
1≤2x+1≤2π+1
(M1)
2x+1=2.41186…, 7.01291…(A1)
Note: Award (M1)(A1) for a correct graph showing two intersections.
x=0.706, x=3.01(0.705932…,3.00645…)A1
Note: Award (M1)(A1)A0 if x=−0.135 (from 2x+1=0.729727…) is included.
.
[2]2 marks
Markscheme (c)
use of GDC to find the intersections of y=6sinx+1 and y=3sin(2x+1)(M1)
x=0.337, x=2.99(0.337014…,2.98817…)A1
and the geometric transformation represented by
g
.
[2]2 marks
(c)
Let z=x+yi, where x,y∈R. Show that (g∘f)(z)=y+xi, and hence describe fully the single geometric transformation represented by g∘f.
[3]3 marks
(d)
The function T is defined by T(z)=iz∗+2+2i, for z∈C.
Show that there is no complex number z such that T(z)=z.
[3]3 marks
(e)
Find T(T(z)) in its simplest form, and describe fully the geometric transformation it represents.
[3]3 marks
(f)
Show that, for every z∈C, the midpoint of the points representing z and T(z) lies on the line Im(z)=Re(z).