Question:medium

If \( f : \mathbb{R} \to \mathbb{R} \) and \( g : \mathbb{R} \to \mathbb{R} \) be functions defined by \( f(x) = \cos x \) and \( g(x) = 3x^2 \) respectively, then prove that \( g \circ f \neq f \circ g \).

Show Hint

{Key Points:}
  • \( g \circ f \) means apply \( f \) first, then \( g \)
  • \( f \circ g \) means apply \( g \) first, then \( f \)
  • Function composition is generally not commutative
  • To prove inequality, a single counterexample is sufficient
Updated On: Mar 7, 2026
Show Solution

Solution and Explanation

Step 1: Definition of composition of functions.
The composition of two functions \(f\) and \(g\) is defined as:
\[ (g \circ f)(x) = g(f(x)) \] \[ (f \circ g)(x) = f(g(x)) \] Step 2: Find the expressions for \(g \circ f\) and \(f \circ g\).
(i) For \(g \circ f\):
\[ (g \circ f)(x) = g(f(x)) = g(\cos x) = 3(\cos x)^2 \] Thus, \( (g \circ f)(x) = 3 \cos^2 x \).

(ii) For \(f \circ g\):
\[ (f \circ g)(x) = f(g(x)) = f(3x^2) = \cos(3x^2) \] Thus, \( (f \circ g)(x) = \cos(3x^2) \).

Step 3: Compare \(g \circ f\) and \(f \circ g\).
We have the following two expressions:
\[ (g \circ f)(x) = 3 \cos^2 x \] and \[ (f \circ g)(x) = \cos(3x^2) \] Clearly, these two expressions are not equal for all \(x \in \mathbb{R}\), as \(3 \cos^2 x\) and \(\cos(3x^2)\) represent different functions.

Step 4: Conclusion.
Since \( (g \circ f)(x) \neq (f \circ g)(x) \) for all values of \(x\), we have shown that \( g \circ f \neq f \circ g \).

Final Answer: \( g \circ f \neq f \circ g \).

Was this answer helpful?
0