Suppose you are given the
two functions f
(x) = 2x + 3
and g(x)
= –x2 + 5.
Composition means that you can plug g(x)
into f
(x). This is
written as "(
fog)(x)",
which is pronounced as "f-compose-g
of x".
And "( fog)(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)
= –x2 + 5, find
(gof )(1).

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

(gof )(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: Sincef(1) = 2(1) + 3 = 2 + 3 = 5,
and since g(5)
= –(5)2 + 5 = –25 + 5 = –20,
then (gof
)(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:

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:

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

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

Given f(x)
= 2x + 3 and g(x)
= –x2 + 5, find
(
fog)(1).

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

A verbal note: "fog" is not
pronounced as "fogg" and "gof " 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:

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.