Skip to content

Unit 2: Differentiation: Definition and Fundamental Properties

Derivatives of Tangent, Cotangent, Secant, and Cosecant

Derive and use the derivatives of tan x, cot x, sec x and csc x by rewriting them in sine and cosine, and simplify with identities before differentiating.

Topic 2.10 · 5 min read

Tangent, cotangent, secant and cosecant are all built from sine and cosine by division: tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}, cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x}, sec⁡x=1cos⁡x\sec x = \frac{1}{\cos x}, csc⁡x=1sin⁡x\csc x = \frac{1}{\sin x}. So their derivatives need nothing new: the quotient rule (topic 2.9), the derivatives of sine and cosine (topic 2.7), and the identity sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1. Deriving them once shows you where each formula comes from, and the same rewriting habit lets you simplify many trig expressions before differentiating.

Tangent and cotangent

For tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}, the top has derivative cos⁡x\cos x and the bottom has derivative −sin⁡x-\sin x. The quotient rule gives

ddxtan⁡x=cos⁡x⋅cos⁡x−sin⁡x⋅(−sin⁡x)cos⁡2x=cos⁡2x+sin⁡2xcos⁡2x=1cos⁡2x=sec⁡2x.\frac{d}{dx}\tan x = \frac{\cos x\cdot\cos x - \sin x\cdot(-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x} = \sec^2 x.

The Pythagorean identity is what collapses the numerator to 1. This holds wherever cos⁡x≠0\cos x \neq 0, which is exactly where tan⁡x\tan x is defined.

The result says something about the graph. Since cos⁡2x≤1\cos^2 x \le 1, its reciprocal sec⁡2x\sec^2 x is always at least 1. So every tangent line to y=tan⁡xy = \tan x has slope at least 1: the graph rises on every interval of its domain, with its gentlest slope, exactly 1, at x=0,±π,…x = 0, \pm\pi, \ldots, where cos⁡2x=1\cos^2 x = 1. Near x=±π2x = \pm\frac{\pi}{2}, cos⁡x→0\cos x \to 0 and the slope grows without bound, matching the vertical asymptotes.

For cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x}:

ddxcot⁡x=(−sin⁡x)sin⁡x−cos⁡xcos⁡xsin⁡2x=−(sin⁡2x+cos⁡2x)sin⁡2x=−1sin⁡2x=−csc⁡2x,\frac{d}{dx}\cot x = \frac{(-\sin x)\sin x - \cos x\cos x}{\sin^2 x} = \frac{-\left(\sin^2 x + \cos^2 x\right)}{\sin^2 x} = -\frac{1}{\sin^2 x} = -\csc^2 x,

valid wherever sin⁡x≠0\sin x \neq 0. The minus sign means cotangent falls on every interval of its domain.

Secant and cosecant

Both are reciprocals, so the reciprocal form of the quotient rule, (1g)′=−g′g2\left(\frac{1}{g}\right)' = -\frac{g'}{g^2}, does the work. For sec⁡x=1cos⁡x\sec x = \frac{1}{\cos x}:

ddxsec⁡x=−−sin⁡xcos⁡2x=sin⁡xcos⁡2x=1cos⁡x⋅sin⁡xcos⁡x=sec⁡xtan⁡x.\frac{d}{dx}\sec x = -\frac{-\sin x}{\cos^2 x} = \frac{\sin x}{\cos^2 x} = \frac{1}{\cos x}\cdot\frac{\sin x}{\cos x} = \sec x\tan x.

The last step splits cos⁡2x\cos^2 x into two factors so the answer can be written with the familiar functions. For csc⁡x=1sin⁡x\csc x = \frac{1}{\sin x}:

ddxcsc⁡x=−cos⁡xsin⁡2x=−1sin⁡x⋅cos⁡xsin⁡x=−csc⁡xcot⁡x.\frac{d}{dx}\csc x = -\frac{\cos x}{\sin^2 x} = -\frac{1}{\sin x}\cdot\frac{\cos x}{\sin x} = -\csc x\cot x.

The pattern makes these easy to keep straight. Each "co" function's derivative is its partner's derivative with every function swapped for its co-function and a minus sign in front: tan⁡→cot⁡\tan \to \cot, sec⁡→csc⁡\sec \to \csc, and a negative sign. That is the same pattern as sin⁡x→cos⁡x\sin x \to \cos x versus cos⁡x→−sin⁡x\cos x \to -\sin x.

Equivalent forms are all correct. Because 1+tan⁡2x=sec⁡2x1 + \tan^2 x = \sec^2 x (divide sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1 by cos⁡2x\cos^2 x), the derivative of tan⁡x\tan x can also be written 1+tan⁡2x1 + \tan^2 x or 1cos⁡2x\frac{1}{\cos^2 x}. Exam answers in any equivalent form earn credit, and multiple-choice questions sometimes list the derivative in one of the less familiar forms.

Rewrite with identities first

