Week 3
Topic 3. Combinations of Functions (Stewart, pp. 36 – 45)
1 Operations between functions
Operations between two functions f and g are defined as follows, for any x ∈ Df ∩ Dg ,
Sum: (f + g)(x) = f (x) + g(x)
Difference: (f − g)(x) = f (x) − g(x)
Product: (f · g)(x) = f (x) · g(x)
f f (x)
Quotent: (x) = , g(x) ̸= 0
g g(x)
Notice that
Df +g = Df −g = Df ·g = Df ∩ Dg and Df /g = Df ∩ Dg \ {x ∈ Dg | g(x) = 0}
√ √
Example 1. Determine f + g and Df +g , where f (x) = x and g(x) = 2−x
Solution: By definition
√ √
(f + g)(x) = f (x) + g(x) = x+ 2−x
Notice that Df = [0, ∞) and Dg = (−∞, 2]. Thus
Df +g = Df ∩ Dg = [0, ∞) ∩ (−∞, 2] = [0, 2]
Example 2. Determine f /g en Df /g , where f (x) = x2 and g(x) = x − 1
Solution: By definition
x2
f f (x)
(x) = =
g g(x) x−1
Notice that Df = R = Dg , but g(x) = 0 for x = 1. Thus
Df /g = Df ∩ Dg ) \ {x ∈ Dg | g(x) = 0} = R \ {1} = (−∞, 1) ∪ (1, ∞)
x √
Example 3. Determine f · g and Df ·g , where f (x) = √ and g(x) = x
x2−1
Solution: By definition
√
x √ x x
(f · g)(x) = √ · x= √
x2 − 1 x2 − 1
1
Notice that
Df = {x ∈ R | x2 − 1 > 0} = (−∞, −1) ∪ (1, ∞) and Dg = [0, ∞)
Thus
Df ·g = (−∞, −1) ∪ (1, ∞) ∩ [0, ∞) = (1, ∞)
2 Composition of functions
Definition 4. The composite function f ◦ g of f with g is defined as
(f ◦ g)(x) = f g(x) , where x ∈ Dg en g(x) ∈ Df
and its domain is Df ◦g = {x ∈ Dg | g(x) ∈ Df }
Stated differently, (f ◦ g)(x) means that we first apply g on x, then apply f on the result.
Example 5. Determine (f ◦ g)(−1), (g ◦ f )(−1), as well as (f ◦ g)(x) and (g ◦ f )(x), where
f (x) = x2 and g(x) = x − 3
Solution: By definition
(f ◦ g)(−1) = f g(−1) = f (−1 − 3) = f (−4) = (−4)2 = 16
(g ◦ f )(−1) = g f (−1) = g (−1)2 = g(1) = 1 − 3 = −2
Sketch (for intuition):
f ◦g g◦f
−1 g −4 f
16 −1 f
1 g −2
For any x ∈ R, we have
(f ◦ g)(x) = f g(x) = f (x − 3) = (x − 3)2
(g ◦ f )(x)g f (x) = g x2 = x2 − 3
Notice that f ◦ g is not always equal to g ◦ f !
√ √
Example 6. If f (x) = x and g(x) = 2 − x determine each of the following composite
functions as well as their domains:
(a) f ◦ g (b) g ◦ f (c) f ◦ f (d) g ◦ g
Solution:
p p√
(a) f g(x) = g(x) = 2−x
√
Domain: Notice that 2 − x ≥ 0. Thus Df ◦g = Dg = (−∞, 2]
2
p p √
(b) g f (x) = 2 − f (x) = 2 − x
Domain: We must have that
√ √
2− x≥0 ⇐⇒ 2≥ x ⇐⇒ 4≥x and x ≥ 0
Consequently, Dg◦f = [0, 4]
p p√
(c) f f (x) = f (x) = x
Domain: Df ◦f = [0, ∞)
p p √
(d) g g(x) = 2 − g(x) = 2 − 2 − x
Domain:
√ √
2− 2−x≥0 ⇐⇒ 2≥ 2−x
Consequently,
4≥2−x and 2−x≥0
⇐⇒ x ≥ −2 and 2≥x
Thus, Dg◦g = [−2, ∞) ∩ (−∞, 2] = [−2, 2]
It is possible to compose more than two functions. For f , g and h, we define
f ◦ g ◦ h = f ◦ (g ◦ h) = (f ◦ g) ◦ h
Consequently,
(f ◦ g ◦ h)(x) = f g h(x)
Example 7. Let
x
f (x) = , g(x) = x10 , h(x) = x + 3
x+1
and determine f ◦ g ◦ h.
Solution: We have
(x + 3)10
= f g(x + 3) = f (x + 3)10 =
f g h(x)
(x + 3)10 + 1
Example 8. Find functions f , g and h such that F = f ◦ g ◦ h, where
√ p 1
(a) F (x) = cos 1 + x2 (b) F (x) = cos (1 + x2 ) (c) F (x) =
|1 + sin x|
Solution: Possible (meaningful) solutions:
3
√
(a) f (x) = cos x, g(x) = x, h(x) = 1 + x2
√
(b) f (x) = x, g(x) = cos x, h(x) = 1 + x2
(c) f (x) = x1 , g(x) = |x|, h(x) = 1 + sin x
Example 9. Give a function g such that
x
(f ◦ g)(x) = tan2 x where f (x) =
1−x
Solution: We want a g such that
g(x)
= tan2 x
f g(x) =
1 − g(x)
We now solve for g(x):
g(x)
= tan2 x
1 − g(x)
g(x) = 1 − g(x) tan2 x
⇐⇒
1 + tan2 x g(x) = tan2 x
⇐⇒
tan2 x tan2 x
⇐⇒ g(x) = 2 =
1 + tan x sec2 x
= tan (x) · cos (x) = sin2 x
2 2
Example 10. Find a function g such that
π
(g ◦ f )(x) = 1 + cos x where f (x) = x − 2
Solution: We want a g such that
π
g x− = 1 + cos x
2
Set a = x − π2 . Then x = a + π2 . Thus
π π
g(a) = 1 + cos a + = 1 + cos − (−a) = 1 + sin(−a) = 1 − sin a
2 2
And thus,
g(x) = 1 − sin x
Exercise 11. For two piecewise defined functions, for example
( (√
x2 − 4, x ≥ 1 x + 4, x≥0
f (x) = and g(x) =
x + 1, x < 1 −x2 , x<0
how would we determine f ◦ g and g ◦ f , as well as f + g and f · g?