Tutorials › AP Calculus › The Tangent Derivative from the Quotient Rule

Trigonometric and Exponential Derivatives · Tutorial 143 of 999

The Tangent Derivative from the Quotient Rule

Use the quotient rule and the sine and cosine derivatives to derive the tangent derivative, then determine its domain and apply the formula correctly.

Intermediate 9 min read

What You'll Learn

  • Express tangent as the quotient of sine and cosine on its domain.
  • Apply the quotient rule using the derivatives of sine and cosine.
  • Simplify the resulting expression with the Pythagorean identity.
  • State exactly where tangent and its derivative are defined.
  • Check tangent derivative calculations at specific inputs and identify a common quotient-rule error.

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.

Key idea: Apply the quotient rule to \(\frac{\sin x}{\cos x}\), then use \(\sin^2 x+\cos^2 x=1\) to simplify.

Definitions and Facts We Need

For any real number \(x\) such that \(\cos x\ne 0\), tangent is defined by

$$ \tan x=\frac{\sin x}{\cos x}. $$

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.

Quotient rule: If \(u\) and \(v\) are differentiable at \(x\), and \(v(x)\ne 0\), then $$ \frac{d}{dx}\left(\frac{u(x)}{v(x)}\right) = \frac{u'(x)v(x)-u(x)v'(x)}{[v(x)]^2}. $$

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.

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

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\).

Theorem: For every real \(x\) such that \(\cos x\ne 0\), $$ \frac{d}{dx}\tan x=\sec^2 x. $$

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.

$$ \operatorname{domain}(\tan x) = \operatorname{domain}\left(\frac{d}{dx}\tan x\right) = \mathbb{R}\setminus \left\{\frac{\pi}{2}+k\pi:k\in\mathbb{Z}\right\}. $$

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:

$$ \tan x=\frac{\sin x}{\cos x}, \qquad u(x)=\sin x,\quad v(x)=\cos x. $$

Their derivatives are \(u'(x)=\cos x\) and \(v'(x)=-\sin x\). Apply the quotient rule:

$$ \begin{aligned} \frac{d}{dx}\tan x &=\frac{(\cos x)(\cos x)-(\sin x)(-\sin x)}{\cos^2 x}\\ &=\frac{\cos^2 x+\sin^2 x}{\cos^2 x}\\ &=\frac{1}{\cos^2 x}\\ &=\sec^2 x. \end{aligned} $$

At \(x=0\), \(\cos 0=1\), so this input is in the domain. Substituting into the derivative gives

$$ \left.\frac{d}{dx}\tan x\right|_{x=0} =\sec^2 0 =\frac{1}{\cos^2 0} =\frac{1}{1^2} =1. $$

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:

$$ \begin{aligned} \left.\frac{d}{dx}\tan x\right|_{x=\pi/3} &=\sec^2\left(\frac{\pi}{3}\right)\\ &=\frac{1}{\cos^2(\pi/3)}\\ &=\frac{1}{(1/2)^2}\\ &=\frac{1}{1/4}\\ &=4. \end{aligned} $$

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.

$$ \cos\left(\frac{\pi}{2}\right)=0 \quad\Longrightarrow\quad \tan\left(\frac{\pi}{2}\right) =\frac{\sin(\pi/2)}{\cos(\pi/2)} =\frac{1}{0}, $$

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

$$ \frac{(\cos x)(\cos x)+(\sin x)(-\sin x)}{\cos^2 x} = \frac{\cos^2 x-\sin^2 x}{\cos^2 x}. $$

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:

$$ (\cos x)(\cos x)-(\sin x)(-\sin x) = \cos^2 x+\sin^2 x = 1. $$

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.

1
Write tangent as a quotient.
Use \(\tan x=\frac{\sin x}{\cos x}\), with \(\cos x\ne0\).
2
Apply the quotient rule.
Use \(u'v-uv'\) in the numerator and \(v^2\) in the denominator.
3
Substitute the trigonometric derivatives.
In particular, \(\frac{d}{dx}\cos x=-\sin x\).
4
Simplify and state the restriction.
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.

  1. In the quotient-rule calculation for \(\frac{\sin x}{\cos x}\), what is the numerator before simplification?
  2. Which identity changes \(\frac{\cos^2 x+\sin^2 x}{\cos^2 x}\) into \(\frac{1}{\cos^2 x}\)?
  3. At which real inputs is \(\tan x\) undefined?
  4. What is the value of \(\frac{d}{dx}\tan x\) at \(x=\frac{\pi}{4}\)?
  5. Why is the quotient rule not applicable at \(x=\frac{\pi}{2}\)?

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