You can also evaluate compositions
symbolically. It is simpler to evaluate a composition at a point because
you can simplify as you go, since you'll always just be plugging in numbers
and simplifying. Evaluating a symbolic compositon, where you're first
plugging x
into some function and then plugging that function into some other function,
can be much messier. But the process works just as the at-a-number composition
does, and using parentheses to be carefully explicit at each step will
be even more helpful.

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

In this case, I am not
trying to find a certain numerical value. Instead, I am trying to find
the formula that results from plugging the formula for g(x)
into the formula for f(x).
I will write the formulas at each step, using parentheses to indicate
where the inputs should go:

( f
o
g)(x) = f (g(x))
=
f (–x^{2} + 5)
=
2(
) + 3 ...
setting up to insert the input formula
=
2(–x^{2} + 5) + 3
=
–2x^{2} + 10 + 3
=
–2x^{2}
+ 13

If you plug in "1"
for the x
in the above, you will get (
f o
g)(1) = –2(1)^{2} + 13 = –2 + 13 = 11,
which is the same answer we got before.
Previously, we'd plugged a number into g(x),
found a new value, plugged that value into f(x),
and simplified the result. This time, we plugged a formula into f(x),
simplified the formula, plugged the same number in as before, and simplified
the result. The final numerical answers were the same. If you've done
the symbolic composition (the composition with the formulas) correctly,
you'll get the same values either way, regardless of the value you pick
for x.
This can be a handy way of checking your work.

There is something you
should note from these two symbolic examples. Look at the results I got:

( f
o
g)(x) = –2x^{2} + 13
(g
o
f )(x) = –4x^{2} – 12x – 4

That is, (
f o
g)(x) is
not the same as (g
o
f )(x). This
is true in general; you should assume that the compositions (
f o
g)(x)
and (g
o
f )(x)
are going to be different. In particular, composition is not the
same thing as multiplication. The open dot "o"
is not the same as a multiplication dot "•", nor does it mean
the same thing. While the following is true:

( f
o
g)(x) = (g o
f )(x)
[generally false
for composition]

That is, you cannot reverse
the order in composition and expect to end up with the correct result.
Composition is not flexible like multiplication, and is an entirely different
process. Do not try to multiply functions when you are supposed to be
plugging them into each other.

You can use the Mathway widget below to
practice function composition.
Try the entered exercise, or type in your own exercise. Then click the "paper-airplane" button to compare your answer to Mathway's. (Or skip the widget and continue
with the lesson.)