Tutorials › Calculus I › Deriving the Composite Cosine Derivative from First Principles

Trigonometric Derivatives · Tutorial 496 of 1495

Deriving the Composite Cosine Derivative from First Principles

Follow the change in the inner function through the difference quotient to derive and use the derivative of composite cosine.

Intermediate 9 min read

What You'll Learn

  • Set up a difference quotient for cosine of a differentiable function.
  • Use the cosine addition identity to separate the changing inner input.
  • Explain why the cosine-change term contributes zero in the limit.
  • Derive the negative sine factor and the inner derivative.
  • Apply and check the formula in worked examples.
  • Identify common sign and inner-derivative errors.

Why a Changing Input Matters

A cosine function can vary because its input varies. When the input is itself a function of \(x\), the change in that input need not equal the change in \(x\). To find the derivative from first principles, we must keep track of both changes rather than simply replace the input by a more complicated expression.

This tutorial derives the derivative of \(\cos(f(x))\) directly from its difference quotient. The argument will use the cosine addition identity and the standard trigonometric limit \(\lim_{t\to 0}\frac{\sin t}{t}=1\), with angles measured in radians. The result will show exactly where the negative sine factor and the derivative of the inner function come from.

Key idea: If the inner input changes by \(\Delta u\) when \(x\) changes by \(h\), then the difference quotient must account for the ratio \(\frac{\Delta u}{h}\). That ratio approaches the derivative of the inner function.

The Difference Quotient for a Composite Cosine

Let \(f\) be differentiable at \(x\), and set \(u=f(x)\). For a nonzero increment \(h\), define the change in the inner input by

$$ \Delta u=f(x+h)-f(x). $$

Then \(f(x+h)=u+\Delta u\), and the difference quotient for the composite function is

$$ \frac{\cos(f(x+h))-\cos(f(x))}{h} = \frac{\cos(u+\Delta u)-\cos u}{h}. $$

The cosine addition identity states that \(\cos(a+b)=\cos a\cos b-\sin a\sin b\). Applying it with \(a=u\) and \(b=\Delta u\) gives

$$ \cos(u+\Delta u)-\cos u = \cos u(\cos(\Delta u)-1)-\sin u\sin(\Delta u). $$

Therefore the difference quotient separates into two terms:

$$ \frac{\cos(u+\Delta u)-\cos u}{h} = \cos u\frac{\cos(\Delta u)-1}{h} - \sin u\frac{\sin(\Delta u)}{h}. $$

The first term will approach zero. In the second term, the sine change can be separated into a ratio involving \(\Delta u\) and the rate at which the inner input changes with \(x\). These two facts give a direct derivation.

Derivation from First Principles

