AP Calculus AB • Differentiation: Definition and Fundamental Properties

Finding the Derivatives of Tangent, Cotangent, Secant, and/or Cosecant Functions

Extend your derivative toolkit beyond sine and cosine to master all six trigonometric functions.

AP Calculus AB illustration with a smooth curve, infinity sign, and measuring ruler
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The story of differentiating trigonometric functions is inseparable from the broader development of calculus itself. While Isaac Newton and Gottfried Wilhelm Leibniz independently formulated the core ideas of calculus in the late seventeenth century, the systematic differentiation of all six trigonometric functions unfolded over subsequent decades as mathematicians refined the chain of logical dependencies linking sine and cosine to the remaining four ratios. The derivatives of tangent, cotangent, secant, and cosecant were not discovered in isolation; rather, they emerged naturally once the quotient rule and the fundamental limit sin(h)/h → 1 were firmly established.

1665–1676 • Newton & Leibniz Develop Calculus

Newton's method of fluxions and Leibniz's differential calculus provide the foundational framework for computing rates of change, including those of trigonometric ratios.

1748 • Euler's Introductio in Analysin Infinitorum

Leonhard Euler formalizes the six trigonometric functions as ratios and infinite series, unifying their analytic treatment and making systematic differentiation feasible.

1755 • Euler's Institutiones Calculi Differentialis

Euler publishes explicit derivative formulas for all trigonometric functions, demonstrating how the quotient rule applied to sin x / cos x yields sec²x for the derivative of tan x.

1821 • Cauchy Rigorizes Limits

Augustin-Louis Cauchy's Cours d'Analyse provides the epsilon-delta definition of a limit, placing the foundational limit lim(h→0) sin h / h = 1 on rigorous footing and securing the derivatives of all trig functions.

If you already know that d/dx [sin x] = cos x and d/dx [cos x] = −sin x, the natural follow-up question is: what are the derivatives of the four remaining trigonometric functions? Because tan x, cot x, sec x, and csc x are all quotients (or reciprocals) of sin x and cos x, we can derive each formula using the quotient rule—a technique that transforms the problem into straightforward algebra with familiar ingredients.

SECTION 2

Core Principles & Definitions

Before diving into the derivative formulas, it is essential to recall the algebraic identities that express each function in terms of sine and cosine. These identities form the backbone of every derivation, because once you express a function as a quotient of sin x and cos x, the quotient rule does the rest. The Pythagorean identity sin²x + cos²x = 1 appears repeatedly when simplifying the results, and recognizing it quickly is the single most important algebraic skill for this topic.

1

Prerequisite Derivatives

d/dx [sin x] = cos x and d/dx [cos x] = −sin x. These two results, proven from the limit definition, are the seeds from which all other trig derivatives grow.
2

Quotient Rule

If f(x) = g(x)/h(x) and h(x) ≠ 0, then f ′(x) = [h(x)g ′(x) − g(x)h ′(x)] / [h(x)]². This rule is applied four times to produce the four derivative formulas.
3

Pythagorean Identity

sin²x + cos²x = 1. Dividing through by cos²x gives 1 + tan²x = sec²x; dividing by sin²x gives 1 + cot²x = csc²x. Both forms appear in simplified derivative results.
4

Domain Awareness

Each derivative exists only where the original function is defined. Tangent and secant are undefined at x = π/2 + nπ; cotangent and cosecant are undefined at x = nπ, where n is any integer.
✦

KEY TAKEAWAY

Think of sin x and cos x as the two raw materials in a factory. Tangent, cotangent, secant, and cosecant are four different products assembled from those same two raw materials. To find the rate at which any product changes, you just need the rate at which each raw material changes (which you already know) and the assembly instructions (the quotient rule). Once you assemble and simplify, the Pythagorean identity tidies everything up into compact formulas.

SECTION 3

Visual Explanation — The Function-Derivative Relationship

