# Derivatives of tan, cot, sec, csc

> AP Calculus BC · Differentiation: Definition and Fundamental Properties
> Source: https://www.owlsprep.com/study/ap-calculus-bc-u2-derivatives-of-tan-cot-sec/

This sub-topic covers derivative formulas for $\tan x$, $\cot x$, $\sec x$, and $\csc x$, their derivation via the quotient rule, application to routine and chain rule problems, and how to avoid common errors tested on the AP Calculus BC exam.

**Prerequisites:** Derivatives of sine and cosine; [Quotient rule for differentiation](https://www.owlsprep.com/study/ap-calculus-bc-u2-quotient-rule/); [Chain rule for composite functions](https://www.owlsprep.com/study/ap-calculus-bc-u2-chain-rule-composite-functions/)

## Learning objectives

- Derive derivative formulas for $\tan x$, $\cot x$, $\sec x$, and $\csc x$ using the quotient rule
- Apply these formulas with basic differentiation rules to combined trigonometric functions
- Use the chain rule to differentiate composite functions involving these trigonometric terms
- Identify and avoid common sign, chain rule, and domain errors on AP exam questions

## Deriving the Four Trigonometric Derivative Formulas

All four derivatives can be derived directly by rewriting the target trigonometric function in terms of sine and cosine, then applying the quotient rule. This is a useful skill to confirm formulas on exam day if you forget the sign or form.

Recall the quotient rule for $f(x) = \frac{g(x)}{h(x)}$:

$$f'(x) = \frac{g'(x)h(x) - g(x)h'(x)}{[h(x)]^2}$$

We start with $\tan x = \frac{\sin x}{\cos x}$. Using $g(x) = \sin x$ ($g'(x) = \cos x$) and $h(x) = \cos x$ ($h'(x) = -\sin x$), substitute into the quotient rule:

$$\frac{d}{dx}\tan x = \frac{(\cos x)(\cos x) - (\sin x)(-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x}$$

Using the Pythagorean identity $\sin^2 x + \cos^2 x = 1$, this simplifies to $\frac{1}{\cos^2 x} = \sec^2 x$. Repeating this process for the other three functions gives the full set of standard formulas:

- $\frac{d}{dx}\cot x = -\csc^2 x$
- $\frac{d}{dx}\sec x = \sec x \tan x$
- $\frac{d}{dx}\csc x = -\csc x \cot x$

**Worked example:** Derive $\frac{d}{dx}\csc x$ using the quotient rule, confirming the standard derivative formula.

1. Rewrite $\csc x$ in terms of sine: $\csc x = \frac{1}{\sin x}$, so $f(x) = \frac{g(x)}{h(x)}$ with $g(x) = 1$ and $h(x) = \sin x$.
2. Identify derivatives of the numerator and denominator: $g'(x) = 0$, $h'(x) = \cos x$.
3. Apply the quotient rule:

   $$f'(x) = \frac{(0)(\sin x) - (1)(\cos x)}{\sin^2 x} = \frac{-\cos x}{\sin^2 x}$$
4. Rewrite in terms of cosecant and cotangent:

   $$\frac{-\cos x}{\sin^2 x} = -\frac{1}{\sin x} \cdot \frac{\cos x}{\sin x} = -\csc x \cot x, which matches the standard formula.$$

> **Exam tip:** If you blank on the sign or form of a derivative on exam day, quickly rederive it in the margin using the quotient rule—this takes 30 seconds and eliminates guesswork.

## Routine Differentiation of Combined Functions

Once you memorize the four derivative formulas, you can combine them with other basic differentiation rules (sum, difference, constant multiple, product, quotient) to differentiate functions that include these trigonometric terms. This is the most common direct application tested on the AP Calculus BC multiple-choice section.

Domain rules from trigonometry still apply: a function is only differentiable at points where it is defined, so derivatives of these functions will be undefined at the same points where the original function has vertical asymptotes. For example, $\tan x$ is undefined at $x = \frac{\pi}{2} + k\pi$ for all integers $k$, so its derivative $\sec^2 x$ is also undefined at these points.

**Worked example:** Find the derivative of $f(x) = 4\sec x - 2\cot x + x^2$, and evaluate $f'\left(\frac{\pi}{4}\right)$.

1. Differentiate term-by-term using the sum/difference and constant multiple rules:
- $\frac{d}{dx}[4\sec x] = 4 \cdot \frac{d}{dx}\sec x = 4\sec x \tan x$
- $\frac{d}{dx}[-2\cot x] = -2 \cdot \frac{d}{dx}\cot x = -2(-\csc^2 x) = 2\csc^2 x$
- $\frac{d}{dx}[x^2] = 2x$
2. Combine terms to get the general derivative:

   $$f'(x) = 4\sec x \tan x + 2\csc^2 x + 2x$$
3. Substitute $x = \frac{\pi}{4}$ and use unit circle values ($\sec(\frac{\pi}{4}) = \sqrt{2}$, $\tan(\frac{\pi}{4}) = 1$, $\csc(\frac{\pi}{4}) = \sqrt{2}$):

   $$f'\left(\frac{\pi}{4}\right) = 4(\sqrt{2})(1) + 2(\sqrt{2})^2 + 2\left(\frac{\pi}{4}\right) = 4\sqrt{2} + 4 + \frac{\pi}{2}$$

> **Exam tip:** When evaluating derivatives at common angles, double-check your unit circle values—AP exam distractors often use incorrect trigonometric values for angles like $\frac{\pi}{4}$ or $\frac{\pi}{6}$.

## Differentiating Composite Functions with the Chain Rule

Most AP exam questions involving these derivatives use composite functions, where the trigonometric term is a function of a non-trivial inner function (e.g. $\tan(2x^3)$, $\csc(5x + 1)$). For these problems, you must always apply the chain rule.

The process is: (1) identify the outer trigonometric function and inner function, (2) compute the derivative of the outer function (using the standard trigonometric derivative formula) evaluated at the inner function, (3) multiply by the derivative of the inner function, (4) substitute the inner function back into the final result. This skill is foundational for advanced topics like implicit differentiation, related rates, and integration by substitution.

**Worked example:** Find the derivative of $y = \csc(3x^2 + 5x)$.

1. Identify outer and inner functions: let $u = 3x^2 + 5x$ (inner), so $y = \csc u$ (outer).
2. Compute derivatives of outer and inner: $\frac{dy}{du} = -\csc u \cot u$ (from the standard derivative formula), $\frac{du}{dx} = 6x + 5$.
3. Apply the chain rule $\frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx}$:

   $$\frac{dy}{dx} = -\csc u \cot u \cdot (6x + 5)$$
4. Substitute back $u = 3x^2 + 5x$ to get the final result:

   $$\frac{dy}{dx} = -(6x + 5)\csc(3x^2 + 5x)\cot(3x^2 + 5x)$$

> **Exam tip:** Even for simple composite functions like $\tan(5x)$, explicitly write down the inner derivative before finishing your work—this eliminates the common mistake of forgetting the chain rule factor.

## AP-Style Worked Practice Problems

**Worked example:** What is the derivative of $f(x) = x \cot x$?

A. $x \csc^2 x + \cot x$
B. $-x \csc^2 x + \cot x$
C. $-x \csc^2 x - \cot x$
D. $\csc^2 x$

1. Use the product rule for differentiation: $\frac{d}{dx}[uv] = u'v + uv'$. Let $u = x$ so $u' = 1$, and $v = \cot x$ so $v' = -\csc^2 x$.
2. Substitute into the product rule:

   $$f'(x) = (1)\cot x + (x)(-\csc^2 x) = -x \csc^2 x + \cot x$$
3. Options A, C, and D have incorrect signs or miss the product rule term, so the correct answer is B.

**Worked example:** Let $f(x) = \tan\left(\frac{x}{2}\right) + \sec x$ for $-\frac{\pi}{2} < x < \frac{\pi}{2}$.
(a) Find $f'(x)$
(b) Find the slope of the tangent line at $x = 0$
(c) Write the equation of the tangent line at $x = 0$

1. (a) Differentiate term-by-term, applying the chain rule to the first term. For $\tan\left(\frac{x}{2}\right)$, outer derivative is $\sec^2 u$ and inner derivative of $u = \frac{x}{2}$ is $\frac{1}{2}$. For $\sec x$, derivative is $\sec x \tan x$.

   $$f'(x) = \frac{1}{2}\sec^2\left(\frac{x}{2}\right) + \sec x \tan x$$
2. (b) The slope of the tangent line at $x=0$ is $f'(0)$. Substitute $x=0$, using $\sec(0) = 1$, $\tan(0) = 0$:

   $$f'(0) = \frac{1}{2}\sec^2(0) + \sec(0)\tan(0) = \frac{1}{2}(1)^2 + (1)(0) = \frac{1}{2}$$
3. (c) First find the point $(0, f(0))$: $f(0) = \tan(0) + \sec(0) = 0 + 1 = 1$. Use point-slope form $y - y_1 = m(x - x_1)$:

   $$y - 1 = \frac{1}{2}x \implies y = \frac{1}{2}x + 1$$

## Common pitfalls

- **Wrong:** Writing $\frac{d}{dx}\tan x = \csc^2 x$ instead of $\sec^2 x$
  - Why it fails: Students confuse the derivative patterns of tangent and cotangent, mixing up which reciprocal function matches which derivative.
  - Correct: If you can't remember the form, rederive the derivative of $\tan x$ in 30 seconds using the quotient rule to confirm.
- **Wrong:** Writing $\frac{d}{dx}\sec x = \sec x \cot x$ and $\frac{d}{dx}\csc x = -\sec x \tan x$, swapping the product terms
  - Why it fails: The product structures for secant and cosecant derivatives are similar, so students mix up the paired trigonometric factors.
  - Correct: Use the mnemonic: sec pairs with tan, csc pairs with cot, all co-functions get a negative sign.
- **Wrong:** Forgetting the inner derivative factor for $\frac{d}{dx}\tan(5x) = \sec^2(5x)$, missing the factor of 5
  - Why it fails: Students memorize the outer derivative and stop, forgetting the chain rule requirement for any composite function.
  - Correct: For any trigonometric function of anything other than just $x$, always ask 'what is the derivative of the inside?' and multiply by that result before finishing.
- **Wrong:** Missing the negative sign on $\frac{d}{dx}\cot x$, writing it as $\csc^2 x$
  - Why it fails: Students forget the negative sign that arises naturally from the quotient rule derivation for co-functions.
  - Correct: Always add a negative sign when differentiating any trigonometric function that starts with 'co-' (cotangent, cosecant).
- **Wrong:** Calculating $f'\left(\frac{\pi}{2}\right)$ for $f(x) = \tan x$, claiming the derivative exists at this point
  - Why it fails: Students confuse the derivative formula with domain of differentiability—if the original function is undefined at a point, it cannot be differentiable there.
  - Correct: Always confirm the original function is defined at a point before evaluating the derivative at that point.

## Cheatsheet

| Function | Derivative Formula | Key Notes |
| --- | --- | --- |
| $\tan x$ | $\frac{d}{dx}\tan x = \sec^2 x$ | Undefined at $x = \frac{\pi}{2} + k\pi, k \in \mathbb{Z}$ |
| $\cot x$ | $\frac{d}{dx}\cot x = -\csc^2 x$ | Negative for co-function; undefined at $x = k\pi, k \in \mathbb{Z}$ |
| $\sec x$ | $\frac{d}{dx}\sec x = \sec x \tan x$ | No negative sign; undefined at $x = \frac{\pi}{2} + k\pi, k \in \mathbb{Z}$ |
| $\csc x$ | $\frac{d}{dx}\csc x = -\csc x \cot x$ | Negative for co-function; undefined at $x = k\pi, k \in \mathbb{Z}$ |
| Composite $f(g(x))$ | $\frac{d}{dx}f(g(x)) = f'(g(x))g'(x)$ | Always multiply by inner derivative when $g(x) \neq x$ |
| Product $u(x)v(x)$ | $\frac{d}{dx}[u(x)v(x)] = u'v + uv'$ | Use when $\tan x, \sec x$ are multiplied by another function |
| Quotient rule | $\frac{d}{dx}\left(\frac{g}{h}\right) = \frac{g'h - gh'}{h^2}$ | Use to re-derive formulas on exam day if you forget |

## What's next

Mastering the derivatives of $\tan, \cot, \sec, \csc$ is an essential prerequisite for all upcoming differentiation topics, starting with implicit differentiation and derivatives of inverse trigonometric functions. Many implicit differentiation problems include combinations of all six trigonometric functions, so you need to differentiate these four terms quickly and correctly to avoid early errors that cascade through the rest of your work. This topic also feeds into chain rule applications, related rates, optimization, integration of trigonometric functions, and differential equations later in the course. Without these four derivative formulas memorized and readily accessible, you will struggle to make progress on nearly all multi-step FRQ problems that involve trigonometric functions.

- [Differentiation: Composite, Implicit, and Inverse Functions](https://www.owlsprep.com/study/ap-calculus-bc-u3-overview/)
- [Chain Rule](https://www.owlsprep.com/study/ap-calculus-bc-u3-chain-rule/)
- [Implicit Differentiation](https://www.owlsprep.com/study/ap-calculus-bc-u3-implicit-differentiation/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ap-calculus-bc-u2-derivatives-of-tan-cot-sec/
