Suppose you are given the
two functions f
(x) = 2x + 3
and g(x)
= –x^{2} + 5.
Composition means that you can plug g(x)
into f
(x). This is
written as "(
f o
g)(x)",
which is pronounced as "f-compose-g
of x".
And "( f o g)(x)"
means "
f (g(x))".
That is, you plug something in for x,
then you plug that value into g,
simplify, and then plug the result into f.
The process here is just like what we saw on the previous page, except
that now we will be using formulas to find values, rather than just reading
the values from lists of points.

Given f(x)
= 2x + 3 and g(x)
= –x^{2} + 5, find
(g o
f )(1).

When I work with function
composition, I usually convert "(
f o
g)(x)"
to the more intuitive " f (g(x))"
form. This is not required, but I certainly find it helpful. In this
case, I get:

(g
o
f )(1) = g( f(1))

This means that, working
from right to left (or from the inside out), I am plugging x
= 1 into f(x),
evaluating f(x),
and then plugging the result into g(x).
I can do the calculations bit by bit, like this: Since
f(1) = 2(1) + 3 = 2 + 3 = 5,
and since g(5)
= –(5)^{2} + 5 = –25 + 5 = –20,
then (g o f
)(1) = g( f(1)) = g(5) = –20.
Doing the calculations all together (which will be useful later on when
we're doing things symbolically), it looks like this:

(g
o
f )(1) = g( f (1))
=
g(2( ) + 3) ...
setting up to insert the original input
=
g(2(1) + 3)
=
g(2 + 3)
=
g(5)
=
–( )^{2} + 5 ...
setting up to insert the new input
=
–(5)^{2} + 5
=
–25 + 5
=
–20

Note how I wrote each
function's rule clearly, leaving open parentheses for where the input
(x
or whatever) would go. This is a useful technique. Whichever method
you use (bit-by-bit or all-in-one), the answer is:

(g
o
f )(1) = g( f
(1)) = –20

I just computed
(g o
f )(1); the
composition can also work in the other order:

Given f(x)
= 2x + 3 and g(x)
= –x^{2} + 5, find
(
f
o
g)(1).

First, I'll convert this
to the more intuitive form, and then I'll simplify:

( f
o
g)(1) = f (g(1))

Working bit-by-bit, since
g(1)
= –(1)^{2} + 5 = –1 + 5 = 4,
and since f(4)
= 2(4) + 3 = 8 + 3 = 11,
then (
f o
g)(1) = f (g(1)) =
f(4)
= 11. On the other
hand, working all-in-one (right to left, or from the inside out), I
get this:

( f
o
g)(1) = f (g(1))
=
f (–( )^{2} + 5) ...
setting up to insert the original input
=
f (–(1)^{2} + 5)
=
f (–1 + 5)
=
f (4)
=
2( ) + 3 ...
setting up to insert the new input
=
2(4) + 3
=
8 + 3
=
11

A verbal note: "f
o
g" is not
pronounced as "fogg" and "g
o
f " is
not pronounced as "goff". They are pronounced as "f-compose-g"
and "g-compose-f
", respectively.
Don't make yourself sound ignorant by pronouncing these wrongly!

As you have seen above,
you can plug one function into another. You can also plug a function into
itself:

Given f(x)
= 2x + 3 and g(x)
= –x^{2} + 5, find
(
f
o
f
)(1).

( f
o
f )(1) = f ( f (1))
=
f (2( ) + 3) ...
setting up to insert the original input
=
f (2(1) + 3)
=
f (2 + 3)
=
f (5)
=
2( ) + 3 ...
setting up to insert the new input
=
2(5) + 3
=
10 + 3
=
13

Givenf(x) = 2x
+ 3 and g(x)
= –x^{2} + 5, find
(g
o
g)(1).

(g
o
g)(1) = g(g(1))
=
g(–( )^{2} + 5) ...
setting up to insert the original input
=
g(–(1)^{2} + 5)
=
g(–1 + 5)
=
g(4)
=
–( )^{2} + 5 ...
setting up to insert the new input
=
–(4)^{2} + 5
=
–16 + 5
=
–11

In each of these cases,
I wrote out the steps carefully, using parentheses to indicate where my
input was going with respect to the formula. If it helps you to do the
steps separately, then calculate g(1)
outside of the other g(x)
as a separate step. That is, do the calculations bit-by-bit, first finding
g(1)
= 4, and then plugging
4
into g(x)
to get g(4)
= –11.