find $\displaystyle \frac{dy}{dx}$ of $\displaystyle \tan^2(x^3)$

I know that $\displaystyle \frac{dy}{dx}\tan{x} = \sec^2{x}$ and probably to use the chain rule

but didn't know how to deal with the powers?

the ans is: $\displaystyle 6x^2\tan(x^3)\sec^2{(x^3)}$