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.
Definitions and Derivative Rules
Tangent and secant are defined in terms of sine and cosine:
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.
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:
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:
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.
Write the expression as \(\tan(g(x))\) or \(\sec(g(x))\).
Compute \(g'(x)\) separately so the inner factor is not lost.
Use \(\sec^2(g(x))\) for tangent or \(\sec(g(x))\tan(g(x))\) for secant, then multiply by \(g'(x)\).
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
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
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,
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
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,
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
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
leaves out the rate of change of the angle. Since \(\frac{d}{dx}(3x^2-1)=6x\), the correct calculation is
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.
- Differentiate \(\tan(5x+1)\).
- Differentiate \(\sec(x^2-3)\).
- For \(q(x)=\tan(x^2)+\sec(3x)\), find \(q'(x)\).
- At which inputs is \(\tan(4x)\) undefined?
- A learner writes \(\frac{d}{dx}\sec(7x)=\sec(7x)\tan(7x)\). Identify the missing factor and give the corrected derivative.