Because \(f\) is differentiable at \(x\), the quotient \(\frac{\Delta u}{h}\) approaches the finite value \(f'(x)\) as \(h\to 0\). In particular, this quotient remains bounded for sufficiently small nonzero \(h\). Also, differentiability implies continuity at \(x\), so \(\Delta u\to 0\).

To handle the first term, use the identity \(\cos t-1=-2\sin^2(t/2)\). The standard inequality \(|\sin z|\leq |z|\) then gives

$$ \left|\frac{\cos(\Delta u)-1}{h}\right| = \frac{2\sin^2(\Delta u/2)}{|h|} \leq \frac{(\Delta u)^2}{2|h|} = \frac{|\Delta u|}{2} \left|\frac{\Delta u}{h}\right|. $$

As \(h\to 0\), the factor \(|\Delta u|\) approaches zero and the factor \(\left|\frac{\Delta u}{h}\right|\) remains bounded. Thus the product approaches zero. Multiplication by the fixed value \(\cos u\) does not change that limit.

For the second term, when \(\Delta u\neq 0\), factor its quotient as

$$ \frac{\sin(\Delta u)}{h} = \frac{\sin(\Delta u)}{\Delta u} \frac{\Delta u}{h}. $$

As \(h\to 0\), we have \(\Delta u\to 0\). The standard limit \(\lim_{t\to 0}\frac{\sin t}{t}=1\) implies that the first factor approaches \(1\); the definition of \(f'(x)\) implies that the second approaches \(f'(x)\). If \(\Delta u=0\) for some increments, the original sine quotient is zero for those increments, and the same limiting conclusion follows by continuity of \(\frac{\sin t}{t}\) when its value at \(t=0\) is defined to be \(1\). Hence \(\frac{\sin(\Delta u)}{h}\to f'(x)\).

Taking limits in the separated difference quotient now yields the result.

Theorem: If \(f\) is differentiable at \(x\), then \(\cos(f(x))\) is differentiable at \(x\), and $$ \frac{d}{dx}\cos(f(x))=-\sin(f(x))\,f'(x). $$ The angles must be measured in radians for the standard limit \(\lim_{t\to 0}\frac{\sin t}{t}=1\) used in this derivation.

Worked Applications

Worked Example: A Quadratic Inner Function at a Point

Differentiate \(\cos(x^2)\), then evaluate its derivative at \(x=1\). Here \(f(x)=x^2\), so \(f'(x)=2x\). The derived result gives

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

At \(x=1\), the inner value is \(f(1)=1^2=1\), and the inner derivative is \(f'(1)=2(1)=2\). Therefore

$$ \left.\frac{d}{dx}\cos(x^2)\right|_{x=1} = -\sin(1)\cdot 2 = -2\sin(1). $$

Check directly with the difference quotient at \(x=1\). The inner change is \(\Delta u=(1+h)^2-1=2h+h^2\), so \(\frac{\Delta u}{h}=2+h\to 2\). The cosine addition identity splits the quotient into \(\cos(1)\frac{\cos(\Delta u)-1}{h}-\sin(1)\frac{\sin(\Delta u)}{h}\). The first term tends to zero, while the second tends to \(-\sin(1)\cdot 2\). This agrees with the computed value.

Worked Example: A Linear Inner Function

Differentiate \(g(x)=\cos(2x+\frac{\pi}{2})\), and check the derivative at \(x=0\). Set \(f(x)=2x+\frac{\pi}{2}\); then \(f'(x)=2\). Thus

$$ g'(x) = -\sin\left(2x+\frac{\pi}{2}\right)\cdot 2 = -2\sin\left(2x+\frac{\pi}{2}\right). $$

At \(x=0\), the inner value is \(f(0)=\frac{\pi}{2}\), so

$$ g'(0) = -2\sin\left(\frac{\pi}{2}\right) = -2. $$

For a direct check, the difference quotient at zero is

$$ \frac{\cos(2h+\pi/2)-\cos(\pi/2)}{h} = \frac{-\sin(2h)-0}{h} = -2\frac{\sin(2h)}{2h}. $$

Since \(2h\to 0\), the standard sine limit makes this quotient tend to \(-2\). It matches the derivative formula.

Worked Example: A Cubic Inner Function at a Nonzero Point

Let \(q(x)=\cos(x^3+x)\). Find \(q'(2)\). Define \(f(x)=x^3+x\), giving \(f'(x)=3x^2+1\). At \(x=2\), the inner value and its derivative are

$$ f(2)=2^3+2=8+2=10, \qquad f'(2)=3(2^2)+1=3(4)+1=13. $$

Applying the derived formula at this point gives

$$ q'(2) = -\sin(f(2))f'(2) = -\sin(10)\cdot 13 = -13\sin(10). $$

To check by the difference quotient, compute the inner change:

$$ \Delta u=f(2+h)-f(2) =(2+h)^3+(2+h)-10 =8+12h+6h^2+h^3+2+h-10 =13h+6h^2+h^3. $$

Thus \(\frac{\Delta u}{h}=13+6h+h^2\to 13\). The cosine addition identity gives a first term tending to zero and a second term \(-\sin(10)\frac{\sin(\Delta u)}{h}\), which tends to \(-\sin(10)\cdot13\). This confirms the value.

Why the Two Factors Appear

The derivation has a useful interpretation, even though it did not assume the chain rule. A small change \(h\) in \(x\) produces an inner change \(\Delta u\). The ratio \(\frac{\Delta u}{h}\) describes the inner function's change per unit change in \(x\), and its limit is \(f'(x)\). Meanwhile, the cosine's change per unit change in its input is captured by \(\frac{\sin(\Delta u)}{\Delta u}\), together with the fixed factor \(-\sin u\) from the addition identity.

The negative sign is not optional: it comes from the minus sign in \(\cos(u+\Delta u)=\cos u\cos(\Delta u)-\sin u\sin(\Delta u)\). The inner derivative is also essential: the cosine's input changes at the rate \(f'(x)\), not necessarily at rate \(1\). These observations explain the structure of the formula without treating it as a rule to memorize without justification.

Common Pitfall: Losing the Sign or the Inner Rate

A common incorrect calculation is

$$ \frac{d}{dx}\cos(x^2) \overset{\text{wrong}}{=} \sin(x^2)\cdot 2x. $$

This has the correct inner derivative \(2x\), but the sign is wrong. The error often comes from remembering the sine derivative's positive sign rather than using the cosine addition identity. The corrected calculation is

$$ \frac{d}{dx}\cos(x^2) = -\sin(x^2)\cdot 2x = -2x\sin(x^2). $$

A different mistake is to omit the inner rate and write \(-\sin(x^2)\). That expression differentiates cosine with respect to its input \(u\), but the requested derivative is with respect to \(x\). Since the input \(x^2\) changes at rate \(2x\), the factor \(2x\) must be included. For instance, at \(x=1\), the incorrect omitted-factor answer is \(-\sin(1)\), whereas the difference quotient calculation gives \(-2\sin(1)\).

When This Derivation Applies

The argument requires \(f\) to be differentiable at the point in question. This guarantees both that \(\frac{\Delta u}{h}\) has a finite limit and that \(\Delta u\to0\). It does not require \(f\) to be a polynomial or to have a derivative everywhere: the conclusion is pointwise wherever \(f\) is differentiable. If the inner function is not differentiable at a point, this derivation does not establish differentiability of the composite there.

The radian convention also matters. The standard limit used above has value \(1\) for radian measure. If angles were measured in another unit, the corresponding trigonometric limit would have a different constant, so the derivative formula would need an additional scale factor.

Check Your Understanding

Use the difference-quotient derivation and its conditions to answer these questions.

  1. In the derivation, what does \(\Delta u\) represent, and what does \(\frac{\Delta u}{h}\) approach?
  2. Which identity produces the negative sine term in the derivative of \(\cos(f(x))\)?
  3. Differentiate \(\cos(3x^2-1)\), showing the inner derivative explicitly.
  4. Use a difference quotient at \(x=0\) to check the derivative of \(\cos(2x+\frac{\pi}{2})\).
  5. Why does the proof require angles to be measured in radians?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): 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