---
title: Trigonometric integrals
heading: Why different frequencies don't mix on average
eyebrow: A6 · Lesson 2 · Trigonometric integrals
xp: 40
---

::: hook
Multiply a 50 Hz sine by a 150 Hz sine and average over a cycle: you get exactly zero. Multiply a 50 Hz sine by itself: you get one half. That pair of facts is why A3's RMS values at different frequencies add in quadrature, why a Fourier analyzer can pick one frequency out of a mixture, and why a radio can tune one station among thousands. They come from integrating products of sines and cosines, which identities turn into integrals you can do.
:::

::: play
- The curve is $\sin(mx)\sin(nx)$ over one period, $0$ to $2\pi$.
- Set $m = n$. The area (readout) is $\pi$. Now make $m \ne n$. What is the area?
- Watch how the positive and negative lobes balance.
:::
:::

```sim plot
view: graph
x: x = 0..6.2832
y: y = -1.1..1.1
slider: m = 1..5 step 1 = 1
slider: n = 1..5 step 1 = 3
plot: sin(m*x)*sin(n*x) | label: sin(mx) sin(nx) | samples: 1500
plot: sin(m*x)*sin(n*x) | fill: 0..6.2832 | color: ch2
readout: area over 0 to 2π = pi*(1 - step(abs(m - n) - 0.5)) | digits: 4
```

::: predict
## What is $\displaystyle\int_0^{2\pi}\sin(2x)\sin(3x)\,dx$?

- [x] 0
- [ ] $\pi$
- [ ] $2\pi$
- [ ] 1

::: reveal
0. The product-to-sum identity turns it into $\frac{1}{2}[\cos x - \cos 5x]$, and each cosine completes whole cycles over $[0, 2\pi]$, so each integrates to zero. Sines of different whole-number frequencies are **orthogonal**: their product averages to zero.
:::
:::

::: nameit
## Powers of sine and cosine

**Even powers:** use the half-angle identities.

$$\sin^2 x = \frac{1 - \cos 2x}{2} \qquad \cos^2 x = \frac{1 + \cos 2x}{2}$$

So $\int_0^{2\pi}\sin^2 x\,dx = \pi$: the average of $\sin^2$ over a cycle is $\frac{1}{2}$, the reason a sine's RMS is its peak over $\sqrt2$.

**An odd power:** split one factor off and substitute. For $\int \sin^3 x\,dx$, write $\sin^2 x\sin x = (1 - \cos^2 x)\sin x$ and let $u = \cos x$:

$$\int(1 - u^2)(-du) = -\cos x + \frac{\cos^3 x}{3} + C$$

## Products of different frequencies

Product-to-sum identities turn products into sums:

$$\sin A\sin B = \tfrac{1}{2}[\cos(A - B) - \cos(A + B)]$$
$$\cos A\cos B = \tfrac{1}{2}[\cos(A - B) + \cos(A + B)]$$
$$\sin A\cos B = \tfrac{1}{2}[\sin(A - B) + \sin(A + B)]$$

## Orthogonality

For whole numbers $m, n \ge 1$:

$$\int_0^{2\pi}\sin mx\sin nx\,dx = \int_0^{2\pi}\cos mx\cos nx\,dx = \begin{cases}\pi & m = n\\ 0 & m \ne n\end{cases}$$

and $\int_0^{2\pi}\sin mx\cos nx\,dx = 0$ always.

**Why it matters.** Multiply a signal by $\sin(n\omega t)$ and average: every component at another frequency averages to zero and only the component at $n\omega$ survives. That's how a lock-in amplifier measures a tiny signal buried in noise, how a radio mixer and filter pick one station, and how Fourier coefficients are computed (A10).
:::

::: example
## Find the average power of $i = 3\sin(\omega t)$ A in a 10 Ω resistor.

::: solution
1. **Instantaneous power.** Use $p = i^2R$ and the double-angle identity:
   $$\begin{aligned} p &= 10 \times 9\sin^2(\omega t) \\ &= 90 \cdot \frac{1 - \cos 2\omega t}{2} \end{aligned}$$
