Composite Function
Digital Handwritten Lesson
Activity: 1
"Double a number and add 3", do it for 5.
Calculation - 1
$$2 \times 5 = 10$$
Calculation - 2
$$10 + 3 = 13$$
In picture:

Observation:
- Initial value of calcualtion - 1 is 5, where as initial value of calculation - 2 is 10, which is result of calculation - 1.
Conclusion:
Two calculations combines together to give a result.
Activity: 2 (Real Life Analogy)

Observation:
- Bus 'A' takes Ram from Pokhara to Mugling.
- Bus 'B' takes Ram from Mugling to Kathmandu.
- Ram travel from Pokhara from Kathmandu by two buses.
Conclusion:
- Ram enters Bus 'A' in Pokhara and exits in Mugling whereas he enters Bus 'B' in Mugling and exits in Kathmandu.
- Passenger dropped by Bus 'A' is taken by Bus 'B'.
Activity: 3 (Function Machine Analogy)

Observation:
-
Machine - 1 takes '4' and gives '16'.
-
Machine - 2 takes '16' and gives '32'.
-
From '4' to '32' is work of two machines.
Conclusion:
-
Output of one function is input of another function, when two functions act/work in this way we call them composite functions.
Definition:
Composite Function:
Let f: A $\rightarrow$ B be a function defined from set A to B and g: B $\rightarrow$ C be a function defined from set B to C. The function which is defined from set A to C is called COMPOSITE FUNCTION of f and g.
It is denoted by $gof$(x).

Mathematically,
$(g \circ f)(x)$ = $g(f(x))$
Good Question:
Q: Why it is written $(g \circ f)(x)$ instead of $(f \circ g)(x)$?
Ans:
In mathematics, function notation is read from right to left regarding the order of operations.
- In the expression g(f(x)), the f is physically closer to the x.
- Because f acts on x first, it is written on the inside.
- The notation $(g \circ f)$ is designed to mirror the nested notation g(f(x)).
The Logic: If we wrote it as $f \circ g$ it meant "apply $g$ and then apply $f$'' which is logically wrong as $f$ is the function which takes the input first, then $g$ takes the output of $f$ as its input. To understand it more in a simple way, the function which is close of $x$ takes the input first or the function which takes the input first must be written close to $x$.
Composite Function in Mapping Diagram:

Composite Function: (Functions written as ordered pairs)
Let $f$ = {(a, p), (b, q), (c, r)} and $g$ = {(p, 1), (q, 2), (r, 3)}
For: $g \circ f$:
To understand:
$a, b, c$ are inputs of function $f$
$p, q, r$ are outputs of function $f$
$p, q, r$ are inputs of function $g$
$1, 2, 3$ are outputs of function of $g$
Solution:
$g \circ f$ = $g(f(a))$ = $g(p)$ = 1
$g \circ f$ = $g(f(b))$ = $g(q)$ = 2
$g \circ f$ = $g(f(c))$ = $g(r)$ = 3
$\therefore$ $g \circ f$ = {(a, 1), (b, 2), (c, 3)}
In mapping diagram:
Composite Function: (Functions written as formula)
Let, $f(x)$ = $2x - 1$ and $g(x)$ = 3x + 5, $x \in \mathbb{R}$
Solution:
Given,
$f(x)$ = $2x - 1$
$g(x)$ = $3x + 5$
Now,
$(g \circ f)(x)$ = g(f(x)) = g(2x - 1) = 3(2x - 1) + 5 = 6x - 3 + 5 = 6x + 2
[Understand: like $x$, (2x - 1) is input value of function $g$, so it replaces input variable of function $g$ i.e. $x$.]
Again,
$(f \circ g)(x)$ = f(g(x)) = f(3x + 5) = 2 (3x + 5) - 1 = 6x + 10 - 1 = 6x + 9
$\therefore$ $(g \circ f)(x)$ $\neq$ $(f \circ g)(x)$
Conclusion: The composite of any two functions is not commutative.
Remember:
$f^2$ = $f \circ f$
$g^2$ = $g \circ g$
In composite function $g \circ f$:
Domain = Domain of $f$
Range = Range of $g$
Course material curated by Mr. Nripendraswar Acharya