AP Calculus AB · Topic 2.10 · Reading guide, about 5 min

Derivatives of the other four trig functions

Derivatives of tan, cot, sec and csc, derived from sine and cosine with the quotient rule, plus how to use them.

In one minute

Sine and cosine are only two of the six trigonometric functions. The other four are built from them: tangent is sine over cosine, and cotangent, secant and cosecant are reciprocals or ratios of the same pair. Their derivatives are sec⁡2x\sec^2x, −csc⁡2x-\csc^2x, sec⁡xtan⁡x\sec x\tan x and −csc⁡xcot⁡x-\csc x\cot x.

You can memorize the four results, but you can also rebuild any of them in a few lines from the sine and cosine rules. Knowing the derivation helps you recover a forgotten sign during an exam.

Key terms

Tangent
tan⁡x=sin⁡xcos⁡x\tan x=\frac{\sin x}{\cos x}, undefined wherever cos⁡x=0\cos x=0, such as x=π2x=\frac{\pi}{2}.
Cotangent
cot⁡x=cos⁡xsin⁡x\cot x=\frac{\cos x}{\sin x}, undefined wherever sin⁡x=0\sin x=0.
Secant
sec⁡x=1cos⁡x\sec x=\frac{1}{\cos x}, undefined wherever cos⁡x=0\cos x=0.
Cosecant
csc⁡x=1sin⁡x\csc x=\frac{1}{\sin x}, undefined wherever sin⁡x=0\sin x=0.
Derivative of tangent
ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x=\sec^2x, which is positive wherever tangent is defined.
Derivative of secant
ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x=\sec x\tan x, the secant times the tangent.
Co-function sign
The derivatives of the three co-functions (cosine, cotangent and cosecant) each carry a minus sign.
Pythagorean identity
sin⁡2x+cos⁡2x=1\sin^2x+\cos^2x=1; it simplifies the quotient-rule numerators in the derivations.
Radians
All four derivatives assume angles in radians.

Deriving the four rules

Tangent. Write tan⁡x=sin⁡xcos⁡x\tan x=\frac{\sin x}{\cos x} and use the quotient rule with f=sin⁡xf=\sin x and g=cos⁡xg=\cos x. Then cos⁡x⋅cos⁡x−sin⁡x⋅(−sin⁡x)cos⁡2x=cos⁡2x+sin⁡2xcos⁡2x=1cos⁡2x=sec⁡2x\frac{\cos x\cdot\cos x-\sin x\cdot(-\sin x)}{\cos^2x}=\frac{\cos^2x+\sin^2x}{\cos^2x}=\frac{1}{\cos^2x}=\sec^2x.

Cotangent. Write cot⁡x=cos⁡xsin⁡x\cot x=\frac{\cos x}{\sin x}, so f=cos⁡xf=\cos x and g=sin⁡xg=\sin x. The numerator is (−sin⁡x)(sin⁡x)−cos⁡x⋅cos⁡x=−(sin⁡2x+cos⁡2x)=−1(-\sin x)(\sin x)-\cos x\cdot\cos x=-(\sin^2x+\cos^2x)=-1. Dividing by sin⁡2x\sin^2x gives −1sin⁡2x=−csc⁡2x-\frac{1}{\sin^2x}=-\csc^2x.

Secant. Write sec⁡x=1cos⁡x\sec x=\frac{1}{\cos x}, so f=1f=1 with f′=0f'=0. The numerator is 0⋅cos⁡x−1⋅(−sin⁡x)=sin⁡x0\cdot\cos x-1\cdot(-\sin x)=\sin x. The result is sin⁡xcos⁡2x=1cos⁡x⋅sin⁡xcos⁡x=sec⁡xtan⁡x\frac{\sin x}{\cos^2x}=\frac{1}{\cos x}\cdot\frac{\sin x}{\cos x}=\sec x\tan x.

Cosecant. Write csc⁡x=1sin⁡x\csc x=\frac{1}{\sin x}, so again f′=0f'=0. The numerator is 0−1⋅cos⁡x=−cos⁡x0-1\cdot\cos x=-\cos x. The result is −cos⁡xsin⁡2x=−1sin⁡x⋅cos⁡xsin⁡x=−csc⁡xcot⁡x\frac{-\cos x}{\sin^2x}=-\frac{1}{\sin x}\cdot\frac{\cos x}{\sin x}=-\csc x\cot x.

