Lesson 4: Composition of Functions and Applications of Relations
Lesson Objective:
Dear learner,
By the end of this lesson you will be able to:
- Describe the composition of two or more functions
- Determine domain and range of composite functions
- Solve problems given in composition of functions
Key Terms
- Composition of functions
- Inverse function
- Graph of inverse functions
Brain Storming Activity
consider the function $f(x) = x^{2}$ ang $g(x) = 2x+1$:
a. What will you observe when you substitute $x^{2}$ to x in $g(x)$?
b. Substitute 2x+1 to $x^{2}$ in $f(x)$ and observe.
Solution:
from your observation:
a. If you substitute $x^{2}$ to x in $g(x)$, you made $g(x^{2})$ = $ 2(x^{2})+1$ = $g(f(x))$ which is defined as composition of g by f.
b. When you are substituting x to $x^{2}$ in f as $f(x^{2})$ = $f(g(x))$ that is defined as composition of f by g.
4.1. Composition of Functions
Definition:
Let $f \colon \mathbb{A} \to \mathbb{B}$ and $g \colon \mathbb{B} \to \mathbb{C}$ be functions , then the function h(x) defined by $h(x)$ = $g(f(x))$ = $(gof)(x)$ for all $x \in \mathbb{A}$ and f(x) is in the domain of g is the composition of g by f denoted by $(gof)(x)$ = $g(f(x))$
Example 1:
a. Let $f = {(1,2),(2,3),(3,4),(4,5)}$ and $g = {(2,1),(3,4),(4,2),(5,1)}$, then determine fog ?
b. Let $f(x) = 3x+2$ and $g(x) = 1-5x$, then find gof and fog?
c. Consider f and g be functions defined on the diagram below determine gof?

Solution:
a). $(fog)(2) = f(g(2) = f(1) = 2$
$(fog)(3) = f(g(3)) = f(4) = 5$
$(fog)(4) = f(g(4)) = f(2) = 3 $
$(fog)(5) = f(g(5)) = f(1) = 2$
Therefore $f(g(x)) = {(2,2),(3,5),(4,3),(5,2)}$
b). $f(x) = 3x+2$ and $g(x) =1- 5x$:
$fog = f(g(x)) = f(1-5x) = 3(1-5x)+2 = 3-15x+2 = 5-15x$.
Therefore $f(g(x)) = 5-15x$
and gof:
$gof = g(f(x)) = g(3x+2) = 1-5(3x+2) = 1-15x-10 = -15x-9$.
Therefore, $g(f(x) = 15x-9$
C).
$\text{First observe that}~f=\{(1,a),(2,d),(3,b),(4,c)\}~\text{and}~g=\{(a,h),(b,e),(c,f),(d,g)\}$.
$\text{Thus,}$
$\begin{aligned}
\text{i.}~(g\circ f)(1)&=g(f(1))=g(a)=h \\
\text{ii.}~(g\circ f)(2)&=g(f(2))=g(d)=g \\
\text{iii.}~(g\circ f)(3)&=g(f(3))=g(b)=e \\
\text{iv.}~(g\circ f)(4)&=g(f(4))=g(c)=f
\end{aligned}$
$\text{Therefore},~g\circ f=\{(1,h),(2,g),(3,e),(4,f)\}.$