The graph below shows y = tan x alongside its derivative y = sec²x over the interval (−π/2, π/2). Observe that tan x has its flattest slope at x = 0, where sec²(0) = 1, and the slope increases without bound as x approaches ±π/2, exactly where sec²x tends to infinity. The vertical asymptotes of tan x coincide with the points where sec²x is undefined, reinforcing the intimate connection between a function's domain restrictions and its derivative's behavior.

05−5100π/4−π/4π/2−π/2y = tan xy = sec²x (derivative)tan x and its Derivative sec²x
The cyan solid curve is y = tan x and the pink dashed curve is y = sec²x. Notice that sec²x ≥ 1 everywhere it is defined, confirming that tan x is always increasing on each branch.

A crucial geometric insight is that sec²x ≥ 1 for all x in its domain. This means the tangent function is strictly increasing on every interval where it is continuous—a fact that is immediately visible from the graph and algebraically verifiable since sec²x = 1 + tan²x, which is the sum of 1 and a squared term. The cotangent function, by contrast, has derivative −csc²x, which is always negative, so cot x is strictly decreasing on each of its branches.

SECTION 4

Mathematical Framework — Deriving the Formulas

Each of the four derivatives below is derived by expressing the function as a quotient of sin x and cos x (or their reciprocals) and then applying the quotient rule. The Pythagorean identity is used in every simplification step. Below we present the four formulas and then walk through the full derivation of two of them.

DERIVATIVE OF TANGENT

d/dx[tanx]=sec2xd/dx [tan x] = sec²x

Since tan x = sin x / cos x, apply the quotient rule: (cos x · cos x − sin x · (−sin x)) / cos²x = (cos²x + sin²x) / cos²x = 1 / cos²x = sec²x.

DERIVATIVE OF COTANGENT

d/dx[cotx]=−csc2xd/dx [cot x] = −csc²x

Since cot x = cos x / sin x, apply the quotient rule: (sin x · (−sin x) − cos x · cos x) / sin²x = −(sin²x + cos²x) / sin²x = −1 / sin²x = −csc²x.

DERIVATIVE OF SECANT

d/dx[secx]=secxtanxd/dx [sec x] = sec x tan x

Since sec x = 1 / cos x, apply the quotient rule: (cos x · 0 − 1 · (−sin x)) / cos²x = sin x / cos²x = (1/cos x)(sin x / cos x) = sec x tan x.

DERIVATIVE OF COSECANT

d/dx[cscx]=−cscxcotxd/dx [csc x] = −csc x cot x

Since csc x = 1 / sin x, apply the quotient rule: (sin x · 0 − 1 · cos x) / sin²x = −cos x / sin²x = −(1/sin x)(cos x / sin x) = −csc x cot x.

💡

Mnemonic: The Co-Function Sign Pattern

Notice that the derivatives of the three "co-" functions (cos x, cot x, csc x) each carry a negative sign, whereas sin x, tan x, and sec x all have positive derivatives. This pattern—"co-functions get the minus"—is a reliable memorization aid.

A three-part studio scene showing a wall spotlight, overhead camera, and point-light wall shadow.A rotating light turns angle change into motion along a wall. Differentiate the right-triangle relationship to connect the two rates.

A rotating light turns angle change into motion along a wall. Differentiate the right-triangle relationship to connect the two rates.A rotating light turns angle change into motion along a wall. Differentiate the right-triangle relationship to connect the two rates.

SECTION 5

Detailed Breakdown — How the Six Derivatives Connect

The six trigonometric derivatives form an elegant web of relationships. The diagram below maps how each derivative depends on the basic building blocks of sin x and cos x, how the quotient rule generates the four new formulas, and how the Pythagorean identity provides the final simplification. Understanding this dependency structure makes memorization easier because you can always re-derive any formula you forget.

