Tutorials › Calculus I › Differentiating Sums of Harmonic Components

Trigonometric Derivatives · Tutorial 510 of 1495

Differentiating Sums of Harmonic Components

Learn to differentiate harmonic sums by applying the chain rule to each sine and cosine component while preserving its frequency factor.

Intermediate 9 min read

What You'll Learn

  • Identify the common base frequency and the integer frequency of each harmonic.
  • Differentiate a finite sine-and-cosine sum term by term.
  • Keep the full frequency factor multiplying each differentiated component.
  • Separate amplitude coefficients from frequency multipliers.
  • Check a derivative by differentiating each original component independently.
  • Recognize and correct the error of omitting a harmonic's chain-rule factor.

Why Harmonic Sums Need Careful Differentiation

A periodic model can combine several sine and cosine waves. Each component may oscillate at a different frequency, so differentiating the whole model requires tracking more than its amplitude and its sine-or-cosine form. The frequency inside each trigonometric function also contributes a factor to the derivative.

For example, the terms \(\sin x\), \(\sin 2x\), and \(\sin 5x\) have different frequencies. Their derivatives are not all just cosine terms with the same coefficient: the chain rule makes the frequency of each term appear as a multiplier. In a sum, this factor must be retained separately for every component.

The goal here is to differentiate finite sums whose frequencies are integer multiples of one positive base frequency. Such a sum is called a harmonic sum. The method is to differentiate each term, preserve its own frequency factor, and then collect the results.

Harmonics and the General Form

Fix a positive base frequency \(\omega\). The \(n\)th harmonic has frequency \(n\omega\), where \(n\) is a positive integer. Thus, \(\sin(n\omega x)\) and \(\cos(n\omega x)\) are the sine and cosine components at that harmonic frequency. A coefficient in front of a component controls its amplitude; the integer \(n\) and base frequency \(\omega\) determine its frequency.

Definition: A finite harmonic sum with base frequency \(\omega>0\) has the form \(F(x)=C+\sum_{n=1}^{N}\bigl(a_n\cos(n\omega x)+b_n\sin(n\omega x)\bigr)\), where \(N\) is a positive integer and \(C,a_n,b_n\) are constants. A coefficient may be zero, so the form includes sums in which some components are absent.

The constant \(C\) does not oscillate and has derivative zero. Each sine or cosine term, by contrast, is a composite function: the input to the trigonometric function is \(n\omega x\). Its derivative therefore includes the derivative of that input.