2. **Average over a cycle.** Over a whole cycle the $\cos 2\omega t$ term averages to zero, leaving
   $$\frac{90\ \text{W}}{2} = 45\ \text{W}$$

**Answer:** the average power is 45 W, half the 90 W peak.
:::
:::

::: example
## A signal $s(t) = 2\sin t + 0.5\sin 3t$ is multiplied by $\sin 3t$ and averaged over $[0, 2\pi]$. What comes out?

::: solution
1. **Multiply by $\sin 3t$.**
   $$\begin{aligned} s(t)\sin 3t &= 2\sin t\sin 3t \\ &\quad + 0.5\sin^2 3t \end{aligned}$$
2. **Average the $\sin t$ part.** It vanishes by orthogonality:
   $$\frac{1}{2\pi}\int_0^{2\pi}2\sin t\sin 3t\,dt = 0$$
3. **Average the $\sin 3t$ part.**
   $$\begin{aligned} \frac{1}{2\pi}\int_0^{2\pi}0.5\sin^2 3t\,dt &= \frac{1}{2\pi}(0.5\pi) \\ &= 0.25 \end{aligned}$$
4. **Read off the amplitude.** $0.25 = 0.5/2$ recovers the amplitude of the $\sin 3t$ component: multiply by 2 and you've measured it.

**Answer:** 0.25 comes out, half the 0.5 amplitude of the $\sin 3t$ component, while the $2\sin t$ part averages away.
:::
:::

::: example
## A current $i = 2 + 3\sin\omega t$ A flows through 10 Ω. What average power does it deliver?

::: solution
1. **Square the current.**
   $$i^2 = 4 + 12\sin\omega t + 9\sin^2\omega t$$
2. **Average over a period.** $\sin\omega t$ averages to 0 and $\sin^2\omega t$ to ½, so the mean square is
   $$4 + 4.5 = 8.5\ \text{A}^2$$
3. **Multiply by the resistance.**
   $$8.5\ \text{A}^2 \times 10\ \Omega = 85\ \text{W}$$
   The DC part and the AC part each contribute their own power, and the cross term averages away.

**Answer:** the current delivers 85 W on average.
:::
:::

::: check
given: A = 1 | 2 | 5
answer: pi*A^2

## Evaluate $\displaystyle\int_0^{2\pi}\given{A}^2\sin^2 x\,dx$.

::: right
Right. $\sin^2$ averages to $\frac{1}{2}$ over a cycle of length $2\pi$: $\pi A^2$ = {answer}.
:::

::: misses
- [2*pi*A^2] $\sin^2$ averages to a half, not 1.
- [0] $\sin^2 \ge 0$, so it can't integrate to zero.
- [any] Not yet. Use $\sin^2 x = \frac{1}{2}(1 - \cos 2x)$.
:::
:::

::: check
given: m = 1 | 2 | 3; n = 4 | 5
answer: 0

## Evaluate $\displaystyle\int_0^{2\pi}\cos(\given{m}x)\cos(\given{n}x)\,dx$.

::: right
Right. Different whole-number frequencies are orthogonal.
:::

::: misses
- [pi] That's for $m = n$. Here they differ.
- [any] Not yet. Product to sum: two cosines that complete whole cycles.
:::
:::

::: check
kind: expression
answer: -cos(x) + cos(x)^3/3
vars: x = 0..3

## Find $\int\sin^3 x\,dx$ (constant zero).

::: right
Right. Split off one $\sin x$, write the rest in cosines, and substitute $u = \cos x$.
:::

::: misses
- [-cos(x)^3/3] The power rule doesn't apply to $\sin^3$ directly.
- [cos(x) - cos(x)^3/3] Check the sign: $\int\sin x\,dx = -\cos x$.
- [any] Not yet. $\sin^3 x = (1 - \cos^2 x)\sin x$, then $u = \cos x$.
:::
:::

::: check
given: I = 2 | 3 | 4; R = 10 | 50
answer: I^2*R/2
unit: W

## A current $\given{I}\sin(\omega t)$ A flows through {R} Ω. What is the average power?

