You are on page 1of 14

1.

4 Composition of Functions
1. Combining functions: We have looked at many ways of com-
bining functions: adding, subtracting, multiplying, dividing.

Making new from old: Let f and g be two real valued


functions with the same domain D and let a and b be two real
f
numbers. We define functions af + bg, f · g, and in the
g
following way:
(af + bg)(x) = af (x) + bg(x)
(f · g)(x) = f (x) · g(x)
 
f f (x)
(x) = if g(x) 6= 0
g g(x)

2. Example: Let f (x) = 2x + 1 and g(x) = x − 3. Evaluate


(a) (f − g)(2) =

(b) (f · g)(2) =
 
f
(c) (3) =
g

1
3. Another kind of combination is composition of func-
tions.
We have already looked at examples of this, where
we take one function of x, then another function of the result.
This is called composition of functions.
Problem: If f (x) = x2 and g(x) = 2x what is g(f (3))?

2
4. Example: Finding the composition g(f (x)).

The order here is: first do f , then calculate g of the result. Since
f (x) = x2
then
g(f (x)) =
Now we can answer: what is g(f (3))?

Notation: This is written as (g ◦f )(x). Do the function nearest


the variable first.

3
5. Two questions:
(a) Question: Can we always do this? Do f ◦ g and g ◦ f make
sense?

Example: If
f (x) = −x2
and

g(x) = x
when is g ◦ f defined?
First we find (g ◦ f )(x):

What is the domain?


So when does g ◦ f make sense?

4
(b) Question: Is it true that
g◦f =f ◦g ?
Usually not.
In the example we just looked at
f (x) = −x2
and

g(x) = x
what is
f ◦g ?

5
6. Composition of Functions: closed interval case.
Let f : [a, b] → [c, d] and g : [c, d] → R be two functions.
We define a new function F = [a, b] → R by
F (x) = g(f (x)), x ∈ [a, b].
The function F is called the composition of g and f and it
is denoted by F = g ◦ f .

Figure 1: The function composition of the functions f and g associates x from the domain of f
with g(f (x)) from the range of g.

6
7. Example: If f (x) = x2 and g(x) = 2x what is g(f (3))? What
is f (g(3))?

8. Example: Find (g ◦ f )(x) and (f ◦ g)(x) and their domains if


3 1
(a) f (x) = 3x + 2 and g(x) = − x +
4 2

1
(b) f (x) = 2x + 1 and g(x) =
x

7
Dollars to Pounds to Euros

9. You fly from YVR to Paris through London. You want to take
advantage of the shopping at London’s Heathrow airport, so you
decide to buy some pounds. After you are done shopping, you
still (amazingly) have some pounds, and you buy Euros with
them to spend in Paris.
The conversion rates used by the exchange company Travelex
are: 1 CAD buys 0.62 GBP, with a 2 dollar flat fee; and 1 GBP
buys 1.10 EUR with a 1 GBP flat fee.
(a) Write a function P = f (D) giving the cost of P pounds in D
dollars, and a function E = g(P ) giving the cost of E euros
in pounds.
(b) Is the function expressing the conversion of dollars to euros
f ◦ g or g ◦ f ? What is a formula for conversion from dollars
to euros (via pounds in the way described)?
(c) How many Euros do you get for $100 doing the exchange in
this way?
(d) Realistically you would probably just use a credit card, wouldn’t
you? But this is a math question.

8
10. Decomposition of functions: The process of breakdown of
a composite function into less complicated functions.

Figure 2: Decomposition of the oreo function

Given a function, is does it have an inside and an outside?


11. Examples: Express the given function as the composition of
two or more functions:
(a) F (x) = (2x + 1)2
Inside:

Outside:

Composition:

9
(b) G(x) = 3x2 + 1

(c) H(x) = 3(2x + 1)2 + 1

10
12. Identity function: The identity function is the function
I defined by
I(x) = x
for every real number x.

Figure 3: The identity function I(x) = x

13. Important observation: For any function f


f ◦ I = I ◦ f = f.
This is a technical mathematical idea that we use fairly often
when explaining, but which you will not need much in this course.

11
14. Definition: Linear function. A linear function is a func-
tion of the form
f (x) = mx + b
where m and b are any real numbers.
15. Examples: Which of the following functions is NOT linear:
(a) I(x) = x
(b) f (x) = −2x + 3
(c) g(x) = x2 + 1
(d) h(x) = −1

12
16. Four graphs:

Figure 4: The graph of a linear function is a straight line

13
17. Exercise: Prove that the composition of two linear functions a
linear function.
The word prove means: give a mathematical argument using the
definition of a linear function and the definition of composition
to show that you have to get a linear function when you take the
composition of two linear functions.
That is, you need to show that if f is a linear function and g is
a linear function, then f ◦ g is a linear function.
Start by answering: How do you write a general linear function
mathematically? (Hint: it’s on a slide before this one.)

14

You might also like