What is the derivative of f^3(g(x)) where both are continuous functions?

I used chain rule and got 3f^2(g(x))f'(g(x))g'(x) but it is not right.

looks ok to me

y = f^3(g(x))
dy/dx = 3f^2 df/dg * dg/dx

for example,

y = sin^3(x^2+1)
dy/dx = 3sin^2(x^2+1) cos(x^2+1) (2x)