Notes for the Physics-Based Calculus workshop

Adam Coffman

These notes on trigonometric polynomials and the Fourier transform were used in a Physics-Based Calculus summer workshop for teachers at IPFW, from 2001 to 2004, which was supported by NSF grant DUE 9555408 as part of the Indiana University system’s Mathematics Throughout the Curriculum project (PI: Dan Maki). I have also used excerpts in Math 363, the Differential Equations course at Purdue Fort Wayne, supplementing the textbook [5].

1 Trigonometric Functions

We recall the following identities for trigonometric functions.

Theorem 1.1. For all x ∈ ℝ, cos(−x) = cos(x) and sin(−x) = − sin(x).

Theorem 1.2. For all α, β ∈ ℝ, cos(α + β) = cos(α) cos(β) − sin(α) sin(β).

Theorem 1.3. For all α, β ∈ ℝ, sin(α + β) = sin(α) cos(β) + cos(α) sin(β).

Proof. For small positive angles (so α + β is less than a right angle), the identities from Theorem 1.2 and 1.3 both follow from looking at (and thinking about) the following diagram.

[omitted from this version]

Corollary 1.4. For all α, β ∈ ℝ, cos(α − β) = cos(α) cos(β) + sin(α) sin(β). Proof. This follows from Theorems 1.1 and 1.2:

cos(α + (−β)) = cos(α) cos(−β) − sin(α) sin(−β)
= cos(α) cos(β) − sin(α)(− sin(β))
= cos(α) cos(β) + sin(α) sin(β).

Corollary 1.5. For all α, β ∈ ℝ, sin(α − β) = sin(α) cos(β) − cos(α) sin(β). Proof. This follows from Theorems 1.1 and 1.3 in the same way as the Proof of Corollary 1.4. Corollary 1.6. For all α, β ∈ ℝ, cos(α) cos(β) = \frac{1}{2}(cos(α + β) + cos(α − β)). Proof. Add the left hand sides of the identities from Theorem 1.2 and Corollary 1.4, to get cos(α + β) + cos(α − β). This should be the same as adding the right hand sides of the identities, which is (cos(α) cos(β) − sin(α) sin(β)) + (cos(α) cos(β) + sin(α) sin(β)). Two terms are the same, the other two cancel, for a total of 2 cos(α) cos(β). Dividing by 2 gives the result. Corollary 1.7. For all α, β ∈ ℝ, cos(α) sin(β) = \frac{1}{2}(sin(α + β) + sin(α − β)). Corollary 1.8. For all α, β ∈ ℝ, sin(α) sin(β) = \frac{1}{2}(cos(α − β) − cos(α + β)). Proof. The proofs of these Corollaries are both similar to the proof of Corollary 1.6. Corollary 1.9. For constants A, ϕ, and ω, any function of the form f(x) = A cos(ωx + ϕ) can be expressed as a constant multiple of cos(ωx) plus some other constant multiple of sin(ωx). Proof. Using Theorem 1.2,

f(x) = A cos(ωx + ϕ)
= A(cos(ωx) cos(ϕ) − sin(ωx) sin(ϕ))
= (A cos(ϕ)) cos(ωx) + (−A sin(ϕ)) sin(ωx).

Lemma 1.10. If f(x) = M cos(ωx + ϕ) is a constant function, then M = 0 or ω = 0. Proof. Suppose toward a contradiction that M ≠ 0 and ω ≠ 0. Then f(x) = f(0) for all x, so cos(ωx + ϕ) is the constant function cos(ϕ)/M, but cos(ω · \frac{−ϕ}{ω} + ϕ) = 1 and cos(ω · \frac{\frac{1}{2} π−ϕ}{ω} + ϕ) = 0, which is a contradiction.

Theorem 1.11. For constants A, B, ω ∈ ℝ, any function of the form f(x) = A cos(ωx) + B sin(ωx) is equal to a function of the form M cos(ωx + ϕ), for some M ≥ 0 and −π < ϕ ≤ π. If ω ≠ 0, then the number M is unique.