Derivative Dependency Map: All Six Trig Functionsd/dx [sin x] = cos xd/dx [cos x] = −sin x▼ Quotient Rule + Pythagorean Identity ▼tan x = sin x / cos x→ d/dx = sec²xcot x = cos x / sin x→ d/dx = −csc²xsec x = 1 / cos x→ d/dx = sec x tan xcsc x = 1 / sin x→ d/dx = −csc x cot xSign Pattern SummaryPositive: sin → cos, tan → sec², sec → sec·tanNegative: cos → −sin, cot → −csc², csc → −csc·cot"Co-functions carry the −"
The dependency map shows how sin x and cos x (top row) feed into the four quotient/reciprocal functions (middle rows) via the quotient rule. The sign pattern box at the bottom summarizes the mnemonic: co-functions always introduce a negative sign in their derivatives.
Function f(x)Rewritten asf ′(x)Sign of f ′(x)
tan xsin x / cos xsec²xAlways positive (≥ 1)
cot xcos x / sin x−csc²xAlways negative (≤ −1)
sec x1 / cos xsec x tan xDepends on quadrant
csc x1 / sin x−csc x cot xDepends on quadrant

Complete summary of the four derivative formulas with their sign behavior

SECTION 6

Worked Example — Differentiating a Composite Function

Let us differentiate f(x) = 3 sec(2x) − tan²(x). This example combines the derivative of secant with the chain rule and the power rule applied to a trigonometric function, which is exactly the type of multi-step problem that appears on the AP Calculus AB exam.

Find f ′(x) where f(x) = 3 sec(2x) − tan²(x)

  1. 1

    Step 1 — Identify the component functions

    We have two terms. The first term, 3 sec(2x), is a secant function with an inner function u = 2x. The second term, tan²(x), is [tan(x)]², so we need the power rule combined with the derivative of tangent.
  2. 2

    Step 2 — Differentiate the first term using the chain rule

    d/dx [3 sec(2x)] = 3 · sec(2x) tan(2x) · d/dx [2x] = 3 · sec(2x) tan(2x) · 2.
    = 6 sec(2x) tan(2x)
  3. 3

    Step 3 — Differentiate the second term using the power and chain rules

    d/dx [tan²(x)] = 2 tan(x) · d/dx [tan(x)] = 2 tan(x) · sec²(x).
    = 2 tan(x) sec²(x)
  4. 4

    Step 4 — Combine the results

    Subtract the derivative of the second term from the derivative of the first term.
    f ′(x) = 6 sec(2x) tan(2x) − 2 tan(x) sec²(x)
⚠

Common Mistake Alert

When differentiating sec(2x), students frequently forget the chain rule factor of 2 from the inner function. Always ask: "Is the argument of the trig function anything other than just x?" If so, multiply by the derivative of that inner function.

SECTION 7

Strengths, Limitations & Common Confusions

Having all six derivative formulas at your disposal is powerful, but students often encounter predictable pitfalls. The table below contrasts correct reasoning with common errors, helping you build the pattern recognition that prevents mistakes under time pressure on the AP exam.

Correct ApproachCommon ErrorWhy It Matters
d/dx [tan x] = sec²x (positive)Writing −sec²x by falsely applying the co-function sign rule to tangentTangent is NOT a co-function, so it has a positive derivative. Only cos, cot, and csc carry the minus sign.
d/dx [sec x] = sec x · tan xWriting sec x · sec x = sec²x by confusing with the tangent derivativeThe secant derivative pairs sec with tan, not sec with sec. Mixing them up changes the answer entirely.
d/dx [csc(3x)] = −csc(3x) cot(3x) · 3Omitting the chain rule factor of 3Any composite trig function requires multiplying by the derivative of the inner function. This error loses points on nearly every FRQ.
Domain: d/dx [tan x] is undefined at x = π/2 + nπClaiming the derivative exists everywhere because sec²x has no obvious zerosec²x itself is undefined at the same points where tan x has vertical asymptotes. The derivative inherits the parent function's domain restrictions.
✦

KEY TAKEAWAY

In engineering, system diagnostics follow a hierarchy: check power, check connections, then check components. Similarly, when differentiating trig functions, follow your own diagnostic hierarchy: (1) identify the outer function's derivative rule, (2) check for an inner function (chain rule), and (3) verify the sign. This three-step mental checklist catches the vast majority of errors.

