Derivatives of Tangent, Cotangent, Secant, and Cosecant
We can get the derivatives of the other four trig functions by applying
the quotient rule to sine and cosine. For instance,
ddx(tan(x))=(sin(x)cos(x))′=cos(x)(sin(x))′−sin(x)(cos(x))′cos2(x)=cos2(x)+sin2(x)cos2(x)=1cos2(x)=sec2(x).