Example 2:
A. Determine domain of gof and fog where $f(x) = \sqrt x$ and $g(x) = |x|.$
B. Let $f(x) =10^{x}$ and $g(x) = \log{x}$, then find $fog$ and $gof$ determine domain of $fog$ and $gof$?
C. Let $f(x) = 2x-1$ and $g(f(x))= x+2$, then find $g(x)$?
Solution:
A. $g(f(x)) = g(\sqrt x) \implies g(f(x)) = |\sqrt x|$
domain $g(f(x)) = [0,\infty) \subseteq Dom f(x)$ and $f(g(x)) = f(|x|) \implies f(g(x)) = \sqrt |x|$.
Hence domain $g(f(x) = [0, \infty) \subseteq Domg(x)$
B. $f(x) =10^{x}$ and $g(x) = \log{x}$:
i. lets find $fog$ and $gof$ as, $f(g(x)) =f(\log{x})$ = $10^{\log{x}}$ = x …… logarithmic laws
$\implies f(g(x)) = x$, and Domain $f(g(x)) = \mathbb{R}$
ii. and $g(f(x)) = g(10^{x})$ $\implies$ $g(f(x)) = \log{10^{x}}$ = x …………. logarithmic laws.
Therefore Domain $g(f(x)) = \mathbb{R}.$
Finally from the two solutions you can observe that $f(g(x)) = g(f(x)) = x$ …… (why?)
C. $f(x) = 2x-1$ and $g(f(x))= x+2$, then find $g(x)$?
to find $g(x)$ first we have to assume $g(x)$ = $ax +b$, since the composition is linear
then compute $g(f(x))$ =$ x+2 \implies g(2x-1) = x+2$
$\implies a(2x – 1) +b$ = $x+ 2 \implies 2ax -a +b = x+2$.
Applying rules of equality of two expressions you can compute $2ax = x$ and $b-a = 2$
$\iff a = \frac{1}{2}$ and $b = 2+\frac{1}{2}$ = $\frac{5}{2}$.
Therefore, $g(x) = \frac{x+5}{2}$
4.2. Inverse of Functions
Definition:
Let $f$ be a function, if its inverse is also a function, then we say $f$ is inversible and its inverse is denoted by $f^{-1}$.
steps to find $f^{-1}$:
- interchange x and y in the expression $y = f(x)$ to $x = f(y)$
- solve y interms of x
- write $f^{-1}$ as $y = f^{-1}(x)$
Example 3:
Find the inverse of the following functions
A). $f(x) = 3x+5$ b). $g(x) = x^{2}$ c). $h(x) = \frac{x+1}{2x+1}$, $x \ne \frac{-1}{2}$ d). $n(x) = \log(x+1)$, where $x \ge -1$.
Solution:
A. $f(x) = 3x+5$: interchanging variables $x = 3y+5$
$\implies 3y = x-5$, $y = \frac{x-5}{3}$
therefore $f^{-1}(x) = \frac{x-5}{3}$
B. $g(x) = x^{2}$: interchanging variables $x = y^{2} \implies y = \pm \sqrt x$
then $g^{-1}(x) = \pm \sqrt x$ is not a fumnction since if $x = 1$, then $y =\pm 1$
therefore , $g(x) $ has no inverse.
C. $h(x) = \frac{x+1}{2x+1}$,
interchanging variables $x= \frac{y+1}{2y+1}$ $implies$ $x(2y+1) = y+1$
$\implies 2xy+x = y+1)$ $\implies 2xy-y = 1-x$, then $y = \frac{1-x}{2x-1}$
therefore $h^{-1}(x) = \frac{1-x}{2x-1}$, where $x \ne \frac{1}{2}$
D. $n(x) = \log(x+1)$, where $x \ge -1$:
interchange variables $x= \log(y+1) \implies 10^{x} = 10^{\log(y+1)}$
which leads to $y+1 = 10^{x}$ …….. inverse laws of logarithms
$\implies$ $y = 10^{x} -1$ $\iff n^{-1}(x) = 10^{x} – 1$
Example 4:
1). Let $f = {(1,2),(3,4),(4,5),(5,1)}$ be a function defined in $A = {1,2,3,4,5}$ and $ I $ be an identity on A as $I = {(1,1),(2,2),(3,3),(4,4),(5,5)}$, then find
A. $foI$
B. $Iof$
C. compare $foI$ and $Iof$
2. Let $f(x) = 2x-3$, and $I(x) = x$ where $I(x) =x$ is an identiity function, then
A. find $f^{-1}(x)$
B. compute $f o f^{-1}$ and $f o f^{-1}$
Solution:
A. lets begin by solving $foI$:
$f(I(1)) = f(1) $=2
$f(I(2)) = f(2)$ is not defined in f
$f(I(3)) =f(3)$ = 4
$f(I(4)) = f(4)$= 5
$f(I(5)) = f(5)$ = 1 therefore $foI$ = {(1,2),(3,4),(4,5),(5,1)} = $ f$
B. $Iof$ be determined as $I(f(1)) = I(2)$ =2, $I(f(3)) = I(4)$ = 4, $I(f(4)) = I(5)$ = 5, $I(f(5)) = I(1)$ = 1
C. therefore $Iof$ = {(1,2),(3,4),(4,5),(5,1)} = f = $foI$
2. a. $f^{-1}(x)$ is found as: $x = 2y – 3$ $\implies$ $x+3 = 2y$
therefore $f^{-1}(x) = \frac{x+2}{2}$
B. $f(f^{-1}(x)) = f(\frac{x+3}{2}) = 2(\frac{x+3}{2}) -3$ $\implies$ $f(f^{-1}(x)) =x+3-3 = x$
and $f^{-1}(f(x)) = f^{-1}(2x-3) = \frac{(2x-3)+3}{2}$ $implies$ $f^{-1}(f(x)) =\frac{2x}{2} = x$
In general based on the above two functions:
Let $f$ be an invertible function and $I$ be an identity function, then:
- $f(I(x) = I(f(x)) = f(x)$
- if $f^{-1}(x)$ is the inverse of $f(x)$, then $f( f^{-1}(x)) = f^{-1}( f(x)) = I(x)$
https://www.geogebra.org/m/ewrtgb4a
4.3. Graph of Inverse Functions
let $f$ be an invertible function in the set of real numbers and $f^{-1}$ be a function, then graph of $f$ and $f^{-1}$ are mirror images of each other with respect to the line $y = x$.
Example 4.5 : Draw the graph of $f(x) = 2x+1$ and its inverse on the same coordinate plane?
Solution:
$f^{-1}(x) = \frac{x-1}{2}$
Graph of $f$ and $f^{-1}$ looks like the graph below

fig 4.1 Graph of $f$ and $f^{-1}$
4.4. Application of Relations and Functions
The Price Versus production Quantity Relation
Example 4.6
1. Affirm produces an item whose production cost functions $C(x) = 400 + 50x$ where x is the number of items produced.
A. If the entire stock is sold at a price of each item which is birr600, then determine the revenue function?
B. If the total number of items produced was 1200 and entire stock is sold at a price of each item which is birr 600 find the profit of the firm?
Solution:
A. revenue function is determined by :Revenue(R) = items sold times cost of an item
$R(x) = 600 (x) = 600x$
B. x = 1200, and revenue (R) = 600 x = 600(1200) = 720000 Birr
and $cost (C) = 400+50(1200) = 400 + 60000 = 60400$
then profit = revenue – cost = 72000 – 60400 = 11600 Birr.