Key idea: The function logcosx has three layers: logarithm, cosine and square root. The chain rule multiplies their derivatives: dudlogu=u1, dvdcosv=−sinv and dxdx=2x1.
Step 1 — Name the layers.
We let y=logu, where u=cosv and v=x. We take x>0 with cosx>0, so that the logarithm is defined.
Step 2 — Apply the chain rule.
We multiply the derivatives of the three layers, outside first, and put back u=cosx and v=x.
dxdy=cosx1⋅(−sinx)⋅2x1
Step 3 — Simplify.
The quotient cosxsinx is tanx.
dxdy=−2xtanx
Therefore, dxdy=−2xtanx (the same as −2xsecxsinx).