Covers IGNOU MCS-212 §1.5.2, E29–E30; programme guide: composition of functions, operations on functions
Functions can be combined to build new ones. Adding or multiplying them works pointwise, like adding two price lists item by item. Composition — feeding the output of one function into another — is how programs are built from smaller routines: round(sqrt(x)) is a composition.
Pointwise operations
For real functions f f f and g g g :
Operation Definition Domain sum ( f + g ) ( x ) = f ( x ) + g ( x ) (f + g)(x) = f(x) + g(x) ( f + g ) ( x ) = f ( x ) + g ( x ) D f ∩ D g D_f \cap D_g D f ∩ D g difference ( f − g ) ( x ) = f ( x ) − g ( x ) (f - g)(x) = f(x) - g(x) ( f − g ) ( x ) = f ( x ) − g ( x ) D f ∩ D g D_f \cap D_g D f ∩ D g product ( f g ) ( x ) = f ( x ) g ( x ) (fg)(x) = f(x)\,g(x) ( f g ) ( x ) = f ( x ) g ( x ) D f ∩ D g D_f \cap D_g D f ∩ D g quotient ( f g ) ( x ) = f ( x ) g ( x ) \left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)} ( g f ) ( x ) = g ( x ) f ( x ) D f ∩ D g D_f \cap D_g D f ∩ D g minus the points where g ( x ) = 0 g(x) = 0 g ( x ) = 0
Two functions are equal when they have the same domain and the same value at every point of it. f ( x ) = x 2 + 5 f(x) = x^2 + 5 f ( x ) = x 2 + 5 on R \mathbb{R} R and g ( x ) = x 2 + 5 g(x) = x^2 + 5 g ( x ) = x 2 + 5 on C \mathbb{C} C are different functions, because their domains differ.
Correction · Product and domains in the answer to E29
Study material says: For f ( x ) = 1 x f(x) = \frac{1}{x} f ( x ) = x 1 and g ( x ) = x 3 + 2 g(x) = x^3 + 2 g ( x ) = x 3 + 2 , the answer to E29 (§1.7) writes ( f g ) ( x ) = 1 x + ( x 3 + 2 ) (fg)(x) = \frac{1}{x} + (x^3 + 2) ( f g ) ( x ) = x 1 + ( x 3 + 2 ) and gives ( f / g ) ( x ) = 1 x ( x 3 + 2 ) (f/g)(x) = \frac{1}{x(x^3 + 2)} ( f / g ) ( x ) = x ( x 3 + 2 ) 1 “for all x ∈ R x \in \mathbb{R} x ∈ R ”.
Correct version: ( f g ) ( x ) = 1 x ( x 3 + 2 ) = x 3 + 2 x (fg)(x) = \frac{1}{x}\,(x^3 + 2) = \frac{x^3 + 2}{x} ( f g ) ( x ) = x 1 ( x 3 + 2 ) = x x 3 + 2 . The domain of f + g f + g f + g , f − g f - g f − g and f g fg f g is R ∖ { 0 } \mathbb{R} \setminus \{0\} R ∖ { 0 } ; the domain of f g ( x ) = 1 x ( x 3 + 2 ) \frac{f}{g}(x) = \frac{1}{x(x^3 + 2)} g f ( x ) = x ( x 3 + 2 ) 1 is R ∖ { 0 , − 2 3 } \mathbb{R} \setminus \{0, -\sqrt[3]{2}\} R ∖ { 0 , − 3 2 } .
Why: A product means multiplication, not addition. f f f is undefined at x = 0 x = 0 x = 0 , and f g \frac{f}{g} g f is also undefined where g ( x ) = x 3 + 2 = 0 g(x) = x^3 + 2 = 0 g ( x ) = x 3 + 2 = 0 , i.e. at x = − 2 3 x = -\sqrt[3]{2} x = − 3 2 .
Composition
Definition 1.29 · Composition
For g : A → B g: A \to B g : A → B and f : B → C f: B \to C f : B → C , the composition f ∘ g : A → C f \circ g: A \to C f ∘ g : A → C is ( f ∘ g ) ( x ) = f ( g ( x ) ) (f \circ g)(x) = f(g(x)) ( f ∘ g ) ( x ) = f ( g ( x )) : apply g g g first, then f f f .
Intuition
Composition is an assembly line read from right to left. In f ∘ g f \circ g f ∘ g , the item goes through machine g g g first, and g g g ‘s output goes into machine f f f . Changing the order of the machines usually changes the product.
Composition is usually not commutative : with f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 and g ( x ) = x + 1 g(x) = x + 1 g ( x ) = x + 1 , ( f ∘ g ) ( x ) = ( x + 1 ) 2 (f \circ g)(x) = (x + 1)^2 ( f ∘ g ) ( x ) = ( x + 1 ) 2 but ( g ∘ f ) ( x ) = x 2 + 1 (g \circ f)(x) = x^2 + 1 ( g ∘ f ) ( x ) = x 2 + 1 .
Composition is always associative : f ∘ ( g ∘ h ) = ( f ∘ g ) ∘ h f \circ (g \circ h) = (f \circ g) \circ h f ∘ ( g ∘ h ) = ( f ∘ g ) ∘ h , because both mean “apply h h h , then g g g , then f f f ”.
If f f f is a bijection, f ∘ f − 1 f \circ f^{-1} f ∘ f − 1 and f − 1 ∘ f f^{-1} \circ f f − 1 ∘ f are identity functions.
Example 1.30 Splitting a function into a composition
Goal. Write F ( x ) = ( x 3 + 2 x ) 3 F(x) = (x^3 + 2x)^3 F ( x ) = ( x 3 + 2 x ) 3 as a composition of two simpler functions.
Step. The inside step (done first) is g ( x ) = x 3 + 2 x g(x) = x^3 + 2x g ( x ) = x 3 + 2 x .
Step. The outside step (done second) is cubing: h ( y ) = y 3 h(y) = y^3 h ( y ) = y 3 .
Step. Check: ( h ∘ g ) ( x ) = h ( g ( x ) ) = h ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 = F ( x ) (h \circ g)(x) = h(g(x)) = h(x^3 + 2x) = (x^3 + 2x)^3 = F(x) ( h ∘ g ) ( x ) = h ( g ( x )) = h ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 = F ( x ) .
Step. The other order gives something else: ( g ∘ h ) ( x ) = g ( x 3 ) = x 9 + 2 x 3 (g \circ h)(x) = g(x^3) = x^9 + 2x^3 ( g ∘ h ) ( x ) = g ( x 3 ) = x 9 + 2 x 3 .
Result. F = h ∘ g F = h \circ g F = h ∘ g with g ( x ) = x 3 + 2 x g(x) = x^3 + 2x g ( x ) = x 3 + 2 x and h ( y ) = y 3 h(y) = y^3 h ( y ) = y 3 (and g ∘ h ≠ F g \circ h \neq F g ∘ h = F ).
Correction · Order of composition in the (x³ + 2x)³ example
Study material says: In §1.5.2, with g ( x ) = x 3 + 2 x g(x) = x^3 + 2x g ( x ) = x 3 + 2 x and h ( x ) = x 3 h(x) = x^3 h ( x ) = x 3 , it writes "g ∘ h ( x ) = g ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 = f ( x ) g \circ h(x) = g(x^3 + 2x) = (x^3 + 2x)^3 = f(x) g ∘ h ( x ) = g ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 = f ( x ) ".
Correct version: f = h ∘ g f = h \circ g f = h ∘ g : ( h ∘ g ) ( x ) = h ( g ( x ) ) = h ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 (h \circ g)(x) = h(g(x)) = h(x^3 + 2x) = (x^3 + 2x)^3 ( h ∘ g ) ( x ) = h ( g ( x )) = h ( x 3 + 2 x ) = ( x 3 + 2 x ) 3 . In contrast, ( g ∘ h ) ( x ) = g ( x 3 ) = x 9 + 2 x 3 (g \circ h)(x) = g(x^3) = x^9 + 2x^3 ( g ∘ h ) ( x ) = g ( x 3 ) = x 9 + 2 x 3 , and g ( x 3 + 2 x ) g(x^3 + 2x) g ( x 3 + 2 x ) would be ( x 3 + 2 x ) 3 + 2 ( x 3 + 2 x ) (x^3 + 2x)^3 + 2(x^3 + 2x) ( x 3 + 2 x ) 3 + 2 ( x 3 + 2 x ) .
Why: By definition ( g ∘ h ) ( x ) = g ( h ( x ) ) (g \circ h)(x) = g(h(x)) ( g ∘ h ) ( x ) = g ( h ( x )) applies h h h first. Here the inner step is g g g and the outer step is cubing (h h h ), so the composition is h ∘ g h \circ g h ∘ g .
Products of permutations
The product f g fg f g of two permutations of the same set is their composition f ∘ g f \circ g f ∘ g : apply g g g first, then f f f .
Example 1.31 Multiplying permutations
Goal. For f = ( 1 2 3 2 3 1 ) f = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 3 & 1 \end{pmatrix} f = ( 1 2 2 3 3 1 ) and g = ( 1 2 3 2 1 3 ) g = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 1 & 3 \end{pmatrix} g = ( 1 2 2 1 3 3 ) , find f g = f ∘ g fg = f \circ g f g = f ∘ g and g f = g ∘ f gf = g \circ f g f = g ∘ f .
Step. f g fg f g : 1 → g 2 → f 3 1 \xrightarrow{g} 2 \xrightarrow{f} 3 1 g 2 f 3 ; 2 → g 1 → f 2 2 \xrightarrow{g} 1 \xrightarrow{f} 2 2 g 1 f 2 ; 3 → g 3 → f 1 3 \xrightarrow{g} 3 \xrightarrow{f} 1 3 g 3 f 1 . So f g = ( 1 2 3 3 2 1 ) fg = \begin{pmatrix} 1 & 2 & 3 \\ 3 & 2 & 1 \end{pmatrix} f g = ( 1 3 2 2 3 1 ) .
Step. g f gf g f : 1 → f 2 → g 1 1 \xrightarrow{f} 2 \xrightarrow{g} 1 1 f 2 g 1 ; 2 → f 3 → g 3 2 \xrightarrow{f} 3 \xrightarrow{g} 3 2 f 3 g 3 ; 3 → f 1 → g 2 3 \xrightarrow{f} 1 \xrightarrow{g} 2 3 f 1 g 2 . So g f = ( 1 2 3 1 3 2 ) gf = \begin{pmatrix} 1 & 2 & 3 \\ 1 & 3 & 2 \end{pmatrix} g f = ( 1 1 2 3 3 2 ) .
Step. f g ≠ g f fg \neq gf f g = g f , so multiplication of permutations is not commutative.
Result. f g = ( 1 2 3 3 2 1 ) fg = \begin{pmatrix} 1 & 2 & 3 \\ 3 & 2 & 1 \end{pmatrix} f g = ( 1 3 2 2 3 1 ) , g f = ( 1 2 3 1 3 2 ) gf = \begin{pmatrix} 1 & 2 & 3 \\ 1 & 3 & 2 \end{pmatrix} g f = ( 1 1 2 3 3 2 ) .
Correction · Products of permutations in §1.5.2
Study material says: §1.5.2 defines f g fg f g by ( f g ) ( a ) = f [ g ( a ) ] (fg)(a) = f[g(a)] ( f g ) ( a ) = f [ g ( a )] but then computes the products by applying f f f first; for f = ( 1 2 3 4 1 3 4 2 ) f = \begin{pmatrix} 1&2&3&4 \\ 1&3&4&2 \end{pmatrix} f = ( 1 1 2 3 3 4 4 2 ) , g = ( 1 2 3 4 2 3 4 1 ) g = \begin{pmatrix} 1&2&3&4 \\ 2&3&4&1 \end{pmatrix} g = ( 1 2 2 3 3 4 4 1 ) , h = ( 1 2 3 4 4 2 1 3 ) h = \begin{pmatrix} 1&2&3&4 \\ 4&2&1&3 \end{pmatrix} h = ( 1 4 2 2 3 1 4 3 ) it prints g h = ( 1 2 3 4 3 4 2 1 ) gh = \begin{pmatrix} 1&2&3&4 \\ 3&4&2&1 \end{pmatrix} g h = ( 1 3 2 4 3 2 4 1 ) , gives different values for f ( g h ) f(gh) f ( g h ) and ( f g ) h (fg)h ( f g ) h , and concludes “the multiplication of permutation is commutative”.
Correct version: With the stated definition (g g g first, then f f f ): f g = ( 1 2 3 4 3 4 2 1 ) fg = \begin{pmatrix} 1&2&3&4 \\ 3&4&2&1 \end{pmatrix} f g = ( 1 3 2 4 3 2 4 1 ) , g f = ( 1 2 3 4 2 4 1 3 ) gf = \begin{pmatrix} 1&2&3&4 \\ 2&4&1&3 \end{pmatrix} g f = ( 1 2 2 4 3 1 4 3 ) , g h = ( 1 2 3 4 1 3 2 4 ) gh = \begin{pmatrix} 1&2&3&4 \\ 1&3&2&4 \end{pmatrix} g h = ( 1 1 2 3 3 2 4 4 ) , and f ( g h ) = ( f g ) h = ( 1 2 3 4 1 4 3 2 ) f(gh) = (fg)h = \begin{pmatrix} 1&2&3&4 \\ 1&4&3&2 \end{pmatrix} f ( g h ) = ( f g ) h = ( 1 1 2 4 3 3 4 2 ) . The example shows that multiplication of permutations is associative but not commutative (f g ≠ g f fg \neq gf f g = g f ).
Why: Each product was recomputed element by element (and checked by a short program). The text’s own conclusion contradicts its earlier statement that permutation multiplication is not commutative.
Common mistake
Applying the left function first. In f ∘ g f \circ g f ∘ g (and in the product f g fg f g of permutations), g g g acts first. Read compositions from right to left.
Common mistake
Forgetting the extra restriction on the domain of f g \frac{f}{g} g f . Remove the points where g ( x ) = 0 g(x) = 0 g ( x ) = 0 , as well as the points outside the domains of f f f and g g g .
Key idea
Sum, difference, product and quotient of functions act pointwise on the common domain (and the quotient also avoids zeros of the denominator); composition f ∘ g f \circ g f ∘ g applies g g g first, is associative, and is usually not commutative.
TEE Exam note
Typical questions: “Find f + g f + g f + g , f − g f - g f − g , f g fg f g , f / g f/g f / g , f ∘ g f \circ g f ∘ g and their domains”, “Show that composition is not commutative”, “Find the product of the permutations …”. Always state the domain. E30 with f ( x ) = x + 1 f(x) = \sqrt{x + 1} f ( x ) = x + 1 (x ≥ − 1 x \geq -1 x ≥ − 1 ) and g ( x ) = x 3 g(x) = x^3 g ( x ) = x 3 : f ± g f \pm g f ± g and f g fg f g on x ≥ − 1 x \geq -1 x ≥ − 1 ; f g ( x ) = x + 1 x 3 \frac{f}{g}(x) = \frac{\sqrt{x + 1}}{x^3} g f ( x ) = x 3 x + 1 on x ≥ − 1 x \geq -1 x ≥ − 1 , x ≠ 0 x \neq 0 x = 0 ; ( f ∘ g ) ( x ) = x 3 + 1 (f \circ g)(x) = \sqrt{x^3 + 1} ( f ∘ g ) ( x ) = x 3 + 1 , defined when x 3 ≥ − 1 x^3 \geq -1 x 3 ≥ − 1 , i.e. x ≥ − 1 x \geq -1 x ≥ − 1 .
Key takeaways
f + g f + g f + g , f − g f - g f − g , f g fg f g : pointwise, on D f ∩ D g D_f \cap D_g D f ∩ D g ; f g \frac{f}{g} g f also excludes zeros of g g g .
( f ∘ g ) ( x ) = f ( g ( x ) ) (f \circ g)(x) = f(g(x)) ( f ∘ g ) ( x ) = f ( g ( x )) : g g g first, then f f f .
Composition is associative but usually not commutative.
The product f g fg f g of permutations is f ∘ g f \circ g f ∘ g ; compute it element by element.
Practice questions Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 1 · multiple choice If f ( x ) = x 2 f(x) = x^2 f ( x ) = x 2 and g ( x ) = x + 1 g(x) = x + 1 g ( x ) = x + 1 , what is ( f ∘ g ) ( 2 ) (f \circ g)(2) ( f ∘ g ) ( 2 ) ?
A 5 B 9 C 4 D 6
Check answer
Show answer Answer: B. 9
g ( 2 ) = 3 g(2) = 3 g ( 2 ) = 3 , then f ( 3 ) = 9 f(3) = 9 f ( 3 ) = 9 . Option 1 is ( g ∘ f ) ( 2 ) = 4 + 1 (g \circ f)(2) = 4 + 1 ( g ∘ f ) ( 2 ) = 4 + 1 , which applies f f f first.
Question 2 · multiple choice What is the domain of f g \frac{f}{g} g f for f ( x ) = x f(x) = x f ( x ) = x and g ( x ) = x − 2 g(x) = x - 2 g ( x ) = x − 2 (both on R \mathbb{R} R )?
Check answer
Show answer Answer: C. R ∖ { 2 } \mathbb{R} \setminus \{2\} R ∖ { 2 }
Only zeros of the denominator g g g are removed. Option 4 also removes 0, where f ( x ) = 0 f(x) = 0 f ( x ) = 0 , but a zero numerator is allowed.
Question 3 · multiple choice Which statement about composition of functions is always true?
Check answer
Show answer Answer: D. f ∘ ( g ∘ h ) = ( f ∘ g ) ∘ h f \circ (g \circ h) = (f \circ g) \circ h f ∘ ( g ∘ h ) = ( f ∘ g ) ∘ h
Composition is associative. Option 1 (commutativity) fails, e.g. for x 2 x^2 x 2 and x + 1 x + 1 x + 1 .
Question 4 · multiple choice For f = ( 1 2 3 3 1 2 ) f = \begin{pmatrix} 1 & 2 & 3 \\ 3 & 1 & 2 \end{pmatrix} f = ( 1 3 2 1 3 2 ) and g = ( 1 2 3 1 3 2 ) g = \begin{pmatrix} 1 & 2 & 3 \\ 1 & 3 & 2 \end{pmatrix} g = ( 1 1 2 3 3 2 ) , what is f g = f ∘ g fg = f \circ g f g = f ∘ g ?
Check answer
Show answer Answer: D. ( 1 2 3 3 2 1 ) \begin{pmatrix} 1 & 2 & 3 \\ 3 & 2 & 1 \end{pmatrix} ( 1 3 2 2 3 1 )
1 → g 1 → f 3 1 \xrightarrow{g} 1 \xrightarrow{f} 3 1 g 1 f 3 ; 2 → g 3 → f 2 2 \xrightarrow{g} 3 \xrightarrow{f} 2 2 g 3 f 2 ; 3 → g 2 → f 1 3 \xrightarrow{g} 2 \xrightarrow{f} 1 3 g 2 f 1 . Option 1 is g f gf g f (apply f f f first).
Question 5 · multiple choice For f ( x ) = 1 x f(x) = \frac{1}{x} f ( x ) = x 1 and g ( x ) = x 3 + 2 g(x) = x^3 + 2 g ( x ) = x 3 + 2 , what is ( f g ) ( x ) (fg)(x) ( f g ) ( x ) ?
Check answer
Show answer Answer: B. x 3 + 2 x \frac{x^3 + 2}{x} x x 3 + 2
The product multiplies the values: 1 x ⋅ ( x 3 + 2 ) \frac{1}{x} \cdot (x^3 + 2) x 1 ⋅ ( x 3 + 2 ) . Option 1 is the sum f + g f + g f + g (as printed in the study material’s answer). Option 3 is f ∘ g f \circ g f ∘ g .
Question 6 · short answer
Let f ( x ) = x + 1 f(x) = \sqrt{x + 1} f ( x ) = x + 1 for x ≥ − 1 x \geq -1 x ≥ − 1 and g ( x ) = x 3 g(x) = x^3 g ( x ) = x 3 for x ∈ R x \in \mathbb{R} x ∈ R . Find f ∘ g f \circ g f ∘ g and g ∘ f g \circ f g ∘ f with their domains.
Show worked answer ( f ∘ g ) ( x ) = f ( x 3 ) = x 3 + 1 (f \circ g)(x) = f(x^3) = \sqrt{x^3 + 1} ( f ∘ g ) ( x ) = f ( x 3 ) = x 3 + 1 ; it is defined when x 3 + 1 ≥ 0 x^3 + 1 \geq 0 x 3 + 1 ≥ 0 , i.e. x 3 ≥ − 1 x^3 \geq -1 x 3 ≥ − 1 , i.e. x ≥ − 1 x \geq -1 x ≥ − 1 . ( g ∘ f ) ( x ) = g ( x + 1 ) = ( x + 1 ) 3 = ( x + 1 ) 3 / 2 (g \circ f)(x) = g(\sqrt{x + 1}) = (\sqrt{x + 1})^3 = (x + 1)^{3/2} ( g ∘ f ) ( x ) = g ( x + 1 ) = ( x + 1 ) 3 = ( x + 1 ) 3/2 ; it is defined when f f f is defined, i.e. x ≥ − 1 x \geq -1 x ≥ − 1 . The two functions are different: at x = 0 x = 0 x = 0 , f ∘ g f \circ g f ∘ g gives 1 1 1 and g ∘ f g \circ f g ∘ f gives 1 1 1 , but at x = 3 x = 3 x = 3 , f ∘ g f \circ g f ∘ g gives 28 ≈ 5.29 \sqrt{28} \approx 5.29 28 ≈ 5.29 while g ∘ f g \circ f g ∘ f gives 8 8 8 .