Differentiating Trig Expressions
Textbook Reference
| Primary source | OpenStax Calculus Volume 1, Section 3.5: “Derivatives of Trigonometric Functions” |
| Book URL | https://openstax.org/details/books/calculus-volume-1 |
Freely available and openly licensed.
Try This First
Without computing, predict: which of the following has a larger derivative at $x = 0$?
(A) $f(x) = x\sin x$ \quad (B) $g(x) = x^2\cos x$
Reason through it: at $x = 0$, $\sin 0 = 0$ and $\cos 0 = 1$. Think about what the product rule gives.
Make your prediction before reading on, then verify by differentiating both and evaluating.
Prerequisite Check
Before this lesson, make sure you can do all of the following:
Quick Reference
Approach to any trig derivative:
- Identify the outer structure (product? quotient? composite?).
- Select the matching rule (product, quotient, or chain rule -- chain rule comes next).
- Apply the appropriate trig derivative formula.
- Simplify using trig identities when possible.
Key Concepts
1. Products Involving Trig
When a polynomial or exponential is multiplied by a trig function, use the product rule.
Example 1. Differentiate $f(x) = x^2 \sin x$.
$f'(x) = 2x \sin x + x^2 \cos x$.
Factor: $f'(x) = x(2\sin x + x\cos x)$.
Example 2. Differentiate $g(x) = x\cos x$.
$g'(x) = \cos x + x(-\sin x) = \cos x - x\sin x$.
At $x = 0$: $g'(0) = 1 - 0 = 1$.
Answering the Try This First: $f(x) = x\sin x$ gives $f'(x) = \sin x + x\cos x$, so $f'(0) = 0 + 0 = 0$.
$g(x) = x^2\cos x$ gives $g'(x) = 2x\cos x - x^2\sin x$, so $g'(0) = 0 - 0 = 0$.
Both have derivative 0 at $x = 0$. Both functions pass through the origin, and both are tangent to the $x$-axis there ($f(0) = 0$, $g(0) = 0$, both slopes zero). Prediction may need refinement -- slope alone does not tell the full story at flat points.
2. Quotients Involving Trig
Example 3. Differentiate $h(x) = \dfrac{\sin x}{x}$ (for $x \neq 0$).
$h'(x) = \dfrac{x\cos x - \sin x}{x^2}$.
This is the derivative of the sinc function. At $x = 0$, $h'$ is indeterminate; the limit as $x \to 0$ can be computed using L’Hopital’s Rule or the Taylor series (giving $0$).
Example 4. Differentiate $f(x) = \dfrac{x}{\sin x}$ (for $x \neq 0$).
$f'(x) = \dfrac{\sin x - x\cos x}{\sin^2 x}$.
3. Multiple Representations: Reading the Derivative’s Graph
For $f(x) = x\sin x$ on $[0, 2\pi]$:
$f'(x) = \sin x + x\cos x$.
| $x$ | $\sin x$ | $x\cos x$ | $f'(x)$ | $f$ is... |
|---|---|---|---|---|
| $0$ | $0$ | $0$ | $0$ | flat |
| $\pi/2$ | $1$ | $0$ | $1$ | increasing |
| $\pi$ | $0$ | $-\pi \approx -3.1$ | $-3.1$ | decreasing steeply |
| $3\pi/2$ | $-1$ | $0$ | $-1$ | decreasing |
| $2\pi$ | $0$ | $2\pi \approx 6.3$ | $6.3$ | increasing steeply |
The function oscillates but with growing amplitude (the $x$ factor grows). The derivative captures this: it oscillates but with growing swings.
4. Finding Critical Points of Trig Functions
Critical points occur where $f'(x) = 0$ or $f'(x)$ does not exist.
Example 5. Find all critical points of $f(x) = \sin x + \cos x$ on $[0, 2\pi]$.
$f'(x) = \cos x - \sin x$.
$f'(x) = 0$: $\cos x = \sin x$, i.e., $\tan x = 1$. On $[0, 2\pi]$: $x = \pi/4$ and $x = 5\pi/4$.
$f(\pi/4) = \sqrt{2}/2 + \sqrt{2}/2 = \sqrt{2}$ (local max).
$f(5\pi/4) = -\sqrt{2}/2 - \sqrt{2}/2 = -\sqrt{2}$ (local min).
5. Ask Why: Why Are Trig Derivatives Cyclic?
The derivatives of $\sin$ cycle: $\sin \to \cos \to -\sin \to -\cos \to \sin \to \cdots$ with period 4. This is not coincidence -- it reflects the geometry of the unit circle. Rotating the unit circle by $\pi/2$ turns a $\sin$ wave into a $\cos$ wave, and differentiation is equivalent to a $\pi/2$ phase shift. The fourth derivative returns to the original, matching the $4 \times (\pi/2) = 2\pi$ full rotation.
Named Misconception: Distributing Derivatives Over Products
The most common error in this topic: treating the product rule as if differentiation distributes over multiplication.
Wrong: $\dfrac{d}{dx}[x^2 \sin x] = 2x \cdot \cos x = 2x\cos x$.
Right: $\dfrac{d}{dx}[x^2 \sin x] = 2x\sin x + x^2\cos x$.
The product rule requires adding two terms, not just multiplying the individual derivatives.
Common Errors
| Error | Example | Correction |
|---|---|---|
| Omitting the product rule | $(x^2 \sin x)' = 2x\cos x$ | $(x^2\sin x)' = 2x\sin x + x^2\cos x$ |
| Wrong sign in quotient rule | $\frac{\sin x}{x}$: writing $\frac{\cos x \cdot x + \sin x \cdot 1}{x^2}$ | Quotient rule: $f'g - fg'$ in the numerator (minus, not plus) |
| Forgetting trig derivative formulas | $(\tan x)' = \sec x$ | $(\tan x)' = \sec^2 x$ |
Leveled Practice
Level 1 -- Products with Trig
Problem 1. Differentiate: (a) $f(x) = 3x\cos x$, (b) $g(x) = \sin x \cdot \cos x$.
Show answer
(a) $3\cos x - 3x\sin x = 3(\cos x - x\sin x)$.
(b) $\cos x\cos x + \sin x(-\sin x) = \cos^2 x - \sin^2 x = \cos(2x)$ (double angle identity).
Problem 2. Find $f'(x)$ for $f(x) = x^2\tan x$ and evaluate $f'(0)$.
Show answer
$f'(x) = 2x\tan x + x^2\sec^2 x$.
$f'(0) = 0 + 0 = 0$.
Level 2 -- Quotients and Critical Points
Problem 3. Differentiate $h(x) = \dfrac{\sin x}{1 + \cos x}$.
Show answer
$h'(x) = \dfrac{\cos x(1+\cos x) - \sin x(-\sin x)}{(1+\cos x)^2} = \dfrac{\cos x + \cos^2 x + \sin^2 x}{(1+\cos x)^2} = \dfrac{\cos x + 1}{(1+\cos x)^2} = \dfrac{1}{1+\cos x}$.
Problem 4. Find all critical points of $f(x) = 2\sin x - x$ on $[0, 2\pi]$.
Show answer
$f'(x) = 2\cos x - 1 = 0$: $\cos x = 1/2$. On $[0, 2\pi]$: $x = \pi/3$ and $x = 5\pi/3$.
At $x = \pi/3$: $f'$ changes sign (check: $f'(0) = 2-1 > 0$, $f'(\pi) = -2-1 < 0$), so $x = \pi/3$ is a local max.
At $x = 5\pi/3$: similar analysis gives a local min.
Level 3 -- Low-Floor-High-Ceiling Extension
Problem 5 (Extension).
(a) (Floor) Differentiate $f(x) = \sin x\cos x$ and simplify using a double-angle identity.
(b) (Mid) Use the product rule to prove the identity $\dfrac{d}{dx}[\sin^2 x + \cos^2 x] = 0$ two ways: (i) directly from the identity (derivative of 1 is 0), and (ii) by differentiating each term and adding.
(c) (Ceiling) Suppose $y = \sin x$ satisfies the ODE $y'' + y = 0$. Verify this. Then show that $y = A\sin x + B\cos x$ also satisfies the same ODE for any constants $A$ and $B$.
Show answer
(a) $f'(x) = \cos^2 x - \sin^2 x = \cos(2x)$.
(b) (i) $\frac{d}{dx}[1] = 0$.
(ii) $\frac{d}{dx}[\sin^2 x] + \frac{d}{dx}[\cos^2 x] = 2\sin x\cos x + 2\cos x(-\sin x) = 0$. Both methods give 0, confirming consistency.
(c) $y = \sin x$: $y' = \cos x$, $y'' = -\sin x$. $y'' + y = -\sin x + \sin x = 0$. Verified.
$y = A\sin x + B\cos x$: $y'' = -A\sin x - B\cos x$. $y'' + y = (-A\sin x - B\cos x) + (A\sin x + B\cos x) = 0$. The ODE is satisfied by linearity.
This demonstrates why $A\sin x + B\cos x$ is the general solution: sines and cosines are the eigenfunctions of the second derivative.
Common Misconceptions
when differentiating a product like $x^2 \sin x$, the derivative is $2x \cos x$. A product of two functions requires the product rule: $(fg)' = f'g + fg'$. For $x^2 \sin x$, this gives $2x \sin x + x^2 \cos x$. The error of multiplying the two derivatives gives $2x \cos x$, which is neither term of the correct answer.
$\frac{d}{dx}[\sin x \cos x] = \cos x \cdot (-\sin x)$. This applies the chain rule as if $\sin x$ were a composite function with $\cos x$ inside, which it is not. The expression $\sin x \cos x$ is a product of two separate functions, so the product rule applies: $(\sin x)' \cos x + \sin x (\cos x)' = \cos^2 x - \sin^2 x$. Using the double-angle identity, this equals $\cos(2x)$, confirming the result.
Mastery Checklist
You have mastered this skill when you can do all of the following without referring to notes:
Mental Model
Trig functions interact with other functions through the same rules as any other function -- but they have their own derivative formulas that you must bring in. The product rule gives two terms; the quotient rule gives two terms in the numerator. Trig identities often allow the result to be simplified to a more elegant form.
Practice the habit: for every differentiation involving trig, name the rule before writing any algebra. “This is a product, so I’ll use the product rule with $f = x^2$ and $g = \sin x$.” Naming the rule prevents applying the wrong one.
Connections
Within Calculus I (MATH161)
- Chain rule (next): Once the chain rule is available, you can differentiate $\sin(g(x))$, $\tan(g(x))$, etc. -- the patterns here become the “inner derivative” templates.
- Integration: $\int \sin x\,dx = -\cos x + C$, $\int \cos x\,dx = \sin x + C$ are the direct antiderivatives. Trig differentiation and integration are closely linked.
- Differential equations: The property $(\sin)'' = -\sin$ and $(\cos)'' = -\cos$ makes trig functions the natural solutions to oscillation equations, appearing throughout physics and engineering.
Back to Calculus I Skills | Previous: Derivatives of Other Trig Functions | Next: Chain Rule