Arithmetic Combinations

The sum, difference, product and quotient of two functions f and g are defined as follows.

Sum

(f + g)(x) = f(x) + g(x)

Difference

(f - g)(x) = f(x) - g(x)

Product

(f * g)(x) = f(x) * g(x)

Quotient

(f / g)(x) = f(x) / g(x)

Example 1. Let f(x) = x2 + 3x -7, and g(x) = 4x +5.

(f + g)(3) = f(3) + g(3) = 11 + 17 = 28,

(f / g)(2) = f(2) / g(2) = 3 / 13,

Note that we could evaluate the function f + g at any number by evaluating f and g separately and adding the
results, as we did above for 3. However, we generally simplify the formula for f + g by combining similar terms,
then use this new formula to evaluate the sum function.

There is a technical point to be made about this example that is often ignored in precalculus classes.

(f / g)(x) is not equal to the function h(x) = x + 3, because f / g is not defined at x = 3, while h
is. There is really no harm in thinking of f / g as being the same as h, but they are different functions.

Try this experiment:

Open the Java Calculator and type (x^2-9)/(x-3) in the f box, and type x+3
in the h box. In the calculation window, type h(3) and press enter. The answer 6 is returned. Now evaluate f at
3 by typing f(3) and pressing enter.

Composition of Functions

The composition of two functions f and g is defined by (f ° g)(x) = f(g(x)).

Example 3. Let f(x) = x2 - x + 1, and g(x) = 3x - 2.

(f ° g)(5) = f(g(5)) = f(13) = 157.

(g ° f)(5) = g(f(5)) = g(21) = 61.

Notes on Composition:

Do not confuse the composition (f ° g) with the product (f*g). The composition (f ° g)(x) means "evaluate
g at x, then evaluate f at the result g(x)". The product (f*g)(x) means "evaluate f and g at x and multiply
the results".

Composition is not commutative. In other words, f ° g is generally not equal to g ° f. (See the example
above.)

While (f ° g)(x) can be evaluated at any x by evaluating g at x, then evaluating f at the result, we often
wish to simplify the formula for the composition.

Example 4. Use the same functions as in the last example, f(x) = x2 - x + 1,
and g(x) = 3x - 2.