Proof. If A = B = 0, let M = 0, and ϕ can be anything, since f is the constant function 0. If (A, B) ≠ (0, 0), let M = \sqrt{A^{2} + B^{2}}, and since −1 ≤ \frac{A}{\sqrt{A^{2}+B^{2}}} ≤ 1, there is a unique number ϕ_{1} in the interval [0, π] such that cos(ϕ_{1}) = \frac{A}{\sqrt{A^{2}+B^{2}}} . From sin^{2}(ϕ_{1}) + cos^{2}(ϕ_{1}) = 1 and 0 ≤ ϕ_{1} ≤ π, we can conclude sin(ϕ_{1}) = +\sqrt{1 − cos^{2}(ϕ_{1})} = \frac{|B|}{\sqrt{A^{2}+B^{2}}} . If sin(ϕ_{1}) = −\frac{B}{\sqrt{A^{2}+B^{2}}} , then let ϕ = ϕ_{1}, otherwise, if sin(ϕ_{1}) = \frac{B}{\sqrt{A^{2}+B^{2}}} ≠ 0, then let ϕ = −ϕ_{1}, so sin(ϕ) = − sin(ϕ_{1}). In either case, cos(ϕ) = cos(ϕ_{1}) = cos(−ϕ_{1}). Using Theorem 1.2 again,

M cos(ωx + ϕ) = \sqrt{A^{2} + B^{2}}(cos(ωx) cos(ϕ) − sin(ωx) sin(ϕ))
= A cos(ωx) + B sin(ωx).

For ω ≠ 0, the uniqueness means that if M ≥ 0 and M′ ≥ 0 and

f(x) = A cos(ωx) + B sin(ωx) = M cos(ωx + ϕ) = M′ cos(ωx + ϕ′),

then M′ = M. If M = 0 then M′ cos(ωx + ϕ′) is a constant function with ω ≠ 0, so M′ = 0 by Lemma 1.10. If M ≠ 0, then by Lemma 1.10, M cos(ωx + ϕ) is a non-constant function, with maximum value M > 0 on the domain ℝ, and M′ is the maximum value of the non-constant function M′ cos(ωx + ϕ′), but f can have only one maximum value.

Definition 1.12. Given A, B ∈ ℝ, and ω ≠ 0, the coefficient M ≥ 0 that appears in the equality

f(x) = A cos(ωx) + B sin(ωx) = M cos(ωx + ϕ)

is called the \underline{amplitude} of the function f(x), and the previous proof showed that M is given uniquely by the formula \sqrt{A^{2} + B^{2}}. If f(x) happens to be a constant function, f(x) = A, define its amplitude to be |A|.

Corollary 1.13. If f(x) = A cos(ωx) + B sin(ωx) is a constant, then either A = B = 0 or ω = 0.

Proof. Let f(x) = M cos(ωx + ϕ) as in Theorem 1.11, so Lemma 1.10 applies, and either ω = 0 or M = 0. If ω ≠ 0, then 0 = M = \sqrt{A^{2} + B^{2}} by the uniqueness part of Theorem 1.11, so A = B = 0.

Theorem 1.14. Given constants A, B, A′, B′, ω ≠ 0, ω′ ≠ 0, if

A cos(ωx) + B sin(ωx) = A′ cos(ω′x) + B′ sin(ω′x)

for all x ∈ ℝ, then A′ = A and B′ = ±B. If (A, B) ≠ (0, 0) then ω′ = ±ω. If (A, B) ≠ (0, 0) and ω > 0 and ω′ > 0, then ω′ = ω and B′ = B.

Proof. Plugging x = 0 into both sides gives A = A′. Let f(x) = A cos(ωx) + B sin(ωx).

Case 1. If (A, B) = (0, 0), then f is constant, and since ω′ ≠ 0, A′ = B′ = 0 by Corollary 1.13.

Case 2. If (A, B) ≠ (0, 0), then f is not constant (using ω ≠ 0 and Corollary 1.13). By Theorem 1.11, f(x) = M cos(ωx + ϕ), with M > 0, and since ω ≠ 0, M is the maximum value of f. Applying Theorem 1.11 to f(x) = A′ cos(ω′x) + B′ sin(ω′x) gives f(x) = M′ cos(ω′x + ϕ′), with maximum value M′ > 0. Since f has a unique maximum value, M = M′ > 0. We can conclude A^{2} + B^{2} = M^{2} = A^{2} + (B′)^{2}, so B′ = ±B. We also get cos(ωx + ϕ) = cos(ω′x + ϕ′) for all x. Taking the derivative of both sides gives −ω sin(ωx + ϕ) = −ω′ sin(ω′x + ϕ′). Since ω ≠ 0 and ω′ ≠ 0, these are non-constant functions with maximum values |ω| and |ω′|, respectively, which must be equal, so ω′ = ±ω.