These four rules plus the ones from topics 2.6 to 2.9 can differentiate any combination of trig functions, but rewriting first often turns a long calculation into a short one. The tools are the definitions and the Pythagorean identities:

tan⁡x=sin⁡xcos⁡x,sec⁡x=1cos⁡x,sin⁡2x+cos⁡2x=1,1+tan⁡2x=sec⁡2x,1+cot⁡2x=csc⁡2x.\tan x = \frac{\sin x}{\cos x}, \quad \sec x = \frac{1}{\cos x}, \quad \sin^2 x + \cos^2 x = 1, \quad 1 + \tan^2 x = \sec^2 x, \quad 1 + \cot^2 x = \csc^2 x.

Some quick cases:

  • cos⁡xtan⁡x=cos⁡x⋅sin⁡xcos⁡x=sin⁡x\cos x\tan x = \cos x\cdot\frac{\sin x}{\cos x} = \sin x (where cos⁡x≠0\cos x \neq 0), so its derivative is cos⁡x\cos x, without the product rule.
  • sec⁡xtan⁡x=1cos⁡x⋅cos⁡xsin⁡x=csc⁡x\frac{\sec x}{\tan x} = \frac{1}{\cos x}\cdot\frac{\cos x}{\sin x} = \csc x, so its derivative is −csc⁡xcot⁡x-\csc x\cot x, without the quotient rule.
  • sec⁡2x−tan⁡2x=1\sec^2 x - \tan^2 x = 1, a constant, so its derivative is 0.

The rewritten function equals the original only where the original is defined. cos⁡xtan⁡x\cos x\tan x is undefined at x=π2x = \frac{\pi}{2} even though sin⁡x\sin x is not, so the derivative cos⁡x\cos x applies only where cos⁡x≠0\cos x \neq 0.

Evaluating these derivatives at special angles is where arithmetic errors happen. Get each value from sine and cosine:

xxsin⁡x\sin xcos⁡x\cos xtan⁡x\tan xsec⁡x\sec xsec⁡2x\sec^2 x
π6\frac{\pi}{6}12\frac{1}{2}32\frac{\sqrt{3}}{2}13\frac{1}{\sqrt{3}}23\frac{2}{\sqrt{3}}43\frac{4}{3}
π4\frac{\pi}{4}22\frac{\sqrt{2}}{2}22\frac{\sqrt{2}}{2}112\sqrt{2}22
π3\frac{\pi}{3}32\frac{\sqrt{3}}{2}12\frac{1}{2}3\sqrt{3}2244

Worked examples

Worked exampleExample 1: evaluating at a special angle

Let f(x)=3tan⁡x−2sec⁡xf(x) = 3\tan x - 2\sec x. Find f′(π3)f'\left(\dfrac{\pi}{3}\right).

Show solution

Differentiate term by term with the constant multiple rule:

f′(x)=3sec⁡2x−2sec⁡xtan⁡x.f'(x) = 3\sec^2 x - 2\sec x\tan x.

At x=π3x = \frac{\pi}{3}, cos⁡x=12\cos x = \frac{1}{2}, so sec⁡x=2\sec x = 2 and sec⁡2x=4\sec^2 x = 4, and tan⁡x=3\tan x = \sqrt{3}:

f′(π3)=3(4)−2(2)(3)=12−43.f'\left(\tfrac{\pi}{3}\right) = 3(4) - 2(2)\left(\sqrt{3}\right) = 12 - 4\sqrt{3}.
Worked exampleExample 2: simplify, then differentiate

Find dydx\dfrac{dy}{dx} for y=1−cos⁡2xsin⁡xcos⁡xy = \dfrac{1 - \cos^2 x}{\sin x\cos x}.

Show solution

Differentiating this as it stands needs the quotient rule and a product rule in the denominator. Rewrite first. By the Pythagorean identity the numerator is sin⁡2x\sin^2 x, so wherever sin⁡x≠0\sin x \neq 0 and cos⁡x≠0\cos x \neq 0,

y=sin⁡2xsin⁡xcos⁡x=sin⁡xcos⁡x=tan⁡x.y = \frac{\sin^2 x}{\sin x\cos x} = \frac{\sin x}{\cos x} = \tan x.

Therefore

dydx=sec⁡2x,\frac{dy}{dx} = \sec^2 x,

for every xx where the original function is defined (that is, where neither sin⁡x\sin x nor cos⁡x\cos x is 0).

Worked exampleExample 3: a product with secant

Write an equation for the line tangent to the graph of h(x)=xsec⁡xh(x) = x\sec x at x=π3x = \dfrac{\pi}{3}.

Show solution

The point: h(π3)=π3⋅2=2π3h\left(\frac{\pi}{3}\right) = \frac{\pi}{3}\cdot 2 = \frac{2\pi}{3}.

The slope: hh is a product, so

h′(x)=1⋅sec⁡x+xsec⁡xtan⁡x.h'(x) = 1\cdot\sec x + x\sec x\tan x.

At x=π3x = \frac{\pi}{3}, with sec⁡x=2\sec x = 2 and tan⁡x=3\tan x = \sqrt{3},