The six trigonometric derivatives together
FunctionDerivativeSign in front of the formula
sin⁡x\sin xcos⁡x\cos xno minus sign
cos⁡x\cos x−sin⁡x-\sin xminus sign: a co-function
tan⁡x\tan xsec⁡2x\sec^2xno minus sign
cot⁡x\cot x−csc⁡2x-\csc^2xminus sign: a co-function
sec⁡x\sec xsec⁡xtan⁡x\sec x\tan xno minus sign
csc⁡x\csc x−csc⁡xcot⁡x-\csc x\cot xminus sign: a co-function

Patterns that make them easy to remember

Each pair has a mirror. Replace tangent by cotangent, secant by cosecant, or sine by cosine, and the derivative formula flips to the co-function version with a minus sign attached. So tangent gives sec⁡2x\sec^2x and cotangent gives −csc⁡2x-\csc^2x; secant gives sec⁡xtan⁡x\sec x\tan x and cosecant gives −csc⁡xcot⁡x-\csc x\cot x. A useful consequence: the derivative of tangent is never negative, so tangent rises on every branch of its graph.

Another way to keep the formulas straight is by size. The derivative of secant has the same pieces as secant itself, one more factor of tangent. The derivative of tangent, 1cos⁡2x\frac{1}{\cos^2x}, is large near the vertical asymptotes. As xx approaches π2\frac{\pi}{2} from the left, cos⁡x\cos x is small and positive, so sec⁡2x\sec^2x becomes huge, matching the steep climb of the tangent graph. At x=0x=0 the slope of tangent is sec⁡20=1\sec^2 0=1, the same as the slope of y=xy=x near the origin.

A sign check using the graph: since sec⁡2x≥1\sec^2x\geq 1, the slope of tangent is never smaller than 11. Cotangent falls on every branch, so −csc⁡2x-\csc^2x is always negative. Always confirm the domain: tan⁡x\tan x and sec⁡x\sec x have no derivative at odd multiples of π2\frac{\pi}{2}.

A fully worked example

Problem: let y=xtan⁡x−2sec⁡xy=x\tan x-2\sec x. Find y′y' and evaluate it at x=π4x=\frac{\pi}{4}.

Differentiate the first term with the product rule: ddx[xtan⁡x]=1⋅tan⁡x+xsec⁡2x\frac{d}{dx}[x\tan x]=1\cdot\tan x+x\sec^2x. Differentiate the second term with linearity: ddx[−2sec⁡x]=−2sec⁡xtan⁡x\frac{d}{dx}[-2\sec x]=-2\sec x\tan x. So y′=tan⁡x+xsec⁡2x−2sec⁡xtan⁡xy'=\tan x+x\sec^2x-2\sec x\tan x.

Evaluate at x=π4x=\frac{\pi}{4}. Here tan⁡π4=1\tan\frac{\pi}{4}=1, sec⁡π4=2\sec\frac{\pi}{4}=\sqrt2, and so sec⁡2π4=2\sec^2\frac{\pi}{4}=2. Then y′(π4)=1+π4⋅2−2⋅2⋅1=1+π2−22y'(\frac{\pi}{4})=1+\frac{\pi}{4}\cdot 2-2\cdot\sqrt2\cdot 1=1+\frac{\pi}{2}-2\sqrt2. Numerically this is 1+1.5708−2.8284≈−0.2581+1.5708-2.8284\approx -0.258.

The function value there is y(π4)=π4⋅1−22=π4−22y(\frac{\pi}{4})=\frac{\pi}{4}\cdot 1-2\sqrt2=\frac{\pi}{4}-2\sqrt2, so the tangent line is y−(π4−22)=(1+π2−22)(x−π4)y-(\frac{\pi}{4}-2\sqrt2)=(1+\frac{\pi}{2}-2\sqrt2)(x-\frac{\pi}{4}). A graphing calculator can confirm the slope with a numerical derivative.

Quick slope checks: the slope of tan⁡x\tan x at x=π3x=\frac{\pi}{3} is sec⁡2π3=22=4\sec^2\frac{\pi}{3}=2^2=4, since cos⁡π3=12\cos\frac{\pi}{3}=\frac12. The slope of cot⁡x\cot x at x=π6x=\frac{\pi}{6} is −csc⁡2π6=−22=−4-\csc^2\frac{\pi}{6}=-2^2=-4, since sin⁡π6=12\sin\frac{\pi}{6}=\frac12.

