Show \(f \circ g \ne g \circ f\) for \(f(x)=x^2+x+1\) and \(g(x)=\sin x\)
📺 Video Explanation
📝 Question
Let functions \(f:\mathbb{R}\to\mathbb{R}\) and \(g:\mathbb{R}\to\mathbb{R}\) be defined as:
\[ f(x)=x^2+x+1,\qquad g(x)=\sin x \]
Show that:
\[ f\circ g \ne g\circ f \]
✅ Solution
🔹 Find \((f\circ g)(x)\)
By definition:
\[ (f\circ g)(x)=f(g(x)) \]
Substitute \(g(x)=\sin x\):
\[ (f\circ g)(x)=f(\sin x) \]
Since:
\[ f(x)=x^2+x+1 \]
So:
\[ (f\circ g)(x)=(\sin x)^2+\sin x+1 \]
\[ (f\circ g)(x)=\sin^2 x+\sin x+1 \]
🔹 Find \((g\circ f)(x)\)
By definition:
\[ (g\circ f)(x)=g(f(x)) \]
Substitute \(f(x)=x^2+x+1\):
\[ (g\circ f)(x)=g(x^2+x+1) \]
Since:
\[ g(x)=\sin x \]
So:
\[ (g\circ f)(x)=\sin(x^2+x+1) \]
🔹 Compare Both
We get:
\[ (f\circ g)(x)=\sin^2 x+\sin x+1 \]
and
\[ (g\circ f)(x)=\sin(x^2+x+1) \]
These are different expressions in general, so:
\[ \boxed{f\circ g \ne g\circ f} \]
Hence, composition of functions is not commutative in general. :contentReference[oaicite:1]{index=1}
🎯 Final Answer
\[ \boxed{(f\circ g)(x)=\sin^2 x+\sin x+1} \]
\[ \boxed{(g\circ f)(x)=\sin(x^2+x+1)} \]
Therefore:
\[ \boxed{f\circ g \ne g\circ f} \]
🚀 Exam Shortcut
- First apply inner function, then outer function
- Substitute carefully without changing order
- Composition usually depends on order