If ω > 0 and ω′ > 0, ω′ = ω follows immediately, and the hypothesis becomes:

A cos(ωx) + B sin(ωx) = A cos(ωx) + B′ sin(ωx),

and the cosine terms cancel, so (B − B′) sin(ωx) is the constant function 0 and by Corollary 1.13, B − B′ = 0.

Definition 1.15. Given a function of the form f(x) = A cos(ωx) + B sin(ωx), which is not identically zero, the constant |ω| is uniquely defined, and we define the number \frac{|ω|}{2π} to be the \underline{frequency} of f(x).

If f is a non-zero constant function, its frequency is \frac{|ω|}{2π} = \frac{0}{2π} = 0 by Corollary 1.13, and if f is the constant function 0, its frequency is undefined.

The non-uniqueness from Theorem 1.14 follows from the “odd” identity for sin (Theorem 1.1). The functions f(x) = 4 cos(7x)+5 sin(7x) and f(x) = 4 cos(−7x)− 5 sin(−7x) are identically equal, even though the coefficients in front of the sin and in front of the x are different, but for non-constant functions, this is the only thing that can go wrong with uniqueness, and if we only use positive frequencies, then the coefficient B is uniquely determined.

Remark 1.16. The constant |ω| from Definition 1.15 is called the \underline{angular frequency} of f, although this is sometimes also abbreviated as just “frequency.”

2 Periodic Functions

Definition 2.1. Given f(x) with domain ℝ, if there is a number P > 0 so that f satisfies the identity

f(x + P) = f(x)

for all x ∈ ℝ, then f is \underline{periodic}, with \underline{period} P.

Using this definition, the period is not unique: if f has period P, it is also true that f has period 2P, 3P, etc., and it is possible there are others.

Example 2.2. For any P > 0, a trigonometric function of the form A cos(\frac{2π}{P} x) is periodic with period P.

Example 2.3. For any ω > 0, the function A cos(ωx) + B sin(ωx) is periodic with period P = \frac{2π}{ω} (the reciprocal of the frequency).

Example 2.4. For any P > 0 and integer k, the function A cos(k \frac{2π}{P} x)+B sin(k \frac{2π}{P} x) is periodic with period \frac{P}{k}. It is also periodic with period P.

3 Trigonometric polynomials

At this point we fix a number P > 0 and call it the “fundamental period.”

Definition 3.1. A function f(x) is a \underline{trigonometric polynomial} means: there is a natural number n and there are real numbers A_{0}, A_{1}, A_{2}, …, A_{n} and B_{1}, B_{2}, …, B_{n} so that for all x ∈ ℝ,

f(x) = (∑_{k=0}^{n} A_{k} cos(k \frac{2π}{P} x)) + (∑_{k=1}^{n} B_{k} sin(k \frac{2π}{P} x)) .  (1)

A trigonometric polynomial can be written:

f(x) = A_{0} + A_{1} cos(\frac{2π}{P} x) + A_{2} cos(2\frac{2π}{P} x) + … + A_{n} cos(n\frac{2π}{P} x)

+B_{1} sin(\frac{2π}{P} x) + B_{2} sin(2\frac{2π}{P} x) + … + B_{n} sin(n\frac{2π}{P} x).

As in Example 2.4, every term cos(k \frac{2π}{P} x) has period P:

cos(k \frac{2π}{P} (x + P)) = cos(k \frac{2π}{P} x + k · 2π) = cos(k \frac{2π}{P} x),

using the facts that k is an integer and that cos has period 2π. Similarly, the sin(k \frac{2π}{P} x) terms also have period P. If A_{k} ≠ 0, the term A_{k} cos(k \frac{2π}{P} x) has fre-

quency \frac{|k \frac{2π}{P} |}{2π} = \frac{k}{P}, and if B_{k} ≠ 0, the term B_{k} sin(k \frac{2π}{P} x) also has frequency \frac{k}{P}. Since every term in (1) has period P, so does the total sum, f(x).

