Derivatives of tan, cot, sec and csc
The other four trig functions are built from sine and cosine, so their derivatives come from the quotient rule. This guide derives them, shows a pattern that makes the signs easy to remember, and uses them in tangent lines and products.
\(\dfrac{d}{dx}[\tan x] = \sec^2 x\), \(\dfrac{d}{dx}[\cot x] = -\csc^2 x\), \(\dfrac{d}{dx}[\sec x] = \sec x\tan x\), and \(\dfrac{d}{dx}[\csc x] = -\csc x\cot x\). Each one follows from writing the function in terms of sine and cosine and using the quotient rule. The “co” functions (cotangent and cosecant) get minus signs, matching \(\frac{d}{dx}[\cos x] = -\sin x\).
1The four rules
| Function | Derivative | As sine and cosine |
|---|---|---|
| \(\tan x\) | \(\sec^2 x\) | \(\frac{\sin x}{\cos x}\) |
| \(\cot x\) | \(-\csc^2 x\) | \(\frac{\cos x}{\sin x}\) |
| \(\sec x\) | \(\sec x\tan x\) | \(\frac{1}{\cos x}\) |
| \(\csc x\) | \(-\csc x\cot x\) | \(\frac{1}{\sin x}\) |
Pair each function with its “co” partner: tan with cot, sec with csc. The co-function’s derivative is the partner’s derivative with every function swapped for its co-version and a minus sign added: \(\sec^2 x \rightarrow -\csc^2 x\) and \(\sec x\tan x \rightarrow -\csc x\cot x\).
2Where they come from
\(\dfrac{d}{dx}[\tan x]\)
- 1Rewrite: \(\tan x = \dfrac{\sin x}{\cos x}\). Use the quotient rule.
- 2\(\dfrac{\cos x \cdot \cos x - \sin x \cdot (-\sin x)}{\cos^2 x} = \dfrac{\cos^2 x + \sin^2 x}{\cos^2 x}\).
- 3The top is 1 (Pythagorean identity), so the result is \(\dfrac{1}{\cos^2 x} = \sec^2 x\).
\(\dfrac{d}{dx}[\sec x]\)
- 1\(\sec x = \dfrac{1}{\cos x}\). Quotient rule with top 1 (derivative 0):
- 2\(\dfrac{0 \cdot \cos x - 1 \cdot (-\sin x)}{\cos^2 x} = \dfrac{\sin x}{\cos^2 x}\).
- 3Split it: \(\dfrac{1}{\cos x} \cdot \dfrac{\sin x}{\cos x} = \sec x \tan x\).
\(\tan x\) gives \(\sec^2 x\); \(\sec x\) gives \(\sec x\tan x\). One way to keep them apart: the derivative of tangent “squares the secant,” and the derivative of secant “keeps the secant and brings in the tangent.”
3Using the rules
\(y = x\tan x\) at \(x = \frac{\pi}{4}\)
- 1Product rule: \(y' = \tan x + x\sec^2 x\).
- 2At \(\frac{\pi}{4}\): \(\tan\frac{\pi}{4} = 1\) and \(\sec^2\frac{\pi}{4} = (\sqrt2)^2 = 2\).
- 3\(y' = 1 + \frac{\pi}{4} \cdot 2 = 1 + \frac{\pi}{2}\).
\(y = \sec x\) at \(x = \frac{\pi}{3}\)
- 1Point: \(\sec\frac{\pi}{3} = \dfrac{1}{\cos\frac{\pi}{3}} = \dfrac{1}{1/2} = 2\), so \(\left(\frac{\pi}{3}, 2\right)\).
- 2Slope: \(\sec\frac{\pi}{3}\tan\frac{\pi}{3} = 2\sqrt3\).
“The slope of \(y = \sec x\) at \(x = \frac{\pi}{3}\) is \(\sec\frac{\pi}{3}\tan\frac{\pi}{3} = 2\sqrt3\), so the tangent line is \(y = 2 + 2\sqrt3\left(x - \frac{\pi}{3}\right)\).”
\(\frac{d}{dx}[\cot x] = -\csc^2 x\). A quick check: on \((0, \pi)\), \(\cot x\) falls from very large values to very negative values, so its slope must be negative.
\(\sec\frac{\pi}{3} = \frac{1}{\cos(\pi/3)} = 2\), not \(\frac12\). Find the cosine first, then flip it.
4Simplify first
\(f(x) = \dfrac{1 + \tan x}{\sec x}\)
- 1Multiply out: \(\dfrac{1}{\sec x} + \dfrac{\tan x}{\sec x} = \cos x + \dfrac{\sin x}{\cos x} \cdot \cos x = \cos x + \sin x\).
- 2Differentiate the simple form: \(-\sin x + \cos x\).
Quick reference
| Function | Derivative | Exact values worth knowing |
|---|---|---|
| \(\tan x\) | \(\sec^2 x\) | \(\sec^2 0 = 1\), \(\sec^2\frac{\pi}{4} = 2\), \(\sec^2\frac{\pi}{3} = 4\) |
| \(\cot x\) | \(-\csc^2 x\) | \(\csc^2\frac{\pi}{2} = 1\), \(\csc^2\frac{\pi}{4} = 2\) |
| \(\sec x\) | \(\sec x\tan x\) | \(\sec\frac{\pi}{3} = 2\), \(\tan\frac{\pi}{3} = \sqrt3\) |
| \(\csc x\) | \(-\csc x\cot x\) | \(\csc\frac{\pi}{6} = 2\), \(\cot\frac{\pi}{6} = \sqrt3\) |