Tutorials › AP Calculus › Tangent and Secant of Composite Angles

Chain Rule and Nested Functions · Tutorial 170 of 999

Tangent and Secant of Composite Angles

Combine the tangent and secant derivative formulas with the chain rule, and check the domain before differentiating.

Intermediate 8 min read

What You'll Learn

  • State the domains of tangent and secant composite functions.
  • Differentiate tangent and secant of a differentiable inner function.
  • Explain why the inner derivative factor appears.
  • Apply the formulas to polynomial and linear inner functions.
  • Check composite derivative formulas using quotient differentiation.
  • Identify and correct a missing chain-rule factor.

Why Composite Angles Need an Inner Factor

The derivative of tangent or secant depends on how quickly its angle changes. If the angle itself is a function of \(x\), its rate of change must be included. For example, the angle \(x^2\) changes at a rate of \(2x\), so differentiating \(\tan(x^2)\) requires both the derivative of tangent and the derivative of \(x^2\).

The same principle applies to \(\sec(g(x))\). First identify the outer trigonometric function, then multiply by the derivative of its inner function. Before using either formula, check that the angle lies where the trigonometric expression is defined.

Key idea: If \(g\) is differentiable, differentiate \(\tan(g(x))\) or \(\sec(g(x))\) by multiplying the outer derivative by \(g'(x)\). The formulas apply only at inputs where \(\cos(g(x))\ne 0\).

Definitions and Derivative Rules

Tangent and secant are defined in terms of sine and cosine:

$$ \tan u=\frac{\sin u}{\cos u}, \qquad \sec u=\frac{1}{\cos u}. $$

Both expressions are defined exactly when \(\cos u\ne 0\). In particular, for real \(u\), this excludes \(u=\frac{\pi}{2}+k\pi\), where \(k\) is any integer. The trigonometric derivative formulas used here assume angles are measured in radians.

The basic derivatives are \(\frac{d}{du}\tan u=\sec^2u\) and \(\frac{d}{du}\sec u=\sec u\tan u\). Combining them with the chain rule gives the composite rules below.

Theorem: Suppose \(g\) is differentiable at \(x\). If \(\cos(g(x))\ne 0\), then both composite functions are defined at \(x\), and
$$ \frac{d}{dx}\tan(g(x)) = \sec^2(g(x))\,g'(x), \qquad \frac{d}{dx}\sec(g(x)) = \sec(g(x))\tan(g(x))\,g'(x). $$
If \(\cos(g(x))=0\), the composite tangent and secant are undefined there, so neither derivative formula gives a derivative at that input.

This condition concerns the angle \(g(x)\), not just \(x\). A composite function may be defined for many inputs and undefined for others, depending on which angles the inner function produces.

Why the Inner Derivative Appears

The chain rule says that the rate of change of a composite function is the outer rate of change, evaluated at the inner function, multiplied by the rate of change of the inner function. For tangent, the outer rate at angle \(u\) is \(\sec^2u\). At \(u=g(x)\), this is \(\sec^2(g(x))\), and the angle changes at rate \(g'(x)\). Their product is therefore the derivative of \(\tan(g(x))\).

The same reasoning applies to secant: its outer derivative at angle \(u\) is \(\sec u\tan u\). Evaluating this at \(g(x)\) and multiplying by \(g'(x)\) gives the composite derivative. This is why the inner factor is required even when the outer trigonometric formula is familiar.

The result can also be verified directly using quotient differentiation. The earlier formulas for sine and cosine of a composite angle are \(\frac{d}{dx}\sin(g(x))=\cos(g(x))g'(x)\) and \(\frac{d}{dx}\cos(g(x))=-\sin(g(x))g'(x)\). At points where \(\cos(g(x))\ne0\), differentiate the quotient for tangent:

$$ \begin{aligned} \frac{d}{dx}\tan(g(x)) &=\frac{d}{dx}\left(\frac{\sin(g(x))}{\cos(g(x))}\right)\\ &=\frac{\cos(g(x))g'(x)\cos(g(x))-\sin(g(x))\bigl(-\sin(g(x))g'(x)\bigr)} {\cos^2(g(x))}\\ &=\frac{\bigl(\cos^2(g(x))+\sin^2(g(x))\bigr)g'(x)} {\cos^2(g(x))}\\ &=\frac{g'(x)}{\cos^2(g(x))} =\sec^2(g(x))g'(x). \end{aligned} $$

Here the quotient rule requires a nonzero denominator, which is exactly the condition \(\cos(g(x))\ne0\). For secant, differentiate its reciprocal representation under the same condition:

$$ \begin{aligned} \frac{d}{dx}\sec(g(x)) &=\frac{d}{dx}\left(\frac{1}{\cos(g(x))}\right)\\ &=\frac{\sin(g(x))g'(x)}{\cos^2(g(x))}\\ &=\sec(g(x))\tan(g(x))g'(x). \end{aligned} $$

These calculations establish both formulas and show why their domain condition cannot be omitted.

Using the Formulas Carefully

A reliable method is to name the inner function, find its derivative, and then apply the appropriate outer formula. Keep the entire inner function inside the trigonometric notation. Finally, state where the expression is defined; for a composite tangent or secant, this means checking where the inner angle has nonzero cosine.

1
Identify the angle.
Write the expression as \(\tan(g(x))\) or \(\sec(g(x))\).
2
Differentiate the angle.
Compute \(g'(x)\) separately so the inner factor is not lost.
3
Apply the outer rule.
Use \(\sec^2(g(x))\) for tangent or \(\sec(g(x))\tan(g(x))\) for secant, then multiply by \(g'(x)\).
4
Check the domain.
Require \(\cos(g(x))\ne0\) wherever the composite expression is used.

Worked Example: Tangent of a Quadratic Angle

Differentiate \(f(x)=\tan(3x^2-1)\), and state where the function and derivative are defined.

Set \(g(x)=3x^2-1\). Then \(g'(x)=6x\). The tangent rule gives

$$ \begin{aligned} f'(x) &=\sec^2(3x^2-1)\cdot 6x\\ &=6x\sec^2(3x^2-1). \end{aligned} $$

The function and its derivative are defined when \(\cos(3x^2-1)\ne0\). Equivalently, exclude inputs satisfying \(3x^2-1=\frac{\pi}{2}+k\pi\) for some integer \(k\). The derivative formula does not make the original tangent defined at those excluded inputs.

Check the result by differentiating the quotient representation. With \(g=3x^2-1\), the quotient calculation gives

$$ \begin{aligned} \frac{d}{dx}\left(\frac{\sin g}{\cos g}\right) &=\frac{\cos g(6x)\cos g-\sin g(-\sin g)(6x)}{\cos^2g}\\ &=\frac{6x(\cos^2g+\sin^2g)}{\cos^2g}\\ &=\frac{6x}{\cos^2g} =6x\sec^2g. \end{aligned} $$

This agrees with the chain-rule result wherever \(\cos g\ne0\).

Worked Example: Secant of a Linear Angle

Differentiate \(h(x)=\sec(2x-\frac{\pi}{6})\), and give its domain.

Let \(g(x)=2x-\frac{\pi}{6}\), so \(g'(x)=2\). Applying the secant rule,

$$ \begin{aligned} h'(x) &=\sec\left(2x-\frac{\pi}{6}\right) \tan\left(2x-\frac{\pi}{6}\right)\cdot2\\ &=2\sec\left(2x-\frac{\pi}{6}\right) \tan\left(2x-\frac{\pi}{6}\right). \end{aligned} $$

The function is defined when \(\cos(2x-\frac{\pi}{6})\ne0\). Thus the excluded inputs solve \(2x-\frac{\pi}{6}=\frac{\pi}{2}+k\pi\), or \(x=\frac{\pi}{3}+\frac{k\pi}{2}\), where \(k\) is an integer. The derivative has the same exclusions.

To check, write \(h(x)=1/\cos(g(x))\). Differentiation gives

$$ \begin{aligned} h'(x) &=\frac{\sin(g(x))g'(x)}{\cos^2(g(x))}\\ &=\frac{2\sin(g(x))}{\cos^2(g(x))}\\ &=2\sec(g(x))\tan(g(x)), \end{aligned} $$

which matches the result above.

Worked Example: A Sum of Tangent and Secant Compositions

Differentiate \(p(x)=\tan(2x)+\sec(x^2)\), and evaluate \(p'(0)\).

Differentiate each term separately. The first inner function is \(2x\), whose derivative is \(2\); the second is \(x^2\), whose derivative is \(2x\). Therefore,

$$ \begin{aligned} p'(x) &=2\sec^2(2x)+\sec(x^2)\tan(x^2)(2x)\\ &=2\sec^2(2x)+2x\sec(x^2)\tan(x^2). \end{aligned} $$

The original function and derivative are defined where both \(\cos(2x)\ne0\) and \(\cos(x^2)\ne0\). At \(x=0\), both cosines equal \(1\), so the point is in the domain. Substitution gives

$$ \begin{aligned} p'(0) &=2\sec^2(0)+2(0)\sec(0)\tan(0)\\ &=2(1)^2+0\\ &=2. \end{aligned} $$

As a check, the tangent term contributes \(2\sec^2(0)=2\), while the secant term contributes \(2(0)\sec(0)\tan(0)=0\). Their sum is \(2\), as found by substitution into the full derivative.

A Common Mistake: Losing the Inner Factor

A frequent error is to differentiate only the outer trigonometric function. For instance, the incorrect calculation

$$ \frac{d}{dx}\tan(3x^2-1) \overset{\text{wrong}}{=} \sec^2(3x^2-1) $$

leaves out the rate of change of the angle. Since \(\frac{d}{dx}(3x^2-1)=6x\), the correct calculation is

$$ \frac{d}{dx}\tan(3x^2-1) = \sec^2(3x^2-1)\cdot6x. $$

The missing factor matters: at \(x=0\), the inner angle has derivative \(0\), so the composite tangent has derivative \(0\), not \(\sec^2(-1)\). Also, do not treat the formula as permission to evaluate at a forbidden angle. If \(\cos(g(x))=0\), then \(\tan(g(x))\) and \(\sec(g(x))\) are undefined.

Why These Rules Matter

Tangent and secant compositions appear whenever an angle varies with an input. The derivative describes how the trigonometric value changes as that input changes. The inner factor accounts for the speed and direction of the angle's change; without it, the result describes only the outer function's rate with respect to its angle, not its rate with respect to \(x\).

A good final check is to ask three questions: Did the inner function remain intact inside the trigonometric factor? Was its derivative multiplied in? Is the cosine of the inner angle nonzero at the inputs under consideration? These checks catch the most common errors without changing the basic differentiation method.

Check Your Understanding

For each question, include any domain restriction that applies.

  1. Differentiate \(\tan(5x+1)\).
  2. Differentiate \(\sec(x^2-3)\).
  3. For \(q(x)=\tan(x^2)+\sec(3x)\), find \(q'(x)\).
  4. At which inputs is \(\tan(4x)\) undefined?
  5. A learner writes \(\frac{d}{dx}\sec(7x)=\sec(7x)\tan(7x)\). Identify the missing factor and give the corrected derivative.

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon
Clinical Biostats