Checking one answer two ways

Consider y=1+sin⁡xcos⁡xy=\frac{1+\sin x}{\cos x}. The quotient rule uses f=1+sin⁡xf=1+\sin x, f′=cos⁡xf'=\cos x, g=cos⁡xg=\cos x and g′=−sin⁡xg'=-\sin x. The numerator is cos⁡x⋅cos⁡x−(1+sin⁡x)(−sin⁡x)=cos⁡2x+sin⁡x+sin⁡2x\cos x\cdot\cos x-(1+\sin x)(-\sin x)=\cos^2x+\sin x+\sin^2x. Since cos⁡2x+sin⁡2x=1\cos^2x+\sin^2x=1, this is 1+sin⁡x1+\sin x, so y′=1+sin⁡xcos⁡2xy'=\frac{1+\sin x}{\cos^2x}.

Now split the original ratio first: y=1cos⁡x+sin⁡xcos⁡x=sec⁡x+tan⁡xy=\frac{1}{\cos x}+\frac{\sin x}{\cos x}=\sec x+\tan x. Differentiate with the new rules: y′=sec⁡xtan⁡x+sec⁡2x=sin⁡xcos⁡2x+1cos⁡2x=1+sin⁡xcos⁡2xy'=\sec x\tan x+\sec^2x=\frac{\sin x}{\cos^2x}+\frac{1}{\cos^2x}=\frac{1+\sin x}{\cos^2x}. The two answers agree, which is a good habit: when a ratio can be rewritten in a simpler form, use the second route to check the first.

This also shows the practical reason to learn the four formulas. Without them you can still differentiate any of these functions, but each question costs a full quotient-rule calculation. With them, the work is one line.

How it connects

  • Back to 2.7: the sine and cosine derivatives are the starting point for all four new rules.
  • Back to 2.9: every derivation here is the quotient rule applied to a ratio of sine and cosine.
  • Back to 2.8: expressions such as xtan⁡xx\tan x combine these rules with the product rule.
  • Forward to 3.1: with the chain rule you will differentiate forms like tan⁡(3x)\tan(3x) and sec⁡(x2)\sec(x^2).
  • Forward to 3.4: the derivative of arctangent is found from the slope of tangent, using sec⁡2x\sec^2x.

Common mistakes

  • **Writing sec⁡xtan⁡x\sec x\tan x for tangent.** The derivative of tan⁡x\tan x is sec⁡2x\sec^2x; sec⁡xtan⁡x\sec x\tan x belongs to secant.
  • Dropping the minus on a co-function. Both formulas begin with a minus sign: ddxcot⁡x=−csc⁡2x\frac{d}{dx}\cot x=-\csc^2x and ddxcsc⁡x=−csc⁡xcot⁡x\frac{d}{dx}\csc x=-\csc x\cot x.
  • **Confusing sec⁡2x\sec^2x with sec⁡(x2)\sec(x^2).** The first is (sec⁡x)2(\sec x)^2; the second needs the chain rule.
  • Using degrees. The rules hold only in radians, so evaluate tan⁡π4\tan\frac{\pi}{4}, not tan⁡45\tan 45.

How it shows up on the exam

  • Direct derivatives combining a tangent or secant with a power, often through the product or quotient rule.
  • Slope questions at an angle such as π4\frac{\pi}{4} or π3\frac{\pi}{3} where exact values of the trig functions are needed.
  • Expressions written with sine and cosine, such as 1cos⁡x\frac{1}{\cos x} or sin⁡xcos⁡x\frac{\sin x}{\cos x}, that are fastest to differentiate once you recognize them as sec⁡x\sec x or tan⁡x\tan x.

Check yourself

  1. How do you derive the derivative of tan⁡x\tan x from sine and cosine?
  2. Why is ddxtan⁡x\frac{d}{dx}\tan x never negative?
  3. What is the derivative of csc⁡x+cot⁡x\csc x+\cot x?
  4. Where does sec⁡x\sec x fail to have a derivative, and why?

Practice this topic. AP Practice questions on exactly what this lesson covers, with an explanation for every answer.