In order to differentiate a function of a function, say #y, =f(g(x))#, where we have to find #(dy)/(dx)#, we need to do (a) substitute #u=g(x)#, which gives us #y=f(u)#. Then we need to use a formula called Chain Rule, which states that #(dy)/(dx)=(dy)/(du)xx(du)/(dx)#. In fact if we have something like #y=f(g(h(x)))#, we can have #(dy)/(dx)=(dy)/(df)xx(df)/(dg)xx(dg)/(dh)#
We also use here quotient rule that is if #f(x)=(g(x))/(h(x))#
then #(df)/(dx)=((dg)/(dx)xxh(x)-(dh)/(dx)xxg(x))/(h(x))^2#
as #g(x)=sin^2 3x#, using chain rule #(dg)/(dx)=2sin3x xx cos3x xx3#
= #6sin3xcos3x# and
as #h(x)=cos(2x)# then #(dh)/(dx)=-sin2x xx 2=-2sin2x#
Hence derivative of #(sin^2 3x)/(cos2x)# is
#(6sin3xcos3x xx cos2x - (-2sin2x)xxsin^2 3x)/(cos^2 2x)#
= #(6sin3xcos3xcos2x+2sin2xsin^2 3x)/(cos^2 2x)#
= #(2sin3x(3cos3xcos2x+sin2xsin3x))/(cos^2 2x)#
= #(2sin3x(2cos3xcos2x+cos(3x-2x)))/(cos^2 2x)#
= #(2sin3x(2cos3xcos2x+cosx))/(cos^2 2x)#