Free for students · Ad-free · WCAG 2.1 AA Compliant · Accessibility

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

Lesson ~10 min read

In simple terms: In simple terms, this lesson shows how to find the derivatives of tangent, cotangent, secant, and cosecant by using the Quotient Rule and identities you already know.

Why this matters

Imagine you're part of a team in Boston launching high-altitude weather balloons. Your job is to track the balloon with a camera that pivots to follow it as it rises. The angle of your camera, θ (theta), is constantly changing. You know the balloon is 1 mile away horizontally. The height of the balloon is given by h = 1 * tan(θ).

If you want to know how fast the balloon is rising at the exact moment the camera angle is increasing at a certain rate, you need to find the derivative of that tangent function.

You already know how to find the derivatives of sine and cosine. But what about the other four trigonometric functions? It might feel like you have four new, complicated formulas to memorize. But what if I told you that you already have all the tools you need? Today, we'll build these four new derivatives from scratch, using just two things you've already mastered: the derivatives of sine and cosine, and the Quotient Rule.

Concept overview

flowchart TD
    A[Find d/dx of tan(x)] --> B{Rewrite using sine and cosine};
    B --> C[tan(x) = sin(x) / cos(x)];
    C --> D{Apply the Quotient Rule};
    D --> E["(cos(x)cos(x) - sin(x)(-sin(x))) / cos^2(x)"];
    E --> F{Simplify the numerator};
    F --> G["cos^2(x) + sin^2(x) = 1"];
    G --> H{Substitute the identity};
    H --> I[Result is 1 / cos^2(x)];
    I --> J{Rewrite using secant};
    J --> K[d/dx of tan(x) = sec^2(x)];
This flowchart shows the step-by-step derivation of the derivative of tangent of x. It starts by rewriting tangent as sine over cosine, applies the quotient rule, simplifies using the Pythagorean identity, and arrives at the final result of secant squared of x.

Core explanation

Hello! I'm Saavi, and I'm so glad you're here. Today, we're going to round out your knowledge of trigonometric derivatives.

So far, you've learned two essential building blocks:

  • d/dx[sin(x)] = cos(x)
  • d/dx[cos(x)] = -sin(x)

Our goal is to find the derivatives for the "other four": tan(x), cot(x), sec(x), and csc(x).

It might seem like a lot to memorize, but the beautiful thing about calculus (and math in general) is that it's not about memorization—it's about building. Think of it like being a chef. You have your basic ingredients, sin(x) and cos(x), and a fundamental cooking technique, the Quotient Rule. With just these, we can create four brand-new, delicious dishes.

Deriving the Derivative of Tangent

Let's start with tan(x). The first step is to ask: how can I write this using only sine and cosine? From pre-calculus, you know this identity:

tan(x) = sin(x) / cos(x)

Look at that! It's a quotient. And we have a rule for that. Let's apply the Quotient Rule, which, if you recall, is:

d/dx [hi/lo] = (lo * d(hi) - hi * d(lo)) / lo^2

Here, our hi is sin(x) and our lo is cos(x).

  1. 1
    Identify the pieces
    • hi = sin(x) => d(hi) = cos(x)
    • lo = cos(x) => d(lo) = -sin(x)
  2. 2
    Plug them into the formula
    d/dx[tan(x)] = (cos(x) * cos(x) - sin(x) * (-sin(x))) / (cos(x))^2
  3. 3
    Simplify the numerator
    = (cos^2(x) + sin^2(x)) / cos^2(x)

    Wait, cos^2(x) + sin^2(x) should ring a bell! That's the fundamental Pythagorean Identity, and it equals 1.

  4. 4
    Substitute and simplify
    = 1 / cos^2(x)

This is a perfectly correct answer. However, on the AP exam, you'll almost always see it written in its most simplified form. What is 1/cos(x)? It's sec(x). So, 1/cos^2(x) is sec^2(x).

And there we have it! d/dx[tan(x)] = sec^2(x)

Deriving the Derivative of Secant

Let's try another: sec(x).

  1. 1
    Rewrite using sine or cosine
    sec(x) = 1 / cos(x)
  2. 2
    Apply the Quotient Rule
    • hi = 1 => d(hi) = 0
    • lo = cos(x) => d(lo) = -sin(x)

    d/dx[sec(x)] = (cos(x) * 0 - 1 * (-sin(x))) / (cos(x))^2

  3. 3
    Simplify
    = sin(x) / cos^2(x)

= sin(x) / (cos(x) * cos(x))

We can rewrite this as a product of two fractions:

= (1 / cos(x)) * (sin(x) / cos(x))

Now, look at those two pieces. We know them! 1/cos(x) is sec(x), and sin(x)/cos(x) is tan(x).

So, we get our final result: d/dx[sec(x)] = sec(x)tan(x)

