# Combinations of Functions

#### Scatter Plot

Contents: This page corresponds to § 1.6 (p. 138) of the text.

Suggested Problems from Text

p. 145 #1, 2, 5, 6, 9, 12, 13, 14, 19, 23, 24, 26, 31, 35, 36, 39, 41, 44, 45, 49, 52, 55, 57, 61, 62, 65, 68

## 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.

(f + g)(x) = f(x) + g(x) = ( x2 + 3x -7 ) + ( 4x +5) = x2 + 7x - 2.

So, (f + g)(3) = 32 +7*3 -2 = 28, which agrees with our previous answer.

Note on Domains:

Generally, an arithmetic combination of two functions f and g at any x that is in the domain of both f and g, with one exception. The quotient f/g is not defined at values of x where g is equal to 0.

For example, if f(x) = 2x + 1 and g(x) = x - 3, then the doamins of f+g, f-g, and f*g are all real numbers. The domain of f/g is the set of all real numbers except 3, since g(3) = 0..

Example 2. Let f(x) = x2 - 9, and g(x) = x - 3. Simplify the formula for f / g.

(f / g)(x) = f(x) / g(x) = (x2 - 9)/( x - 3) = (x + 3)(x - 3)/(x - 3) = x + 3.

(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.

Exercise 1:

Find f + g, f - g, f * g, and f / g for f(x) = x2 - 3x + 2, g(x) = x - 2. Note: f can be factored. We will cover the factoring of polynomials in the next Unit. Answer

The * is often not written for products, so you will see fg used to denote the product f*g.

## 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.

(f ° g)(x) = f(3x - 2) = (3x - 2)2 - (3x - 2) + 1 = (9x2 -12x + 4)-(3x-2)+1 = 9x2 - 15x + 7.

(g ° f)(x) = g(x2 - x + 1) = 3(x2 - x + 1) -2 = 3x2 - 3x + 1.

Using these formulas, we get the same results that we got in the previous example:

(f ° g)(5) = 9*25 -15*5 +7 =157.

(g ° f)(5) = 3*25 -3*5 +1 = 61.

Exercise 2:

Let f(x) = x2 -3x + 4 and let g(x) = x + 1.

(a) Simplify the formula for f(g(x)).

Open the Calculator, enter the formulas for f and g, and in the h box. Enter your simplified formula for f(g(x)).

In the calculation window, evaluate f(g(5)) and h(5). If the formula you entered in h is a correct simplification of f(g(x)), then these two values should agree.

Try the experiment with two values other than 5.