SECTION 8

Connection to Advanced Theory — Integration and Beyond

Mastering these derivative formulas is not merely an exercise in memorization—it lays the groundwork for the antiderivative and integration techniques you will encounter later in the AP Calculus AB curriculum. Each derivative formula, read in reverse, becomes an antiderivative formula. For instance, knowing that d/dx [tan x] = sec²x immediately tells you that ∫ sec²x dx = tan x + C. The table below previews how each derivative connects to its corresponding integral.

Derivative (Current Topic)Corresponding Antiderivative (Future Topic)
d/dx [tan x] = sec²x∫ sec²x dx = tan x + C
d/dx [cot x] = −csc²x∫ csc²x dx = −cot x + C
d/dx [sec x] = sec x tan x∫ sec x tan x dx = sec x + C
d/dx [csc x] = −csc x cot x∫ csc x cot x dx = −csc x + C

Beyond antiderivatives, these formulas reappear when you study related rates problems involving angles (e.g., a spotlight rotating at a constant angular velocity illuminating a wall) and optimization problems where trigonometric expressions must be differentiated and set equal to zero. In multivariable calculus and differential equations, these same identities and derivative rules carry over directly, making fluency with them a long-term investment in mathematical capability.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Which of the following correctly explains why the derivative of tan x is always positive on its domain?
  • A. Because tan x is always positive.
  • B. Because sec²x = 1 + tan²x, which is always at least 1, so it is always positive.
  • C. Because the numerator of the quotient rule result is cos²x − sin²x, which is always positive.
  • D. Because tan x is defined everywhere, so its derivative cannot change sign.
  • E. Because sec x is always positive, and squaring a positive number gives a positive result.
Show answer (B)
The correct answer is B. The derivative of tan x is sec²x, and by the Pythagorean identity, sec²x = 1 + tan²x. Since tan²x ≥ 0, we have sec²x ≥ 1 > 0 for all x in the domain. Choice A is wrong because tan x is negative in the second and fourth quadrants—the function itself is not always positive, but its derivative is. Choice C is wrong because the actual numerator is cos²x + sin²x = 1, not cos²x − sin²x. Choice D is wrong because tan x is not defined everywhere (it has vertical asymptotes at odd multiples of π/2). Choice E is wrong because sec x is not always positive—it is negative when cos x is negative—though sec²x is still positive regardless.

Question 2: BASIC CALCULATION

What is d/dx [csc(5x)]?
  • A. −csc(5x) cot(5x)
  • B. 5 csc(5x) cot(5x)
  • C. −5 csc(5x) cot(5x)
  • D. −5 sec(5x) tan(5x)
  • E. 5 sec²(5x)
Show answer (C)
The correct answer is C. Using the chain rule with the derivative of csc u: d/dx [csc(5x)] = −csc(5x) cot(5x) · d/dx [5x] = −csc(5x) cot(5x) · 5 = −5 csc(5x) cot(5x). Choice A omits the chain rule factor of 5. Choice B has the wrong sign: the derivative of cosecant carries a negative. Choice D confuses the cosecant derivative with the secant derivative, using sec and tan instead of csc and cot. Choice E gives the derivative of tan(5x), not csc(5x).

Question 3: INTERMEDIATE

If g(x) = x² tan(x), what is g ′(x)?
  • A. 2x sec²(x)
  • B. 2x tan(x) + x² sec²(x)
  • C. x²sec²(x) − 2x tan(x)
  • D. 2x tan(x) + x² sec(x) tan(x)
  • E. 2x tan(x) − x² sec²(x)
Show answer (B)
The correct answer is B. This is a product rule problem: g(x) = x² · tan(x), so g ′(x) = (d/dx [x²]) · tan(x) + x² · (d/dx [tan(x)]) = 2x tan(x) + x² sec²(x). Choice A applies only the chain/derivative rules but ignores the product rule structure entirely—it's missing the 2x tan(x) term. Choice C has the correct two terms but with a minus sign, which would only arise from the quotient rule, not the product rule. Choice D incorrectly uses sec(x)tan(x) (the derivative of sec x) in place of sec²(x) (the derivative of tan x). Choice E has a spurious negative sign on the second term.

