Composition of Functions
Definition: For functions f and g, define f ◦ g, the composition of f and g by,
Math 140 Lecture 6
(f ◦exercises.
g)(x) = f (g(x))
Study Practice Exam 1 and the recommended
Functions can be added and multiplied just like numbers.
DEFINITION. For functions f, g, define f +g, f - g, f.g, f /g
by Dom(f ◦ g) = {x ∈ dom(g)|g(x) ∈ dom(f )}
(f + g)(x) = f (x) +g(x),
Note: (f +g)(x) is not (f +g).(x)
Example: Suppose f (x) = x − 2 and g(x) = x2 .
(f - g)(x) = f (x)- g(x),
The first is function application.
(fg)(x)
=
f
(x)g(x),
(a) Find (f ◦ g) and (g ◦ f ).The second is multiplication.
(f /g)(x) = f (x)/g(x).
Write each function below as a composition
f (g(x))
of two simpler functions,
an outer function f and an inner function g.
Find the inner function first.
`Write x 2
x2 2 6
„
x6
2 6 as a composition f g x .
inner function g x x 2 2
outer function f x does what remains
to be done. t
f x x6.
check: f g x
f x2 2
x2 2 6.
`If f (x) (f
= x◦-g)(x)
2, g(x)
6, then
= f=(g(x))
= f (x2 ) = x2 − 2
(f + g)(x) = f (x) + g(x) = (x- 2) + (6) = x + 4,
(g =
◦ ff (x)
)(x)-=g(x)
g(f (x))
g(x-−
2) ==x(x
= (x =
- 2)
(6)
-−
8,2)2 = x2 − 4x + 4 `Write 4 1x
(f-g)(x)
(fg)(x)
= f (x)g(x)
4 1x 3
***Note:
(f ◦ =g)(x-2)(6)
6= (g ◦ f ) = 6x-12,
1
1
(f /g)(x) = f (x)/g(x) = (x-2)/6 = 6 x 3 .
„
4x 3
(b) Find
◦ g)(2) and
(g ◦ g,
f )(2).
DEFINITION
. For(ffunctions
f and
define fog, the
composition of f and g, by
(f ◦ g)(2) = f (g(2)) = f (22 ) = f (4) = 4 − 2 = 2
(fog)(x) = f (g(x))
(g ◦x.fGet
)(2) g(x).
= g(f Apply
(2)) = g(2
2) = g(0)
02 = 0
Apply g to
f to−g(x).
Get f=(g(x)).
f is the outer function; g is the inner function.
3 as a composition f g x .
1
inner function g x
x
outer function f x does what remains
to be done. t
f x 4x 3.
check: f g x
f
1
x
4
1
x
3.
`Write x 1 as a composition.
Example: For f (x) = 3x + 4 and g(x) = 5, find (f ◦ g) and (g ◦ f ). x 1
`Suppose f (x) = x-2 and g(x) = x2.
„
gx x 1
(f ◦and
g)(x)
= f (g(x)) = f (5) = 3(5) + 4 = 19
(a) Find fog
gof.
x
f x
x
(fog)(x) = f(g(x)) = f (x2) = x2-2.
f x 1
x 1.
2
2
check: f g x
(gof)(x) (g
= g(f(x))
g(x-2)
◦ f )(x)= =
g(3x=+(x-2)
4) ==5 x - 4x + 4.
Note that f og = gof. For composition, order matters.
`Write x 4 x 2 1 as a composition.
(b) Example:
Find (fog)(2).
For f and g below, note that
x 4 x 2 1 x 2 2 x 2 1.
Since (fog)(x)
-2,f(fog)(2)
4-23,=f2.
f (−3) ==x21,
(−1) = =2,2f2-2
(2)= =
(4) = 2, and
g x x2
= −1,
= −2,
g(1) = without
−1, g(2) (fog)(x),
= 2.
(b’) Findg(−2)
(fog)(2)
andg(−1)
(gof )(2)
directly
f x x2 x 1
(gofFind:
)(x).
check: f g x
f x 2 x 4 x 2 1.
(fog)(2) = f(g(2)) = f(2 2) = f(4) = 4-2 = 2.
= 0.
(gof)(2)(f
= g(f(2))
= g(0)
02 =
◦ g)(2)==g(2-2)
f (g(2))
= f=(2)
3,
`Write x / 1
x as a composition of 2 functions.
`If h(x) = c, then h(8) = c, h(y) = c, h(x -1) = c, h(g(x)) = c. `Write 1/ 1 |x| as a composition of 3 functions.
Ans h f g x , g x |x|, f x 1 x, h x 1/x
(g ◦ f )(2) = g(f (2)) = g(3) = undefined,
`For f (x)
= 3x+4, g(x) = 5, find fog and gof.
2
f(g(x)) = f(5) = 3.5+4 = 19.
◦ f )(−1)
g(f(x)) =(fg(3x+4)
= 5.= f (f (−1)) = f (2) = 3
DEFINITION. id(x) = x is called the identity function.
id(x)=x
f(x)
g(x)
Hence id(5) = 5, id(y) = y, id(x2-1) = x2-1, ... .
THEOREM. For any function f (x), foid = f and idof = f.
PROOF. ( foid)(x) = f (id(x)) = f (x).
(idof )(x) = id(f (x)) = f (x).
For f and g above, note that
f(-3) = 1, f(-1) = 2, f(2) = 3, f(4) = 2, and
g(-2) = -1, g(-1) = -2, g(1) = -1, g(2) = 2.
Find
0 is the identity for addition, since f + 0 = 0 + f = f .
(fog)(2) = f(g(2)) = f(2) = 3.
(gof)(2) = g(f(2)) = g(3) = undef.
(fof)(-1) = f(f(-1)) = f(2) = 3.
`f x
x
1
,ffx
x
1
1
1/ x
1
x
1 is the identity for muliplication,
1
x
f .1 = 1. f = f .
id(x) is the identity for composition, since
Example: f (x) = x + x1 . Find (f ◦ f ).
(f ◦ f )(x) = f (f (x)) = (x + x1 ) + ( x+1 1 ) = x +
x
1
x
+
x
x2 +1
Next we want to write a function as a composition of 2 simpler functions.
Example: Write (x2 + 2)6 as a composition f (g(x)).
(x2 + 2)6 has an inner function g(x) = x2 + 2.
Then the outer function f (x) does what remains to be done: f (x) = x6 .
Check: f (g(x)) = f (x2 + 2) = (x2 + 2)6 .
Example: Write 4 x1 + 3 as a composition f (g(x)).
4( x1 ) + 3 as inner function g(x) = x1 .
Then the outer function f (x) does what remains to be done: f (x) = 4x + 3.
Check: f (g(x)) = f ( x1 ) = 4( x1 ) + 3.
Example: Write
√
√
x + 1 as a composition f (g(x)).
x + 1 has inner function g(x) = x + 1
So f (x) =
√
x.
Check: f (g(x)) = f (x + 1) =
√
x + 1.
Example: Write x4 + x2 + 1 as a composition.
x4 + x2 + 1 = (x2 )2 + x2 + 1.
⇒
g(x) = x2
⇒
f (x) = x2 + x + 1.
Check: f (g(x)) = f (x2 ) = (x2 )2 + x2 + 2 = x4 + x2 + 1.
Example: Write
1
1+|x|
as the composition of 3 functions h(f (g(x))).
1
1+|x|
has inner function g(x) = |x|
1
(1+x)
has inner function f (x) = 1 + x
Thus h(x) = x1 .
Check: h(f (g(x))) = h(f (|x|)) = h(1 + |x|) =
2
1
1+|x|
f f -1
ff
-1
h h-1
uouback
backx.x.
x x&&f -1f (f-1(f(x))
==
xx
=
(x))
Inverse
Functions
By
f f (x)(x)iffifff (y)
==
x.x.Thus
Bythe
theTheorem,
Theorem,y =y =
f (y)
Thusthe
thegraph
graphofof
-1
-1
-1
y y= =
f f (x)
-1 is the graph of f (y) = x which is just the graph
(x) inverse
is the graph
ofthe
f (y)function
= x which
thesuch
graph
Definition:
The
of f , is
g (ifisitjust
exists)
that
ofoff (x)
=
y
with
x
and
y
interchanged.
Interchanging
f (x) = y with x and y interchanged. Interchangingx x
the
y =yof
x.x.
st undo
them
(f ◦the
g)(x)
= xaround
where
xmajor
is indiagonal
the
domain
g and
andy yreflects
reflects
theplane
plane
around
themajor
diagonal
=
must
undo
theminin and
1
1
Hence
isisf f 1g g 1x x. .
where x is in the domain of f
Hence (g ◦ f )(x) = x
me.
ame.
.d.
-1
THEOREM
. The
graph
ofof
y =y =
f f (x)
reflection
ofof
the
If such
function
g exists,
we
denote
f-1−1
g,the
i.e.
f −1 (x) =
g(x).
THEOREM
. The
graph
(x)is=isthe
reflection
the
graph
f (x)
graphofofy =y =
f (x)across
acrossthe
themajor
majordiagonal
diagonaly y= =x.x.
***Note: f −1 (x) 6= (f (x))−1 .
For
function,
f (x),
x,x,
Foreach
each
function,draw
drawthe
thethree
threegraphs
graphsy =y =
f (x),y =y =
-1 the inverse of f (x) and (f (x))−1 = 1 is the reciprocal of f (x).
f −1
(x)
is
y y= =f f (x)
-1 on the same coordinate system.
f (x)
(x) on the same coordinate system.
3
`f
(x)(x)
=f=
x(x)
Example:
`f
x33 = 2x, g(x) = x2
`f
(x)(x)
==
-x
3
Consider
f -x
(g(x))
= f ( x2 ) = 2( x2 ) = x and g(f (x)) = g(2x) =
`f
an inverse function of f (x). I can write f −1 (x) = g(x) = x2 .
2x
2
= x. Thus, g(x) is
DD
EFINITION. f is 1-1 (“one-to-one”) iff
EFINITION. f is 1-1 (“one-to-one”) iff
x
=x =
y yimplies
f (x)
==
f (y).
implies
f (x)
f (y).
Definition:
f is 1-1 (”one-to-one”)
⇐⇒ x1 6= x2 implies f (x1 ) 6= f (x2 ).
`f
(x)
=
3x
is
1-1
x
=
y
ˆ
3x3x
==
3y3y
`f (x) =23x is 1-1
x=y ˆ
2
Example:
fx(x)
3x is 1-1 1but
f (x)
=
is
not
=
-1
but
(-1)
121. 2.
2 =
f (x) = x is2 not
1 = -1 but (-1)=2 =
2
2
g(x) = x is not 1-1 since 1 6= −1 but (−1) = 1 .
THEOREM
. The
THEOREM
. Thefollowing
followingare
areequivalent:
equivalent:
v
f
has
an
inverse
Horizontal
Line
Test: If every horizontal line intersects the graph of a function f in at
v f has
an inverse
v vone
f fispoint,
1-1
most
then
f is one-to-one.
is 1-1
v vnonohorizontal
horizontalline
lineintersects
intersectsitsitsgraph
graphmore
morethan
thanonce.
once.
`Which
ofofthe
functions
has
Example:
Which
of following
the
following
has an inverse?
`Which
the
following
functions
hasananinverse?
inverse?
Answer:
The first graph has an
-1 inverse and the second graph doesn’t.
T
HEOREM. The domain of f -1
THEOREM
. The domain of f isisthe
therange
rangeofoff. f.The
Therange
rangeofof
-1
domain
of
f
.
f f -1isisthe
the domain of f .
1,1,b b 7,7,c c x.xTheorem:
diagonal
The
function
faround
has
an the
inverse
if and
only if fwhich
is 1-1.
. Proof.
Proof.The
Thereflection
reflection
around
themajor
major
diagonal
which
-1
carries
carriesthe
thegraph
graphofoff ftotothe
thegraph
graphofoff f -1also
alsocarries
carriesthe
the
-1
domain
of
f
to
the
range
of
f
and
the
range
of
f
to
the
-1
domain
of
f
to
the
range
of
f
and
the
range
of
f
to
the
Theorem:
y =off −1
(x)
⇐⇒
f (y) = x.
-1
domain
f
.
-1
domain of f .
7
ce
ncey y 2 .72 .
Stated
full,
Statedinin
full,the
theinverse
inverseisisthe
thecompositional
compositionalinverse.
inverse.
−1
ToFor
findaddition,
(x) forthe
complicated
Forfaddition,
theinverse
inverseinfunctions:
innegation.
negation.
(1)For
Switch
x and y in ythe
= finverse
(x), i.e. is
write
x = f (y).
multiplication,
theyou
inverse
isthe
thereciprocal.
(2) For
Solvemultiplication,
for y. After that
can replace
yreciprocal.
by f −1 (x).
Example: f (x) = x3 , find f −1 (x).
f (y) = x ⇐⇒ y 3 = x ⇐⇒
1
y = x3
3
⇐⇒
1
f −1 (x) = x 3 .
7
ction, if any,
and
Example: f (x) =
2x+1
x−1 ,
find f −1 (x).
y = 2x+1
x−1
x = 2y+1
y−1
x(y − 1) = 2y + 1
xy − x = 2y + 1
xy − 2y = x + 1
y(x − 2) = x + 1
x+1
y = x−2
Now let’s look at how the graph of f is related to the graph of f −1 .
`If f (x) = x+3 then f -1(x) = x-3.
-1 = x. Thus the graph of y = f −1 (x) is the graph of f (y) = x
Since
y = =f −1
⇐⇒ g
f (y)
If g(x)
x/2(x) then
(x) = 2x.
whichIf
is h(x)
just the
of f (x)
x and
y interchanged. Interchanging x and y reflects
= graph
h -1=
(x)y=with
x2 for
x > 0.
x then
the plane around the major diagonal y = x.
Note how the graph of f is related to the graph of f -1.
g-1
h
g
-1
-1
f
f
h
u back x.
x & f -1(f (x)) = x
Theorem:
The graph yof=yf -1
=(x)
f −1
is =
the
the graph
By the Theorem,
iff(x)f (y)
x. reflection
Thus the ofgraph
of of y = f (x) across the
major diagonal
y = x.
-1
y = f (x) is the graph of f (y) = x which is just the graph
of f (x) = y with x and y interchanged. Interchanging x
and y The
reflects
the of
plane
the major
diagonal
y =f −1
x. is the domain of f .
domain
f −1 around
is the range
of f . The
range of
st undo them inTheorem:
1
1
Hence
is f g x .
me.
THEOREM. The graph of y = f -1(x) is the reflection of the
graph of y = f (x) across the major diagonal y = x.
For each function, draw the three graphs y = f (x), y = x,
y = f -1(x) on the same coordinate system.
`f (x) = x3
`f (x) = -x 3
DEFINITION. f is 1-1 (“one-to-one”) iff
x = y implies f (x) = f (y).
`f (x) = 3x is 1-1
f (x) = x 2 is not
x = y ˆ 3x = 3y
1 = -1 but (-1) 2 = 12.
THEOREM. The following are equivalent:
v f has an inverse
v f is 1-1
v no horizontal line intersects its graph more than once.
`Which of the following functions has an inverse?
4
-1
© Copyright 2026 Paperzz