Why Derive the Tangent Derivative?
Tangent is defined using two familiar trigonometric functions: \(\tan x=\frac{\sin x}{\cos x}\), wherever \(\cos x\ne 0\). This quotient gives us a way to find the derivative of tangent from the derivatives of sine and cosine.
The quotient rule applies only where the denominator is nonzero. That condition matters here: it tells us not only how to calculate the derivative, but also exactly which inputs the tangent function allows. The result is \(\frac{d}{dx}\tan x=\sec^2 x\), on the domain where \(\tan x\) is defined.
Definitions and Facts We Need
For any real number \(x\) such that \(\cos x\ne 0\), tangent is defined by
The reciprocal trigonometric function \(\sec x\) is defined by \(\sec x=\frac{1}{\cos x}\), also only where \(\cos x\ne 0\). We will use the standard derivatives \(\frac{d}{dx}\sin x=\cos x\) and \(\frac{d}{dx}\cos x=-\sin x\), with angles measured in radians, along with the Pythagorean identity.
The condition \(v(x)\ne 0\) is essential: the quotient must be defined at the point where the rule is applied. In our case, \(v(x)=\cos x\), so the calculation applies only when \(\cos x\ne 0\).
Deriving the Derivative
Take \(u(x)=\sin x\) and \(v(x)=\cos x\). Then \(u'(x)=\cos x\) and \(v'(x)=-\sin x\). Substituting those functions and derivatives into the quotient rule gives the derivative of tangent.
The minus sign in the quotient rule is important. Since the derivative of the denominator is \(-\sin x\), subtracting \(u(x)v'(x)\) produces \(-\sin x(-\sin x)=+\sin^2 x\). The numerator then becomes \(\cos^2 x+\sin^2 x\), which equals \(1\).
Why the Simplification Works
The quotient rule itself produces a numerator with two terms. The Pythagorean identity is what makes those terms simplify: \(\cos^2 x+\sin^2 x=1\). Dividing by \(\cos^2 x\) then gives \(\frac{1}{\cos^2 x}\), which is exactly \(\sec^2 x\) by the definition of secant.
This derivation also explains why the derivative is positive wherever it exists. Since \(\cos x\ne 0\), its square is positive, so \(\frac{1}{\cos^2 x}>0\). Thus tangent is increasing on each interval of its domain. This statement concerns each interval separately; tangent has breaks between those intervals where it is undefined.
Where the Formula Is Defined
Tangent is undefined when its denominator \(\cos x\) is zero. The cosine function is zero at \(x=\frac{\pi}{2}+k\pi\), where \(k\) is any integer. Therefore, tangent is defined for all real inputs except those values. The derivative formula has the same restriction, because \(\sec^2 x=\frac{1}{\cos^2 x}\) is undefined at exactly those inputs.
On any open interval that does not contain one of these excluded values, tangent is differentiable and its derivative is \(\sec^2 x\). The quotient rule cannot be used at an excluded input: there, the original quotient \(\frac{\sin x}{\cos x}\) is not defined.
Worked Applications
Worked Example: Find the Derivative of Tangent
Find \(\frac{d}{dx}\tan x\) using the quotient rule, and check the result at \(x=0\).
Write tangent as a quotient and identify the numerator and denominator:
Their derivatives are \(u'(x)=\cos x\) and \(v'(x)=-\sin x\). Apply the quotient rule:
At \(x=0\), \(\cos 0=1\), so this input is in the domain. Substituting into the derivative gives
Check directly in the quotient-rule expression at \(x=0\): its numerator is \((1)(1)-(0)(0)=1\), and its denominator is \(1^2=1\). The quotient is \(1\), matching the simplified answer.
Worked Example: Evaluate the Derivative at \(x=\frac{\pi}{3}\)
Find the slope of the tangent function at \(x=\frac{\pi}{3}\).
Since \(\cos\frac{\pi}{3}=\frac12\ne0\), tangent is defined at this input. Use the derivative formula:
Check using the unsimplified quotient-rule expression. At \(x=\frac{\pi}{3}\), \(\sin x=\frac{\sqrt{3}}{2}\) and \(\cos x=\frac12\). Thus the numerator is \((\frac12)(\frac12)-(\frac{\sqrt{3}}2)(-\frac{\sqrt{3}}2)=\frac14+\frac34=1\). The denominator is \((\frac12)^2=\frac14\), so the quotient is \(\frac{1}{1/4}=4\), as required.
Worked Example: Locate Inputs Where the Derivative Is Undefined
Determine the inputs where the tangent derivative formula is undefined, and explain why it cannot be evaluated at \(x=\frac{\pi}{2}\).
The formula is \(\sec^2 x=\frac{1}{\cos^2 x}\). Its denominator is zero exactly when \(\cos x=0\), which occurs at \(x=\frac{\pi}{2}+k\pi\), for integers \(k\). Therefore, those inputs must be excluded.
so tangent itself is undefined at \(\frac{\pi}{2}\). Its derivative is consequently not defined there either. The derivative formula gives the same conclusion: \(\sec^2(\frac{\pi}{2})=\frac{1}{\cos^2(\pi/2)}=\frac{1}{0}\), which is undefined. In contrast, at \(x=0\), the cosine is \(1\), so the derivative exists and equals \(1\).
A Common Quotient-Rule Mistake
A frequent error is to forget that the quotient rule subtracts the numerator times the derivative of the denominator. For this quotient, an incorrect calculation might be
This does not follow the quotient rule: it uses addition where the rule requires subtraction. The correct numerator is \(u'v-uv'\). Since \(v'=-\sin x\), the second term becomes positive:
A useful check is to evaluate at \(x=0\). The incorrect expression gives \(1\), which happens to agree there, so that input alone does not expose the error. At \(x=\frac{\pi}{4}\), however, it gives \(0\), while the correct derivative is \(\sec^2(\frac{\pi}{4})=2\). Checking more than one input can reveal a mistaken simplification, but the quotient-rule setup and its signs must still be correct.
How to Apply the Result Reliably
When differentiating tangent directly, the formula is efficient. When deriving or checking it, keep the quotient-rule structure visible long enough to track the sign and the domain.
Use \(\tan x=\frac{\sin x}{\cos x}\), with \(\cos x\ne0\).
Use \(u'v-uv'\) in the numerator and \(v^2\) in the denominator.
In particular, \(\frac{d}{dx}\cos x=-\sin x\).
Use \(\sin^2 x+\cos^2 x=1\), and retain the condition \(\cos x\ne0\).
The restriction should not be treated as an afterthought. At an input where cosine is zero, neither the original quotient for tangent nor the expression for its derivative is defined. At every other real input, the quotient rule applies and the derivative is \(\sec^2 x\).
Check Your Understanding
Use the quotient-rule derivation and domain condition to answer these questions.
- In the quotient-rule calculation for \(\frac{\sin x}{\cos x}\), what is the numerator before simplification?
- Which identity changes \(\frac{\cos^2 x+\sin^2 x}{\cos^2 x}\) into \(\frac{1}{\cos^2 x}\)?
- At which real inputs is \(\tan x\) undefined?
- What is the value of \(\frac{d}{dx}\tan x\) at \(x=\frac{\pi}{4}\)?
- Why is the quotient rule not applicable at \(x=\frac{\pi}{2}\)?