Question 4: APPLIED

5 pts
A searchlight rotates at a constant rate, and its beam hits a wall that is 20 meters away. The position along the wall is given by y = 20 tan(θ), where θ is the angle the beam makes with the line perpendicular to the wall, and θ is measured in radians. Suppose dθ/dt = π/6 radians per second. (a) Find dy/dθ. (b) Find dy/dt when θ = π/4. (c) Find dy/dt when θ = π/3. (d) Explain in the context of the problem why the speed along the wall increases as θ increases toward π/2.
Show answer
Rubric (5 points): (a) [1 point] dy/dθ = 20 sec²(θ). Earned by correctly differentiating 20 tan(θ) with respect to θ. (b) [1 point] dy/dt = (dy/dθ)(dθ/dt) = 20 sec²(π/4) · (π/6). Since sec(π/4) = √2, we get sec²(π/4) = 2, so dy/dt = 20 · 2 · π/6 = 20π/3 ≈ 20.944 meters per second. One point for correct setup and numerical answer. (c) [1 point] dy/dt = 20 sec²(π/3) · (π/6). Since sec(π/3) = 2, we get sec²(π/3) = 4, so dy/dt = 20 · 4 · π/6 = 40π/3 ≈ 41.888 meters per second. One point for correct setup and numerical answer. (d) [2 points: 1 for mathematical justification, 1 for contextual explanation] As θ → π/2, sec²(θ) → ∞ because cos(θ) → 0, which means sec(θ) = 1/cos(θ) → ∞. Since dy/dt = 20 sec²(θ) · (π/6), the speed along the wall grows without bound. In context, as the beam points nearly parallel to the wall, a small angular rotation sweeps the spot of light across an increasingly large distance in the same amount of time, producing the dramatic increase in speed.

Question 5: CRITICAL THINKING

3 pts
Using the quotient rule and the Pythagorean identity, prove that d/dx [cot x] = −csc²x. Then explain why the result guarantees that cot x is strictly decreasing on every interval in its domain.
Show answer
Rubric (3 points): [1 point] Correct application of the quotient rule: cot x = cos x / sin x, so d/dx [cot x] = (sin x · (−sin x) − cos x · cos x) / sin²x = (−sin²x − cos²x) / sin²x. [1 point] Correct simplification using the Pythagorean identity: The numerator is −(sin²x + cos²x) = −1, so the derivative is −1 / sin²x = −csc²x. [1 point] Explanation of monotonic behavior: Since csc²x = 1/sin²x > 0 for all x in the domain of cot x, the derivative −csc²x < 0 everywhere the function is defined. A function with a strictly negative derivative on an interval is strictly decreasing on that interval. Therefore, cot x is strictly decreasing on every open interval (nπ, (n+1)π) within its domain.

SUMMARY

Lesson Summary

Summary

The derivatives of the four remaining trigonometric functions—d/dx [tan x] = sec²x, d/dx [cot x] = −csc²x, d/dx [sec x] = sec x tan x, and d/dx [csc x] = −csc x cot x—are all derived by expressing each function as a quotient of sin x and cos x and then applying the quotient rule. In each case the Pythagorean identity simplifies the result to a clean, memorizable formula.

The key memorization aid is the co-function sign rule: derivatives of cos x, cot x, and csc x all carry a negative sign, while sin x, tan x, and sec x have positive derivatives. When combined with the chain rule, these formulas enable you to differentiate any composite trigonometric expression, a skill that is essential for related rates, optimization, and the eventual study of antiderivatives later in the AP Calculus AB course.

Varsity Tutors • AP Calculus AB • Finding the Derivatives of Tangent, Cotangent, Secant, and/or Cosecant Functions