h′(π3)=2+π3(2)(3)=2+23 π3.h'\left(\tfrac{\pi}{3}\right) = 2 + \frac{\pi}{3}(2)\left(\sqrt{3}\right) = 2 + \frac{2\sqrt{3}\,\pi}{3}.

The tangent line is

y=2π3+(2+23 π3)(x−π3).y = \frac{2\pi}{3} + \left(2 + \frac{2\sqrt{3}\,\pi}{3}\right)\left(x - \frac{\pi}{3}\right).

There is nothing to gain from simplifying further; point-slope form with exact values is a complete answer.

Worked exampleExample 4: an exam-style free-response question (no calculator)

Let g(x)=2x−tan⁡xg(x) = 2x - \tan x for −π2<x<π2-\dfrac{\pi}{2} < x < \dfrac{\pi}{2}.

(a) Find g′(x)g'(x).

(b) Find all xx in the interval at which the graph of gg has a horizontal tangent line.

(c) Is there any xx in the interval at which the line tangent to the graph of gg has slope 3? Justify your answer.

Show solution

(a) g′(x)=2−sec⁡2xg'(x) = 2 - \sec^2 x.

(b) Set g′(x)=0g'(x) = 0: sec⁡2x=2\sec^2 x = 2, so cos⁡2x=12\cos^2 x = \frac{1}{2} and cos⁡x=22\cos x = \frac{\sqrt{2}}{2} (cosine is positive on this interval, so the negative root is not possible). Then x=−π4x = -\frac{\pi}{4} or x=π4x = \frac{\pi}{4}.

(c) No. For every xx in the interval, 0<cos⁡2x≤10 < \cos^2 x \le 1, so sec⁡2x=1cos⁡2x≥1\sec^2 x = \frac{1}{\cos^2 x} \ge 1. Therefore g′(x)=2−sec⁡2x≤2−1=1g'(x) = 2 - \sec^2 x \le 2 - 1 = 1. The slope of the graph of gg is never greater than 1, so it is never 3.

Part (c) is the kind of question where a bound on the derivative is the whole argument. The justification must say why sec⁡2x≥1\sec^2 x \ge 1, not only that g′(x)=3g'(x) = 3 "has no solution".

Where students lose points

On the exam

These four formulas are expected from memory; no formula sheet gives them, and they appear inside product, quotient and chain-rule problems as well as on their own. On no-calculator questions, evaluating them at π6\frac{\pi}{6}, π4\frac{\pi}{4} and π3\frac{\pi}{3} by hand is part of the task, and exact answers such as 12−4312 - 4\sqrt{3} need no decimal approximation.

Check yourself

  1. Question 1

    What is the derivative of cot⁡x\cot x at x=π4x = \dfrac{\pi}{4}?

    1. A

      22

    2. B

      −1-1

    3. C

      −2-2

    4. D

      −2-\sqrt{2}

    Show answer

    C

    ddxcot⁡x=−csc⁡2x\frac{d}{dx}\cot x = -\csc^2 x, and csc⁡π4=2\csc\frac{\pi}{4} = \sqrt{2}, so the value is −2-2. Choice A drops the minus sign, and choice D forgets to square csc⁡x\csc x.

  2. Question 2

    Find ddx(tan⁡2x−sec⁡2x)\dfrac{d}{dx}\left(\tan^2 x - \sec^2 x\right).

    Show answer

    00

    Since 1+tan⁡2x=sec⁡2x1 + \tan^2 x = \sec^2 x, the expression equals −1-1 wherever it is defined, and a constant has derivative 0. Differentiating each term separately also works, but the identity shows the answer at once.

  3. Question 3

    Write an equation for the line tangent to the graph of y=csc⁡xy = \csc x at x=π2x = \dfrac{\pi}{2}.

    Show answer

    y=1y = 1

    The point is (π2,csc⁡π2)=(π2,1)\left(\frac{\pi}{2}, \csc\frac{\pi}{2}\right) = \left(\frac{\pi}{2}, 1\right). The slope is −csc⁡π2cot⁡π2=−(1)(0)=0-\csc\frac{\pi}{2}\cot\frac{\pi}{2} = -(1)(0) = 0, so the tangent line is horizontal.

  4. Question 4

    For how many values of xx in −π2<x<π2-\dfrac{\pi}{2} < x < \dfrac{\pi}{2} is the derivative of tan⁡x\tan x equal to 12\dfrac{1}{2}?

    1. A

      One

    2. B

      None

    3. C

      Two

    4. D

      Infinitely many

    Show answer

    B

    The derivative is sec⁡2x=1cos⁡2x\sec^2 x = \frac{1}{\cos^2 x}, and cos⁡2x≤1\cos^2 x \le 1 makes it at least 1 everywhere, so it never equals 12\frac{1}{2}. Choice C comes from solving cos⁡2x=12\cos^2 x = \frac{1}{2}, which is where the derivative equals 2, not 12\frac{1}{2}.

Go deeper