The "Co-Function" Pattern

You can use the exact same process for cot(x) and csc(x). I'll walk through cot(x) quickly, and I encourage you to try deriving csc(x) on your own!

  • For cot(x): Rewrite as cos(x)/sin(x), apply the quotient rule, and you'll find that d/dx[cot(x)] = -csc^2(x).
  • For csc(x): Rewrite as 1/sin(x), apply the quotient rule, and you'll find that d/dx[csc(x)] = -csc(x)cot(x).

Notice a pattern with the "co-" functions (cosine, cotangent, cosecant)? Their derivatives are all negative. This is a great little trick for checking your work.

Your New Toolkit

Here are the four derivatives we just built. While you can derive them every time, the AP exam is timed. Your goal should be to practice them enough so they become second nature, just like the derivatives of sine and cosine.

  • d/dx[tan(x)] = sec^2(x)
  • d/dx[sec(x)] = sec(x)tan(x)
  • d/dx[cot(x)] = -csc^2(x)
  • d/dx[csc(x)] = -csc(x)cot(x)

You did not just memorize four new rules. You proved them. You understand why they work. That's what makes you a capable, thinking mathematician, not just a formula-plugger. Now let's put these new tools to work.

Worked examples

Let's see how these new derivative rules play with the other rules you already know, like the Product Rule and the Sum/Difference Rule.

Example 1

Combining with the Product Rule

Problem: Find the derivative of f(x) = 3x^4 * sec(x).

Solution: This function is a product of two smaller functions: 3x^4 and sec(x). This is a job for the Product Rule: d/dx[f*g] = f*g' + g*f'.

  1. 1
    Identify the functions and their derivatives
    • f(x) = 3x^4 => f'(x) = 12x^3 (using the Power Rule)
    • g(x) = sec(x) => g'(x) = sec(x)tan(x) (using our new rule)
  2. 2
    Apply the Product Rule
    f'(x) = (3x^4) * (sec(x)tan(x)) + (sec(x)) * (12x^3)
  3. 3
    Simplify by factoring
    This is a correct answer, but we can often make it cleaner. Both terms share a common factor of 3x^3 * sec(x). Let's factor that out. f'(x) = 3x^3 * sec(x) * (x * tan(x) + 4)

Why this matters: Factoring isn't just for tidiness. On a multiple-choice question, the answer will almost certainly be in this factored form. On a free-response question, this form is much easier to work with if you need to, say, find where the derivative equals zero.


Example 2

Finding the Equation of a Tangent Line

Problem: Find the equation of the line tangent to the graph of y = 2tan(x) - cot(x) at the point where x = π/4.

Solution: To find the equation of a tangent line, we need two things: a point and a slope.

  1. 1
    Find the point (y-coordinate)
    We're given x = π/4. Let's plug this into the original function. y = 2tan(π/4) - cot(π/4) Remember your unit circle values! tan(π/4) = 1 and cot(π/4) = 1. y = 2(1) - 1 = 1 So, our point is (π/4, 1).
  2. 2
    Find the slope (the derivative)
    First, find the derivative function, y'. We can use the Sum/Difference Rule. y' = d/dx[2tan(x)] - d/dx[cot(x)] y' = 2 * sec^2(x) - (-csc^2(x)) y' = 2sec^2(x) + csc^2(x)
  3. 3
    Calculate the slope at the specific point
    Now, plug x = π/4 into the derivative. m = 2sec^2(π/4) + csc^2(π/4) Again, unit circle time. cos(π/4) = √2/2, so sec(π/4) = 2/√2 = √2. And sin(π/4) = √2/2, so csc(π/4) = 2/√2 = √2. m = 2(√2)^2 + (√2)^2 m = 2(2) + 2 = 4 + 2 = 6 The slope of our tangent line is 6.
  4. 4
    Write the equation of the line
    Using point-slope form y - y1 = m(x - x1): y - 1 = 6(x - π/4)

This is a perfect example of how the AP exam combines different skills into one problem. You needed to know your new derivative rules, your old tangent line rules, and your even older unit circle values.

Try it yourself

Ready to try a couple on your own? Take your time, show your steps, and check for those common mistakes.

Problem 1: Priya is modeling the voltage in a circuit with the function V(t) = 5t * csc(t), where t is time in seconds. Find the rate of change of the voltage, V'(t).

Hint: This is a product of two functions. Identify your f(t) and g(t) and use the Product Rule. Don't forget the negative sign that comes with the derivative of cosecant!

Problem 2: Find the slope of the function g(x) = x - tan(x) at the point x = π.

Hint: Find the derivative g'(x) first using the sum/difference rule. Then, plug in x = π. You'll need to know the value of sec(π). Remember, sec(x) = 1/cos(x).