So, a trigonometric polynomial (1) can be compared with the usual kind of polynomial,

p(x) = ∑_{k=0}^{n} a_{k}x^{k} = a_{0} + a_{1}x + a_{2}x^{2} + … + a_{n}x^{n} :

They both have finitely many terms with real coefficients, starting with a constant term. After the constant term, a polynomial has a list of powers of x: x^{1}, …, x^{n}, but a trigonometric polynomial has sin and cos terms with a list of frequencies: \frac{1}{P} , \frac{2}{P} , …, \frac{n}{P}, which are all multiples of the lowest frequency \frac{1}{P}.

Using Theorem 1.11, for each frequency, we get an amplitude:

A_{k} cos(k \frac{2π}{P} x) + B_{k} sin(k \frac{2π}{P} x) = C_{k} cos(k \frac{2π}{P} x + ϕ_{k}),

where C_{k} = \sqrt{A_{k}^{2} + B_{k}^{2}} ≥ 0, and there is also a different number ϕ_{k} for each frequency \frac{k}{P}. The trigonometric polynomial can be written

f(x) = A_{0} + ∑_{k=1}^{n} C_{k} cos(k \frac{2π}{P} x + ϕ_{k}).

Here are a few examples of periodic functions that happen to be equal to trigonometric polynomials.

Example 3.2. The function cos^{2}(x) is periodic with period P = 2π, but it is not written in the trigonometric polynomial form — which uses only sines and cosines without any exponents other than 0 and 1. However, using a double-angle identity, we get:

cos^{2}(x) = \frac{1}{2} + \frac{1}{2} cos(2x),

so A_{0} = \frac{1}{2}, A_{1} = 0, A_{2} = \frac{1}{2}, and all the B_{k} coefficients are 0.

Example 3.3. The function cos^{3}(x) is periodic with period P = 2π, and there is a trigonometric identity:

cos^{3}(x) = \frac{3}{4} cos(x) + \frac{1}{4} cos(3x),

so the coefficients are A_{0} = 0, A_{1} = \frac{3}{4}, A_{2} = 0, A_{3} = \frac{1}{4}.

Example 3.4. In fact, for any combination of powers of sin and cos, there are trigonometric identities making it equal to a trigonometric polynomial. An easy example is sin^{2}(x)+cos^{2}(x), since the constant function 1 counts as a trigonometric polynomial.

Example 3.5. Let f(x) = e^{ix}, which takes real input x and gives a complex number output. The function f is periodic, with period 2π:

e^{i(x+2π)} = e^{ix+2πi} = e^{ix}e^{2πi} = e^{ix} = f(x),

using the rules for exponents and the fact that e^{2πi} is the real number 1. There is a trigonometric identity, “Euler’s Formula,” which says this periodic function is a trigonometric polynomial with complex coefficients:

e^{ix} = cos(x) + i sin(x).

Every trigonometric polynomial is periodic with period P and differentiable (and therefore continuous) on all of ℝ. Is every periodic, differentiable function a trigonometric polynomial? No, far from it — the above examples are, of course, cooked up to have this special property. If you draw a random graph on an interval of length P, the odds are pretty slim that there is some trigonometric identity that makes your graph identically equal to a finite sum of sines and cosines with frequencies that are multiples of \frac{1}{P}.

However, … the odds are better that we can find a good approximation to any periodic function (or any function defined on an interval [a, b]) by some trigonometric polynomial. We might even be able to think of a sequence of increasingly close approximations. This should sound familiar from Taylor polynomial approximations in calculus…

4 Fourier Coefficients

Given all the coefficients of a trigonometric polynomial f(x), it is easy to plot a graph of f(x). The reverse problem is: given the graph of f(x), can we find its coefficients? The answer to this question is the start of “Fourier Analysis.” When we use the following integral methods to find the coefficients of a periodic function, we’ll call them “Fourier coefficients.” The process that takes an input function f and gives as output a pair of coefficient sequences (A_{0}, A_{1}, A_{2}, …), (B_{1}, B_{2}, …) is a linear transformation that we’ll call the “Fourier transform.”

Theorem 4.1. Assume f(x) is equal to a trigonometric polynomial with period P > 0:

