# Let $f(x)=x^{2}+x+1$ and $g(x)=\sin x$. Show that fog $\neq$ gof.

Question.
Let $f(x)=x^{2}+x+1$ and $g(x)=\sin x$. Show that fog $\neq$ gof.

Solution:
$(f o g)(x)=f(g(x))=f(\sin x)=\sin ^{2} x+\sin x+1$
and $(g o f)(x)=g(f(x))=g\left(x^{2}+x+1\right)=\sin \left(x^{2}+x+1\right)$
So, $f o g \neq g o f$.