Let #g(x)=cos(x)#
and #f(x)=x^(-2)#
so that
#color(white)("XXX")sec^2(x)=1/(cos^2(x))=f(g(x))#
We know that
#color(white)("XXX")(dg(x))/(dx)=(d cos(x))/(dx)=-sin(x)#
and
#color(white)("XX")(df(x))/(dx)=(d x^(-2))/(dx)=-2x^(-3)#
#color(white)("XX") rarr (d f(g(x)))/(d g(x))=-2g^(-3)(x)=-2 cos^(-3)(x)=-2/(cos(x))#
By the Chain Rule:
#color(white)("XXX")(d f(g(x)))/(dx)=(d f(g(x)))/(dx) xx (d g(x))/(d g(x))=(d f(g(x)))/(d g(x)) xx (d g(x))/(dx)#
Therefore
#color(white)("XX")(d sin^2(x))/(dx)#
#color(white)("XXXX")=(d f(g(x)))/(dx)= -2/cos^3(x)xx(-sin(x)) = (2 sin(x))/(cos^3(x))#
~~~~~~~~~~~~~~~~~~~~~~~~
Although this is a different derivation than Bacterium's
the results are equivalent.
Some steps here are more explicit and it does not rely on remembering #(d sec(x))/(dx)= sec(x) * tan(x)#