since you know the answer, i will do this one. i leave the other to you.

what they are getting at is using the chain rule. it says

so g(x) is the function that is plugged in to f(x)

from

you should be able to see, the red is what is plugged in, in a way that makes the derivative intuitive

so and

thus, and

and

so finally,

so that's the long drawn out way that they expect you to do it. you won't need to do any of this when you get used to using the chain rule. so bare this for now