Theorem: If \(F\) is a finite harmonic sum as defined above, then \(F'(x)=\sum_{n=1}^{N}\bigl(-n\omega a_n\sin(n\omega x)+n\omega b_n\cos(n\omega x)\bigr)\). Each cosine component contributes a negative sine term; each sine component contributes a cosine term. In both cases, its own frequency \(n\omega\) multiplies its coefficient.

Why the Formula Works

The formula follows from two standard differentiation rules: the derivative of a finite sum is the sum of the derivatives, and the chain rule differentiates a composite function by multiplying by the derivative of its input. In particular, for a differentiable input \(u(x)\), the trigonometric chain rules are \(\frac{d}{dx}\sin(u(x))=\cos(u(x))u'(x)\) and \(\frac{d}{dx}\cos(u(x))=-\sin(u(x))u'(x)\).

1
Differentiate the cosine component.
For \(a_n\cos(n\omega x)\), the input \(n\omega x\) has derivative \(n\omega\). The chain rule gives \(-n\omega a_n\sin(n\omega x)\).
2
Differentiate the sine component.
For \(b_n\sin(n\omega x)\), the same input derivative gives \(n\omega b_n\cos(n\omega x)\).
3
Add the component derivatives.
Linearity lets us add the derivative of each term, while the constant contributes zero. This gives the stated formula for the entire finite sum.

In equations, for each index \(n\), the chain rule gives

$$ \begin{aligned} \frac{d}{dx}\bigl(a_n\cos(n\omega x)\bigr) &=-a_n\sin(n\omega x)\frac{d}{dx}(n\omega x) =-n\omega a_n\sin(n\omega x),\\ \frac{d}{dx}\bigl(b_n\sin(n\omega x)\bigr) &=b_n\cos(n\omega x)\frac{d}{dx}(n\omega x) =n\omega b_n\cos(n\omega x). \end{aligned} $$

Adding these expressions over the finite set of indices \(1,\ldots,N\), and using \(\frac{d}{dx}C=0\), proves the theorem. Finiteness matters here: this argument uses the ordinary rule for differentiating a finite sum and does not make a claim about differentiating an infinite series.

Worked Examples

Worked Example: Differentiating a Sum with Base Frequency 1

Differentiate \(f(x)=3\sin x-2\cos(3x)+4\sin(5x)-7\). The frequency multipliers in the three trigonometric inputs are \(1\), \(3\), and \(5\), respectively. Differentiate each term:

$$ \begin{aligned} \frac{d}{dx}(3\sin x)&=3\cos x\cdot 1=3\cos x,\\ \frac{d}{dx}(-2\cos(3x))&=(-2)\bigl(-\sin(3x)\bigr)\cdot 3=6\sin(3x),\\ \frac{d}{dx}(4\sin(5x))&=4\cos(5x)\cdot 5=20\cos(5x),\\ \frac{d}{dx}(-7)&=0. \end{aligned} $$

Therefore, \(f'(x)=3\cos x+6\sin(3x)+20\cos(5x)\). To check, differentiate the original expression term by term again: the sine terms give \(3\cos x\) and \(20\cos(5x)\), the negative cosine term gives \(6\sin(3x)\), and the constant gives zero. These are exactly the terms in the result.

Worked Example: Making the Common Base Frequency Visible

Differentiate \(g(x)=2\cos(2x)+3\sin(6x)-\sin(8x)\). The frequencies \(2\), \(6\), and \(8\) are integer multiples \(1\), \(3\), and \(4\) of the base frequency \(\omega=2\). Keep the factors \(2\), \(6\), and \(8\) in their respective chain-rule calculations:

$$ \begin{aligned} \frac{d}{dx}(2\cos(2x))&=2\bigl(-\sin(2x)\bigr)\cdot 2=-4\sin(2x),\\ \frac{d}{dx}(3\sin(6x))&=3\cos(6x)\cdot 6=18\cos(6x),\\ \frac{d}{dx}(-\sin(8x))&=-\cos(8x)\cdot 8=-8\cos(8x). \end{aligned} $$

Hence \(g'(x)=-4\sin(2x)+18\cos(6x)-8\cos(8x)\). As a check, the cosine component still produces a negative sine, and both sine components produce cosine terms. The coefficients are the original coefficients multiplied by their corresponding frequencies: \(2\cdot2=4\), \(3\cdot6=18\), and \((-1)\cdot8=-8\).

Worked Example: Differentiating and Evaluating a Harmonic Sum

Let \(h(x)=5+2\sin(4x)-3\cos(8x)+\cos(12x)\). The frequencies \(4\), \(8\), and \(12\) are \(1\), \(2\), and \(3\) times the base frequency \(4\). First differentiate the full function:

$$ \begin{aligned} h'(x) &=2\cos(4x)\cdot4 -3\bigl(-\sin(8x)\bigr)\cdot8 +\bigl(-\sin(12x)\bigr)\cdot12\\ &=8\cos(4x)+24\sin(8x)-12\sin(12x). \end{aligned} $$

For instance, at \(x=0\), the derivative is \(8\cos 0+24\sin 0-12\sin 0=8(1)+24(0)-12(0)=8\). Check this value by evaluating the three component derivatives separately at zero: \(8\cos 0=8\), \(24\sin 0=0\), and \(-12\sin 0=0\). Their sum is \(8\), as required. The constant \(5\) contributes nothing.

A Common Mistake: Dropping the Frequency Factor

A frequent error is to differentiate the outer sine or cosine but forget that its input also depends on \(x\). For example, the following calculation is wrong:

$$ \frac{d}{dx}\bigl(4\sin(7x)\bigr)=4\cos(7x). $$

This omits the derivative of the input \(7x\). Since \(\frac{d}{dx}(7x)=7\), the chain rule requires that factor:

$$ \frac{d}{dx}\bigl(4\sin(7x)\bigr) =4\cos(7x)\cdot7 =28\cos(7x). $$

The mistake changes the coefficient from \(28\) to \(4\), even though the trigonometric function and its input appear unchanged. A useful check is to ask, for every term, “What is the derivative of the expression inside the sine or cosine?” If that expression is \(n\omega x\), the answer is \(n\omega\), and that multiplier must appear.

Amplitude and Frequency Play Different Roles

In a term such as \(a_n\sin(n\omega x)\), the coefficient \(a_n\) and the frequency \(n\omega\) have different jobs. The coefficient multiplies the component's size, and it remains in the derivative. The frequency determines how quickly the trigonometric input changes with \(x\), so it appears as an additional multiplier from the chain rule. For a cosine term, the minus sign comes from the derivative of cosine, not from the frequency.

Original componentDerivative componentWhat changes
\(a_n\sin(n\omega x)\)\(n\omega a_n\cos(n\omega x)\)Sine becomes cosine; multiply by \(n\omega\).
\(a_n\cos(n\omega x)\)\(-n\omega a_n\sin(n\omega x)\)Cosine becomes negative sine; multiply by \(n\omega\).
\(C\)\(0\)A constant has zero derivative.

This distinction is useful whenever a model contains several oscillatory components: the derivative preserves the separate contributions instead of replacing them with one shared frequency factor. A higher harmonic receives a larger chain-rule multiplier because its input changes more quickly with \(x\). The differentiation rule itself remains term by term, regardless of whether the frequencies are equal or different.

A Reliable Procedure

For a finite sum of sine and cosine components, use the following sequence. Writing each input derivative explicitly makes it harder to lose a frequency factor or a sign.

1
List the components.
Separate the constant, sine terms, and cosine terms. Note the input of each trigonometric function.
2
Differentiate each input.
For an input \(n\omega x\), record the factor \(n\omega\).
3
Apply the appropriate trigonometric rule.
Sine becomes cosine; cosine becomes negative sine. Multiply by the original coefficient and by the input derivative.
4
Combine and check.
Add the component derivatives and verify each term's sign and frequency multiplier against the original sum.

Harmonic sums are a natural place to practice keeping these pieces separate. Before simplifying the final expression, retain the chain-rule multiplication on each line. This exposes the origin of every coefficient and makes errors easier to locate.

Check Your Understanding

For each question, keep the frequency factor associated with the specific component being differentiated.

  1. Differentiate \(p(x)=\sin(2x)+\cos(4x)\). Which input-frequency factor appears in each derivative term?
  2. Differentiate \(q(x)=3\cos(5x)-2\sin(10x)+6\).
  3. For base frequency \(\omega=3\), write the frequencies of the first, second, and fourth harmonics.
  4. A student writes \(\frac{d}{dx}(2\sin(9x))=2\cos(9x)\). Identify the missing factor and give the corrected derivative.
  5. In a harmonic sum, why does a cosine component produce a negative sine term, while a sine component produces a cosine term?

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