f(x) = \frac{A_{0}}{2} + ( ∑_{m=1}^{n} A_{m} cos(m\frac{2π}{P} x)) + ( ∑_{m=1}^{n} B_{m} sin(m\frac{2π}{P} x)) .

Then the coefficients satisfy the following identities:

A_{k} = \frac{2}{P} ∫_{0}^{P} f(x) cos(k \frac{2π}{P} x)dx
B_{k} = \frac{2}{P} ∫_{0}^{P} f(x) sin(k \frac{2π}{P} x)dx

Proof. The integrals exist because f, cos, and sin are continuous on the closed interval [0, P]. More specifically, we can use the following integral formulas, for k, m = 0, 1, 2, 3, . . ..

∫_{0}^{P} cos(k \frac{2π}{P} x) cos(m\frac{2π}{P} x)dx = ∫_{0}^{P} \frac{1}{2} (cos((k + m)\frac{2π}{P} x) + cos((k − m)\frac{2π}{P} x))

= \{ \begin{matrix}0 & if k ≠ m \\ \frac{P}{2} & if k = m > 0 \\ P & if k = m = 0 \end{matrix} .

∫_{0}^{P} sin(k \frac{2π}{P} x) sin(m\frac{2π}{P} x)dx = ∫_{0}^{P} \frac{1}{2} (cos((k − m)\frac{2π}{P} x) + cos((k + m)\frac{2π}{P} x))

= \{ \begin{matrix}0 & if k ≠ m \\ \frac{P}{2} & if k = m > 0 \\ 0 & if k = m = 0 \end{matrix} .

∫_{0}^{P} cos(k \frac{2π}{P} x) sin(m\frac{2π}{P} x)dx = ∫_{0}^{P} \frac{1}{2} (sin((k + m)\frac{2π}{P} x) − sin((k − m)\frac{2π}{P} x))
= 0.

The key step in these integral formulas is the use of the trigonometric identities from Corollaries 1.6, 1.7, 1.8. The formulas for A_{k} and B_{k} follow: integrating f times the cosine with frequency \frac{k}{P} will give a sum of terms indexed from m = 0 to m = n, all of which are 0 except when m = k. The \frac{2}{P} coefficient is there to cancel the \frac{P}{2} that shows up in the integral formulas, although to be able to use the same formula for A_{0} that we do for all the other A_{k}, we had to introduce an extra \frac{1}{2} in the beginning.

Remark 4.2. All of the above definite integrals ∫_{0}^{P} in the Theorem and its proof could be shifted to an interval ∫_{−P/2}^{P/2} without changing their value (by the periodic property of the functions being integrated). The textbook’s notation in [5] Chapter 10, considers functions with period P = 2L and integrals ∫_{−L}^{L}, so the coefficient \frac{2}{P} in the above formulas for A_{k} and B_{k} becomes \frac{2}{2L} = \frac{1}{L}.

The next Theorem starts with very few conditions on a function f — only that f is continuously differentiable on the domain ℝ and that it is periodic, but we get a surprisingly strong conclusion. We don’t expect that f is a trigonometric polynomial, but it turns out that it in a precise sense, it is a limit of trigonometric polynomials, and the coefficients are given by the same integral formulas as the previous Theorem. This limit is called a “trigonometric series,” or “Fourier series,” or the “Fourier expansion” of the function f(x).

Theorem 4.3. Let f(x) be periodic with period P > 0, and differentiable on ℝ, and suppose its derivative f′(x) is continuous on ℝ. Then, for k = 0, 1, 2, 3, …, the following integrals exist:

A_{k} = \frac{2}{P} ∫_{0}^{P} f(x) cos(k \frac{2π}{P} x)dx
B_{k} = \frac{2}{P} ∫_{0}^{P} f(x) sin(k \frac{2π}{P} x)dx

and for any real x, the following sequence is convergent, with limit f(x):

f(x) = lim_{n→∞} [\frac{A_{0}}{2} + ( ∑_{m=1}^{n} A_{m} cos(m\frac{2π}{P} x)) + ( ∑_{m=1}^{n} B_{m} sin(m\frac{2π}{P} x))] .

The proof is available in books on Fourier analysis. In fact, the hypothesis can be weakened further, with a conclusion that is almost as good.

Theorem 4.4. Let f(x) be periodic with period P > 0, and suppose f′(x) exists and is continuous at every point in ℝ except for finitely many points p_{1}, …, p_{q} in [0, P), and their repeats, p_{t} + NP, for integer N, where f and f′ have the property that their one-sided limits exist, but are not necessarily equal. Then, for k = 0, 1, 2, 3, …, the following integrals exist:

A_{k} = \frac{2}{P} ∫_{0}^{P} f(x) cos(k \frac{2π}{P} x)dx
B_{k} = \frac{2}{P} ∫_{0}^{P} f(x) sin(k \frac{2π}{P} x)dx

and for any real x except p_{t} + NP, the following sequence is convergent, with limit f(x):

f(x) = lim_{n→∞} [\frac{A_{0}}{2} + ( ∑_{m=1}^{n} A_{m} cos(m\frac{2π}{P} x)) + ( ∑_{m=1}^{n} B_{m} sin(m\frac{2π}{P} x))] .

At each of the points c = p_{t} + NP, the sequence is still convergent, with limit

\frac{1}{2} ( lim_{x→c^{+}} f(x) + lim_{x→c^{−}} f(x)) .

5 A Fourier Transform for non-periodic functions

The advantages of Theorems 4.1, 4.3, and 4.4 are that they are easy to use, and give a nice sequence of coefficients A_{k}, B_{k} for a wide class of periodic functions f(x). The integrals can be calculated exactly if we have a formula for f, or they can be approximated if we have only a finite collection of sample points on the graph of f.

The disadvantages of these theorems are that they require we know the exact period P of f, which is equivalent to knowing its fundamental frequency \frac{1}{P}. In Theorem 4.1, we are also making the assumption that all the frequencies that appear are exact multiples of \frac{1}{P}. In practice, most functions f that occur from physical measurements are not periodic, like the decaying mechanical oscillations, or the non-repetitive characteristics of spoken words. Even with physical phenomena which we would like to model with periodic functions, like the tone of a tuning fork, a real-world experiment will record some frequencies which are not mathematically precise multiples of the fundamental frequency.

One solution to these problems is to try to express f as a combination of all possible real number (non-negative) frequencies, not just integer multiples of some fundamental frequency. That way, the Fourier transform will not just give a sequence of amplitudes, depending on corresponding integers, but an amplitude function, which depends on a continuous range of frequencies. The infinite sum from m = 1 … ∞ in Theorems 4.3 and 4.4 becomes an improper integral from m = 0 … ∞. The formula for the amplitude function is given by Theorem 5.1, which is analogous to Theorem 4.3.

The hypothesis on the integral of |f| in the Theorem is a way to express the requirement that the function f(x) decay to 0 for x → ∞ — this excludes most periodic functions, where we can apply Theorems 4.3 and 4.4 instead, but includes functions from many physically realistic models (e.g., processes with exponential decay) and practically occuring data sets (e.g., where we know f for a finite sampling of points in some time interval and assume f = 0 outside the interval).

Theorem 5.1. Let f(x) be differentiable on ℝ, and suppose its derivative f′(x) is continuous on ℝ, and the improper integral ∫_{−∞}^{∞} |f(x)|dx is convergent. Then, for 0 ≤ k ∈ ℝ, the following integrals exist:

A(k) = \frac{1}{π} ∫_{−∞}^{∞} f(x) cos(kx)dx
B(k) = \frac{1}{π} ∫_{−∞}^{∞} f(x) sin(kx)dx

and for any x in ℝ, the following improper integral is convergent, with limit f(x):

f(x) = ∫_{0}^{∞} [A(m) cos(mx) + B(m) sin(mx)] dm.

The amplitude as a function of m is C(m) = \sqrt{(A(m))^{2} + (B(m))^{2}}.

In addition to the textbook [5], here is a list of reference books at a college level; they are available in Helmke Library.

References

[1] G. Arfken, Mathematical Methods for Physicists, Academic Press.

[2] R. Churchill and J. Brown, Fourier Series and Boundary Value Problems, McGraw-Hill.

[3] P. Falstad, Fourier Series Applet, http://falstad.com/fourier/

[4] T. Körner, Fourier Analysis, Cambridge.

[5] R. K. Nagle, E. Saff, and A. Snider, Fundamentals of Differential Equations and Boundary Value Problems, Pearson.