Functions
Composite Functions

The next concept to cover is that of the composite function, that is, a 'function of a function'.

Worked Examples

1

The two functions f and g are defined by

f : x → 4x − 3

g : x → 2x − 1

(a)

Find f(g(x)) and g(f(x)),

Show me
f(g(x)) = 4(g(x)) − 3 since, for example, f(a) = 4a − 3, etc.
= 4(2x − 1) − 3
= 8x − 4 − 3
= 8x − 7
g(f(x)) = 2(f(x)) − 1
= 2(4x − 3) − 1
= 8x − 6 − 1
= 8x − 7
(b)

What are the values of f(g(0)) and g(f(0))?

Show me

f(g(0)) = 8 × 0 − 7 = − 7

g(f(0)) = 8 × 0 − 7 = − 7

(c)

Are there any solutions of f(g(x)) = g(f(x)) ?

Show me

As f(g(x)) = g(f(x)), then this is satisfied by all values of x.

Note

The result f(g(x)) = gf(x) is not generally true, but depends on the values of the coefficients in the functions (see Question 5 in Exercises).

Note

We usually write, for short,

f(g(x)) = fg(x)

and

g(f(x)) = gf(x)

but you must remember what this notation means.

2

The functions f and g are defined by

f : x → x2 + 1

g : x → x − 1

Will fg(x) = gf(x) for any value of x ?

Show me
fg(x) = f(g(x)) = (g(x))2 + 1
= (x − 1)2 + 1
= x2 − 2x + 1 + 1
= x2 − 2x + 2
gf(x) = g(f(x)) = f(x) − 1
= x2 + 1 − 1
= x2

If fg(x) = gf(x), then

x2 − 2x + 2 = x2
−2x + 2 = 0
2x = 2
x = 1

So fg(x) = gf(x) when x = 1.

Exercises

The functions f and g are defined as

f : x → g : x → 2x − 1

What is the value of

(a)
g(2)
(b)
f(−2)
(c)
fg(2)
(d)
gf(−2) ?

If f(x) = x − 1 and g(x) = x3 ,

(a)

find

(i)

fg(x)

(ii)

gf(x)

(b)

Does fg(x) = gf(x) have any solutions?

solutions

The functions f and g are defined by

f : x → g : x → x + 1

What is

(a)

fg(x)

(b)

gf(x) ?

f : x → x + 3

g : x → x − 3

What is

(a)

fg(x)

(b)

gf(x) ?

If

f(x) = ax + b, g(x) = cx + d

where a, b, c, d are constants, show that fg(x) = gf(x) only when ad + b = cb + d .

fg(x) =

gf(x) =