::: right
Right. $I^2R\overline{\sin^2} = \frac{1}{2}I^2R$ = {answer}.
:::

::: misses
- [I^2*R] That's the peak power. The average of $\sin^2$ is a half.
- [I*R/2] Power uses $I^2$.
- [any] Not yet. Average $I^2R\sin^2\omega t$ over a cycle.
:::
:::

::: check
given: a = 1 | 2; b = 0.5 | 3
answer: b/2
tolerance: 0.5%

## A signal $\given{a}\sin t + \given{b}\sin 2t$ is multiplied by $\sin 2t$ and averaged over $[0, 2\pi]$. What is the average?

::: right
Right. The $\sin t$ part vanishes; $\given{b}\sin^2 2t$ averages to $\given{b}/2$.
:::

::: misses
- [b] $\sin^2$ averages to a half.
- [(a + b)/2] The $\sin t \sin 2t$ term averages to zero: orthogonality.
- [any] Not yet. Average each term separately.
:::
:::

::: check
kind: parts
given: m = 2 | 3; n = 1 | 4; A = 2 | 5

## Average products of sinusoids over $[0, 2\pi]$.

::: part
answer: A^2/2
tolerance: 0.5%

### What is the average of $(\given{A}\sin \given{m}t)^2$?

::: misses
- [A^2] The average of $\sin^2$ is ½.
- [any] $\sin^2 = \tfrac12(1 - \cos 2mt)$.
:::
:::

::: part
answer: 0.5
tolerance: 0.5%

### What is the average of $\sin \given{m}t \cdot \sin \given{m}t + \sin \given{m}t \cdot \sin \given{n}t$?

::: misses
- [1] The cross term between different frequencies averages to zero.
- [any] Same frequencies give ½; different ones give 0.
:::
:::
:::

::: check
kind: derivation
vars: m = 1..4, n = 5..8, t = 0..6

## Show that $\sin mt\,\sin nt$ averages to zero for $m \ne n$.

::: step
answer: (cos((m - n)*t) - cos((m + n)*t))/2

### Rewrite $\sin mt\,\sin nt$ with the product-to-sum identity.
:::

::: step
answer: 0

### Each cosine runs a whole number of cycles over $[0, 2\pi]$. What is the integral?
:::

::: right
Right. Sines of different whole-number frequencies are orthogonal: the basis of Fourier series and of every filter bank.
:::
:::

::: explain
## Why does a 50 Hz sine multiplied by a 150 Hz sine average to zero over a cycle, while a sine multiplied by itself doesn't?

::: model
By the product-to-sum identity, the product of the two sines is half the difference of two cosines, at 100 Hz and 200 Hz. Over one 50 Hz cycle each of those cosines goes through a whole number of cycles, with equal positive and negative area, so the average is zero. A sine times itself is $\sin^2$, which is never negative: the identity turns it into $\frac{1}{2} - \frac{1}{2}\cos(2\omega t)$, and the constant $\frac{1}{2}$ survives the averaging.
:::
:::

::: practice

::: check
given: k = 1..9 int
answer: pi

## Evaluate $\displaystyle\int_0^{2\pi}\cos^2(\given{k}x)\,dx$.

::: misses
- [2*pi] It averages to a half.
- [any] $\cos^2 u = \frac{1}{2}(1 + \cos 2u)$.
:::
:::

::: check
given: m = 1 | 2; n = 3 | 6
answer: 0

## Evaluate $\displaystyle\int_0^{2\pi}\sin(\given{m}x)\cos(\given{n}x)\,dx$.

::: misses
- [any] Sine-cosine products always integrate to zero over a full period.
:::
:::

::: check
given: A = 2..20 int
answer: A/sqrt(2)
tolerance: 0.5%

## What is the RMS of $\given{A}\cos t$, from $\sqrt{\frac{1}{2\pi}\int_0^{2\pi}A^2\cos^2t\,dt}$?

::: misses
- [A/2] The mean of $\cos^2$ is $\frac{1}{2}$; take the square root of $A^2/2$.
- [any] $\sqrt{A^2/2}$.
:::
:::
:::
