FS03: Orthogonality of Sines and Cosines
FS02 introduced the function inner product
and defined two functions to be orthogonal when that inner product is zero.
Fourier series become practical because different integer harmonics of sine and cosine are
orthogonal over a complete fundamental period.
The purpose of this lecture is to derive that statement from elementary trigonometry and
integration. Nothing will be taken on faith.
The central results on [−π,π] are
and
for positive integers m and n.
We will derive each formula separately. We will then extend the result to the interval [−L,L] and
explain exactly why this orthogonality allows a Fourier coefficient to be isolated by multiplication
and integration.
Figure 1. Orthogonality is an integral cancellation statement. Positive and negative contributions
to the product of two different harmonic functions cancel over a complete period, even though the
product is not zero point by point.
1 Formal definitions owned by FS03
Trigonometric orthogonality
Two trigonometric functions are orthogonal on an interval when their function inner product on
that interval vanishes. For example,
are orthogonal on [−π,π] for distinct positive integers m and n because
Harmonic orthogonality
Harmonic orthogonality is the special orthogonality among distinct integer harmonics of a common
fundamental frequency when the inner product is taken over a complete fundamental
period.
If the fundamental angular frequency is ω0, the functions
for integer n form the harmonic family. Distinct members are orthogonal over any complete
interval of length
Full-period cancellation
A periodic sine or cosine with a nonzero integer number of cycles over an integration
interval has zero integral over that complete set of cycles. We will call this full-period
cancellation.
On [−π,π], for any nonzero integer k,
and
Kronecker delta
The Kronecker delta is the discrete symbol
It lets us write an entire orthogonality table compactly. For example,
for positive integers m,n.
Trigonometric basis norm
The trigonometric basis norm is the function norm of one basis function under the chosen inner
product. On [−π,π],
for n ≥ 1.
The constant function has a different norm:
Normalized trigonometric basis
Dividing every nonzero basis function by its norm gives a normalized trigonometric basis. On
[−π,π],
are normalized basis functions. Together they form an orthonormal trigonometric family.
2 Why integer harmonics are the natural periodic family
FS01 established that a periodic function with fundamental period 2π naturally uses integer
harmonics
The function cos(nx) completes exactly n cycles while x runs through any interval of length 2π.
The same is true of sin(nx).
This integer-cycle property is the geometric source of the cancellation that follows.
Figure 2. The first three cosine harmonics on one common 2π interval. Each completes an integer
number of cycles and returns to its starting phase at the end of the interval.
3 The elementary cancellation lemma
Before multiplying two harmonics together, we need one simple integral result.
Let k be a nonzero integer. Consider
Integrate directly:
| Ic(k) | = −ππ | (18)
|
| = − . | (19) |
For integer k,
and
Therefore
Now consider
One direct method is integration:
| Is(k) | = −ππ | (24)
|
| = − + . | (25) |
Because cosine is even,
so the two terms cancel:
There is also a symmetry argument. The function sin(kx) is odd, so its integral over the symmetric
interval [−π,π] vanishes automatically.
These two equations are the cancellation engine used throughout the rest of the lecture.
4 Deriving the product-to-sum identities
Orthogonality integrals contain products such as
Products are inconvenient to integrate directly. The product-to-sum identities turn them into sums
of single sinusoids, which can then use the cancellation lemma.
We derive the identities rather than quote them.
4.1 Cosine times cosine
Start from the angle-addition formulas
and
Add them:
| cos(A − B) + cos(A + B) | = 2 cos A cos B. | (31) |
Divide by 2:
4.2 Sine times sine
Subtract the two cosine addition formulas:
| cos(A − B) − cos(A + B) | = 2 sin A sin B. | (33) |
Therefore
4.3 Sine times cosine
Use
and
Add them:
| sin(A + B) + sin(A − B) | = 2 sin A cos B. | (37) |
Hence
Figure 3. Product-to-sum converts a product of two harmonics into a sum containing a
difference-frequency term and a sum-frequency term. For distinct integer harmonics, both
resulting frequencies are nonzero integers and integrate to zero over a complete 2π interval.
5 Cosine-cosine orthogonality when m≠n
Consider
where m and n are distinct positive integers.
Use Equation (32) with
Then
Insert this into the integral:
| Icc | = ∫
−ππ cos((n − m)x) dx | (42)
|
| + ∫
−ππ cos((n + m)x) dx. | (43) |
Because n≠m,
Because both are positive,
Both n − m and n + m are nonzero integers. Therefore Equation (22) applies to both
integrals:
and
Hence
Thus distinct cosine harmonics are orthogonal.
6 Cosine-cosine self-inner product when m = n
The previous derivation cannot simply substitute m = n and say both terms vanish. One of the
product-to-sum frequencies becomes zero. That case must be handled separately.
Set m = n:
From Equation (32), with A = B = nx,
| cos 2(nx) | =  ![[cos(0) + cos(2nx )]](https://images.physicslibrary.org/cache/objects/1521/make4ht/OrthogonalityOfSinesAndCosines49x.png) | (50)
|
| =  . | (51) |
Therefore
| Icc(n) | = ∫
−ππ1 dx + ∫
−ππ cos(2nx) dx. | (52) |
The second integral vanishes by full-period cancellation. The first is just the interval
length:
Hence
| Icc(n) | = (2π) | (54)
|
| = π. | (55) |
Thus
This is not orthogonality to itself. It is the squared norm of the basis function.
Combining the two cases gives Equation (2).
Figure 4. Distinct cosine harmonics produce a product whose positive and negative areas cancel
over the full interval. When the same harmonic is multiplied by itself, the product is cos2(nx) and
its integral is the positive norm-squared value π.
7 Sine-sine orthogonality when m≠n
Now consider
Use Equation (34):
Thus
| Iss | = ∫
−ππ cos((n − m)x) dx | (59)
|
| − ∫
−ππ cos((n + m)x) dx. | (60) |
If m≠n, both frequencies are nonzero integers. Each integral vanishes. Therefore
Distinct sine harmonics are orthogonal.
8 Sine-sine self-inner product when m = n
Set m = n:
From Equation (34), with A = B = nx,
| sin 2(nx) | =  ![[cos0 − cos(2nx )]](https://images.physicslibrary.org/cache/objects/1521/make4ht/OrthogonalityOfSinesAndCosines64x.png) | (63)
|
| =  . | (64) |
Then
| Iss(n) | = ∫
−ππ1 dx − ∫
−ππ cos(2nx) dx | (65)
|
| = (2π) − 0 | (66)
|
| = π. | (67) |
Thus
Combining the cases gives Equation (3).
Figure 5. The square of a sine harmonic is nonnegative. Its oscillating cos(2nx) part averages to
zero, leaving half the interval length and therefore a norm squared of π on [−π,π].
9 Sine-cosine orthogonality
Now consider
There are two complementary ways to prove that this integral is zero.
9.1 Method 1: parity
The function
is odd:
The function
is even:
The product of an odd function and an even function is odd. Therefore
is odd. The integral of an odd function over a symmetric interval vanishes:
This proof works even when m = n.
9.2 Method 2: product-to-sum
Use Equation (38):
Integrate:
| Isc | = ∫
−ππ sin((n + m)x) dx | (77)
|
| + ∫
−ππ sin((n − m)x) dx. | (78) |
If n≠m, both sine terms have integer frequencies and both integrals vanish.
If n = m, then the second sine is
point by point, while the first integral still vanishes.
Thus in every case
Figure 6. A sine is odd and a cosine is even, so their product is odd. On the symmetric interval
[−π,π], the left and right contributions cancel exactly.
10 The constant function is also part of the Fourier basis
A real Fourier series contains a constant component in addition to sine and cosine harmonics.
Therefore we must also check how the constant function interacts with the harmonics.
For n ≥ 1,
Likewise,
Thus the constant function is orthogonal to every nonzero sine and cosine harmonic on the
complete interval.
Its norm is
| ∥1∥2 | = ⟨1, 1⟩ | (83)
|
| = ∫
−ππ1 dx | (84)
|
| = 2π. | (85) |
Therefore
This different norm explains why the constant Fourier coefficient will carry a different
normalization factor from the sine and cosine coefficients.
11 The complete orthogonality table on [−π,π]
For positive integers m,n,
and
Also,
Finally,
These equations are the algebraic core of real Fourier series.
12 Norms and the normalized trigonometric family
From Equations (56) and (68),
and
The constant function has
Therefore define
and
Each has unit norm. Different members are orthogonal. Thus the family is orthonormal.
Figure 7. Normalization rescales each basis function so its norm is one. The constant function
needs a different scale from the nonzero sine and cosine harmonics because its squared norm is 2π
rather than π.
13 Worked Example 1: verify one cosine-cosine pair directly
Evaluate
Use product-to-sum:
| cos(2x) cos(5x) | =  ![[cos(− 3x ) + cos(7x )]](https://images.physicslibrary.org/cache/objects/1521/make4ht/OrthogonalityOfSinesAndCosines99x.png) | (99)
|
| =  , | (100) |
because cosine is even.
Then
| ∫
−ππ cos(2x) cos(5x) dx | = ∫
−ππ cos(3x) dx | (101)
|
| + ∫
−ππ cos(7x) dx | (102)
|
| = 0 + 0 | (103)
|
| = 0. | (104) |
The two harmonics are orthogonal.
14 Worked Example 2: same cosine harmonic
Evaluate
Use
Then
| ∫
−ππ cos 2(4x) dx | = (2π) + (0) | (107)
|
| = π. | (108) |
This is the norm squared of cos(4x).
15 Worked Example 3: sine-cosine orthogonality by parity
Evaluate
The sine factor is odd and the cosine factor is even. Their product is odd. Therefore
No product-to-sum identity is needed.
16 Worked Example 4: orthogonality depends on the interval
Consider
On [−π,π] they are orthogonal:
Now integrate on [0,π∕2]:
Use product-to-sum:
Then
| I | =  0π∕2 | (115)
|
| =  ![[ 1 ]
1 − --(− 1)
3](https://images.physicslibrary.org/cache/objects/1521/make4ht/OrthogonalityOfSinesAndCosines117x.png) | (116)
|
| =   | (117)
|
| = . | (118) |
Thus the same two functions are not orthogonal on this shorter interval.
This is why the integration interval is part of the inner product definition.
17 Generalization from [−π,π] to [−L,L]
Fourier series are often written on an interval of total length 2L rather than 2π. The corresponding
harmonic functions are
and
We can derive their orthogonality by changing variables.
Let
Then
and
When
we have
When
we have
Consider the cosine-cosine inner product:
| I | = ∫
−LL cos cos dx | (128)
|
| = ∫
−ππ cos(ny) cos(my) dy. | (129) |
Use Equation (87):
| I | = (πδmn) | (130)
|
| = Lδmn. | (131) |
Therefore
Similarly,
and
The constant function has
Therefore on [−L,L] the normalized basis becomes
and
18 Generalization to a time interval of one period
Suppose a periodic signal has period T0 and fundamental angular frequency
Its harmonics are
and
Over any complete interval of length T0,
for positive m,n.
Likewise,
and
The starting time t0 does not matter as long as the integration covers one complete fundamental
period.
19 Why distinct integer harmonics are special
The product-to-sum derivation shows exactly what is required.
For different cosine harmonics,
produces frequencies
When m and n are integers, both are integers. If m≠n, neither is zero. Each resulting sinusoid
therefore completes an integer number of cycles on the chosen full-period interval and integrates to
zero.
This explains the connection
If arbitrary noncommensurate frequencies are chosen, this cancellation is not guaranteed over the
same finite interval.
20 The geometric meaning of the Kronecker delta
FS02 showed that orthogonal vectors have zero cross inner product and nonzero self inner product.
The same pattern occurs here.
For normalized cosine functions,
we have
Thus the Kronecker delta is the infinite-dimensional analogue of the familiar Cartesian
relation
The Fourier sine and cosine functions behave like perpendicular coordinate directions in function
space.
21 How orthogonality isolates one harmonic
We now reach the key bridge to FS04 and FS05.
Suppose, for the moment, that a function can be represented by a finite trigonometric
sum
Suppose we want to isolate the coefficient Am. Multiply both sides by cos(mx):
| f(x) cos(mx) | = A0 cos(mx) | (152)
|
| + ∑
n=1NA
n cos(nx) cos(mx) | (153)
|
| + ∑
n=1NB
n sin(nx) cos(mx). | (154) |
Now integrate over [−π,π]:
| ∫
−ππf(x) cos(mx) dx | = A
0 ∫
−ππ cos(mx) dx | (155)
|
| + ∑
n=1NA
n ∫
−ππ cos(nx) cos(mx) dx | (156)
|
| + ∑
n=1NB
n ∫
−ππ sin(nx) cos(mx) dx. | (157) |
Now apply orthogonality.
The constant term vanishes:
Every sine-cosine term vanishes:
Every cosine-cosine term with n≠m vanishes. Only one term remains:
But
Therefore
So
FS04 will develop this argument carefully as the derivation of the Fourier cosine coefficients. The
purpose here is only to expose the mechanism:
- multiply by the desired basis function,
- integrate,
- orthogonality removes every unwanted basis direction,
- divide by the surviving basis norm squared.
Figure 8. Orthogonality turns coefficient extraction into a filtering operation. Multiplication by
one basis function followed by integration removes all orthogonal harmonics and leaves only the
matching component multiplied by its norm squared.
22 A direct connection to FS02 projection
FS02 derived the projection coefficient
Choose
Then
Therefore
The Fourier cosine coefficient is therefore not a new type of mathematical object. It
is an ordinary function-space projection coefficient onto an orthogonal trigonometric
basis.
The same will hold for sine coefficients.
23 Common mistakes
- Assuming two functions are orthogonal because their graphs look different.
Orthogonality is an integral condition.
- Forgetting that the interval is part of the inner product. Functions can be orthogonal
on one interval and nonorthogonal on another.
- Using the m≠n product-to-sum argument when m = n. The difference frequency
becomes zero and produces the nonzero norm-squared term.
- Assuming a function is orthogonal to itself. A nonzero function has positive self inner
product.
- Forgetting that the constant basis function has norm squared 2π, not π.
- Writing
without specifying the limits. Orthogonality is not an indefinite-integral statement.
- Forgetting that sine-cosine orthogonality on a symmetric interval follows immediately from
parity.
- Using noninteger frequencies and expecting the same cancellation on [−π,π] without
checking the interval.
- Confusing orthogonal with orthonormal. The unscaled sine and cosine functions are
orthogonal but have norm
, not 1.
- Treating the Kronecker delta as a function of x. It is a discrete symbol depending on the
indices m and n.
24 Self-check questions
- Why does cos((n − m)x) cause a special case when n = m?
- Why does the integral of cos(kx) vanish on [−π,π] for nonzero integer k?
- Why can sine-cosine orthogonality be proved without product-to-sum identities?
- What is the norm of cos(7x) on [−π,π]?
- What is the norm of the constant function 1 on [−π,π]?
- What scaling makes sin(5x) normalized?
- What does δmn mean when m = 3 and n = 5?
- What does δmn mean when m = n = 4?
- Why are sin x and sin 2x not necessarily orthogonal on an arbitrary subinterval?
- In one sentence, explain why multiplying a Fourier sum by cos(mx) and integrating
isolates the matching cosine coefficient.
25 Practice exercises
- Derive Equation (32) from the cosine angle-addition identities.
- Derive Equation (34) from the same identities.
- Derive Equation (38) from the sine angle-addition identities.
- Evaluate
- Evaluate
- Evaluate
using both parity and product-to-sum.
- Evaluate
- Evaluate
- Find the norms of 1, cos(5x), and sin(5x) on [−π,π].
- Normalize the three functions in the preceding problem.
- Show that
- Show that
- Determine whether cos x and cos 2x are orthogonal on [0,π∕2].
- Determine whether sin x and cos 2x are orthogonal on [−π∕2,π∕2].
- For
compute
using orthogonality rather than expanding every integral independently.
- For the same f(x), compute
26 What FS03 has established
We now know that the real trigonometric family
is orthogonal on [−π,π].
The nonzero harmonics have squared norm
while the constant has squared norm
The general interval [−L,L] gives squared harmonic norm
and constant norm squared
Most importantly, orthogonality gives a mechanism for extracting one component from a
trigonometric sum.
That mechanism is exactly what the next lectures formalize:
- FS04 derives the Fourier cosine coefficients,
- FS05 derives the sine coefficients and the constant coefficient.
References
References
[1] PhysicsLibrary, FS01: Periodic Functions, Harmonics, and Why Fourier Series Exist.
[2] PhysicsLibrary, FS02: Inner Products of Functions.
[3] E. Kreyszig, Advanced Engineering Mathematics, Wiley.
[4] G. B. Arfken, H. J. Weber, and F. E. Harris, Mathematical Methods for Physicists,
Academic Press.
[5] M. L. Boas, Mathematical Methods in the Physical Sciences, Wiley.