a) $f(x) = \sqrt[3]{x}\ $ and $g(x) = x^3$
find $f\circ g=?$ and $g\circ f=?$
I have $f\circ g = f(g(x)) = f(x^3) = \sqrt[3]{x^3} = x$
So basically, first we replace $g(x)$ with its value, then we replace $x$ with the value of $f(x)$ inside $g(x)$?
$g\circ f = g(f(x)) = g( \sqrt[3]{x} ) = \sqrt[3]{x^3} $ OR $ \sqrt[3]{x}^3 $ ?
b) $f(x) = \sin x$ and $g(x) = x^2$
$$(f\circ g) = f(g(x)) = f(x^2) = \sin (x^2)$$
$$(g\circ f) = g(f(x)) = g(\sin x) = (\sin x)^2 = \sin^2x$$
Am I doing it right? I'm kinda confused whether I have to replace x with the original value or not.