BetaFree coursewareRewritten from MIT OpenCourseWareCC BY-NC-SA 4.0
Open CosmologyPhysics & cosmology, from high school to a graduate year

Introduction to Fourier series

A reasonable function with period 2π can be written as a Fourier series c₀ + Σ(aₙ cos nt + bₙ sin nt). Since the responses to cos nt and sin nt are known, superposition then gives the response to any periodic input. The coefficients come from the orthogonality relations: any two distinct functions among sin nt and cos mt have ∫ from −π to π of their product equal to 0, while ∫ sin²nt = ∫ cos²nt = π for n ≥ 1. These follow from the differential equation u″ + n²u = 0 by integrating by parts. Multiplying the series by cos nt and integrating gives aₙ = (1/π)∫f cos nt dt, and likewise bₙ; the constant term is (1/2π)∫f dt, or a₀/2. The square wave, −1 then +1, has the series (4/π)(sin t + sin 3t/3 + sin 5t/5 + …).

You need this first

Full reading path (28 pages)
  1. The derivative: slope of the tangent line and rate of change (18.01)
  2. Limits and continuity (18.01)
  3. Derivatives of sine and cosine, and the product and quotient rules (18.01)
  4. The chain rule and higher derivatives (18.01)
  5. Implicit differentiation and the derivatives of inverse functions (18.01)
  6. Exponentials and logarithms: the number e and its derivatives (18.01)
  7. Linear and quadratic approximations (18.01)
  8. Curve sketching with the first and second derivative (18.01)
  9. Sketching strategy and maximum–minimum problems (18.01)
  10. More max–min, and related rates (18.01)
  11. A ring on a string, and Newton's method (18.01)
  12. The mean value theorem and inequalities (18.01)
  13. Differentials and antiderivatives (18.01)
  14. Differential equations and separation of variables (18.01)
  15. Direction fields, isoclines and integral curves (18.03)
  16. Euler's method and better numerical methods (18.03)
  17. First-order linear equations and integrating factors (18.03)
  18. Substitutions: scaling, Bernoulli and homogeneous equations (18.03)
  19. Autonomous equations, critical points and stability (18.03)
  20. Complex numbers and complex exponentials (18.03)
  21. Constant coefficients: steady state, superposition and sinusoidal input (18.03)
  22. Combining sine and cosine; models for first-order linear equations (18.03)
  23. Second-order linear equations with constant coefficients (18.03)
  24. Complex characteristic roots and damped oscillations (18.03)
  25. Linear operators, the Wronskian and normalized solutions (18.03)
  26. Inhomogeneous equations, particular solutions and stability (18.03)
  27. Particular solutions: the exponential input theorem (18.03)
  28. Resonance and beats (18.03)
On this page · 5 sections
  1. Why Fourier series
  2. Orthogonality
  3. Finding the coefficients
  4. The square wave
  5. Summary

So far the inputs have been very special: exponentials, sines and cosines (transcript, p. 1). Fourier series show that they are not as special as they look. This lecture and the next two cover them (p. 1).

Why Fourier series#

Any reasonable function f(t)f(t) with period 2π2\pi, even one with some jumps, can be written as an infinite sum of sines and cosines (transcript, pp. 1–2):

Fourier series
f(t)=c0+∑n=1∞(ancos⁡nt+bnsin⁡nt)f(t) = c_0 + \sum_{n=1}^{\infty}\left(a_n\cos nt + b_n\sin nt\right)
In words

f(t) equals c nought plus the sum from n equals 1 to infinity of the quantity a sub n cos n t plus b sub n sine n t

(2π2\pi need only be a period: sin⁡2t\sin 2t also has it.) Why does this help with y′′+Ay′+By=f(t)y'' + Ay' + By = f(t)? For each input cos⁡nt\cos nt or sin⁡nt\sin nt we know how to find the response, by complexifying (p. 2). Because the equation is linear, the input ancos⁡nta_n\cos nt has ana_n times that response, and adding up, the response to ff is the same combination of the responses to the cosines and sines; the constant term counts as cos⁡0t\cos 0t (pp. 2–3). That is the superposition principle. The programme: find the Fourier series of the input, then add up the known responses (p. 3). Its main payoff will be a new view of resonance: some terms of the input's series can be picked out and produce unexpectedly large responses (p. 4).

Orthogonality#

Two functions u(t)u(t) and v(t)v(t), each with period 2π2\pi, are orthogonal on [−π,π][-\pi, \pi] if (transcript, pp. 4–5)

Orthogonality
∫−ππu(t) v(t) dt=0\int_{-\pi}^{\pi}u(t)\,v(t)\,dt = 0
In words

the integral from minus pi to pi of u(t) v(t) d t equals 0

The word really is connected with orthogonal vectors in 18.02 (p. 5). The theorem that makes Fourier series work (p. 5): any two distinct functions from the collection sin⁡nt\sin nt (n≥1n \ge 1) and cos⁡mt\cos mt (m≥0m \ge 0) are orthogonal on [−π,π][-\pi, \pi]. So ∫−ππsin⁡3tcos⁡4t dt=0\int_{-\pi}^{\pi}\sin 3t\cos 4t\,dt = 0, and so is ∫−ππsin⁡3tsin⁡60t dt\int_{-\pi}^{\pi}\sin 3t\sin 60t\,dt. A function with itself cannot give 0, since a square is positive; instead, for n≥1n \ge 1 (p. 6)

Normalization
∫−ππsin⁡2nt dt=∫−ππcos⁡2nt dt=π\int_{-\pi}^{\pi}\sin^2 nt\,dt = \int_{-\pi}^{\pi}\cos^2 nt\,dt = \pi
In words

the integral from minus pi to pi of sine squared n t d t equals the integral from minus pi to pi of cos squared n t d t equals pi

The relations can be proved with trigonometric identities or with complex exponentials, but the lecture uses a third method, through the differential equation, because it is the one that generalizes to the many other families of orthogonal functions (pp. 6–7).

Proof via the ODE (pp. 7–11). Both sin⁡nt\sin nt and cos⁡nt\cos nt satisfy (p. 7)

The shared equation
u′′+n2u=0u'' + n^2u = 0
In words

u double prime plus n squared u equals 0

Let unu_n and vmv_m be any two of the functions, m≠nm \ne n, so un′′=−n2unu_n'' = -n^2u_n and vm′′=−m2vmv_m'' = -m^2v_m (pp. 7–8). Integrate the unsymmetric expression ∫un′′vm\int u_n''v_m by parts, "the most important theoretical method" of 18.01 (p. 8):

Integration by parts
∫−ππun′′ vm dt=[un′ vm]−ππ−∫−ππun′ vm′ dt\int_{-\pi}^{\pi}u_n''\,v_m\,dt = \Big[u_n'\,v_m\Big]_{-\pi}^{\pi} - \int_{-\pi}^{\pi}u_n'\,v_m'\,dt
In words

the integral from minus pi to pi of u sub n prime prime v sub m d t equals ( u sub n prime v sub m ) sub minus pi to the power pi minus the integral from minus pi to pi of u sub n prime v sub m prime d t

The bracket is always 0: a sine vanishes at ±π\pm\pi, and a product of cosines, being even, has the same value at both ends (pp. 8–9). What remains, −∫un′vm′-\int u_n'v_m', is symmetric in uu and vv. But using the equation, ∫un′′vm=−n2∫unvm\int u_n''v_m = -n^2\int u_nv_m, which favours uu (p. 9). Doing the same with the roles exchanged gives −m2∫unvm-m^2\int u_nv_m for the same quantity, and since m≠nm \ne n (p. 10)

Conclusion
−n2∫−ππunvm dt=−m2∫−ππunvm dt⟹∫−ππunvm dt=0-n^2\int_{-\pi}^{\pi}u_nv_m\,dt = -m^2\int_{-\pi}^{\pi}u_nv_m\,dt \quad\Longrightarrow\quad \int_{-\pi}^{\pi}u_nv_m\,dt = 0
In words

minus n squared the integral from minus pi to pi of u sub n v sub m d t equals minus m squared the integral from minus pi to pi of u sub n v sub m d t which gives the integral from minus pi to pi of u sub n v sub m d t equals 0

Something both symmetric and not symmetric must be zero (p. 10). One case is left: cos⁡ntsin⁡nt\cos nt\sin nt, with the same nn. It is 12sin⁡2nt\frac{1}{2}\sin 2nt, whose integral over a whole period is 0 (p. 11).

Finding the coefficients#

To find ana_n, multiply the whole series by cos⁡nt\cos nt and integrate from −π-\pi to π\pi (transcript, pp. 11–12). By orthogonality every term vanishes except an∫cos⁡2nt dt=πana_n\int\cos^2nt\,dt = \pi a_n (p. 12). The same works for bnb_n (pp. 12–13):

Fourier coefficients
an=1π∫−ππf(t)cos⁡nt dt,bn=1π∫−ππf(t)sin⁡nt dt,n≥1a_n = \frac{1}{\pi}\int_{-\pi}^{\pi}f(t)\cos nt\,dt, \qquad b_n = \frac{1}{\pi}\int_{-\pi}^{\pi}f(t)\sin nt\,dt, \qquad n \ge 1
In words

a sub n equals 1 over pi, times the integral from minus pi to pi of f(t) cos n t d t, b sub n equals 1 over pi, times the integral from minus pi to pi of f(t) sine n t d t, n is greater than or equal to 1

The constant term is an exception, a source of gross errors (p. 13). Multiply by 1 (that is, cos⁡0t\cos 0t) and integrate: ∫−ππf dt=2πc0\int_{-\pi}^{\pi}f\,dt = 2\pi c_0, because cos⁡nt\cos nt and sin⁡nt\sin nt integrate to 0 over a full period (p. 13). So c0=12π∫−ππf dtc_0 = \frac{1}{2\pi}\int_{-\pi}^{\pi}f\,dt: putting n=0n = 0 into the ana_n formula gives twice it. Hence the usual convention (p. 14):

Constant term
c0=a02=12π∫−ππf(t) dtc_0 = \frac{a_0}{2} = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(t)\,dt
In words

c nought equals a nought over 2 equals 1 over the quantity 2 pi, times the integral from minus pi to pi of f(t) d t

Either learn one formula for all the ana_n and write the constant as a02\frac{a_0}{2}, or learn a separate formula for c0c_0 (p. 14).

The square wave#

Take f=−1f = -1 on (−π,0)(-\pi, 0) and f=+1f = +1 on (0,π)(0, \pi), continued periodically: an odd function, equally above and below the axis (transcript, pp. 14–15). Its ana_n turn out to be 0 (p. 15). For bnb_n, split the integral where ff jumps (p. 15):

Square wave coefficients
bn=1π(∫−π0(−sin⁡nt) dt+∫0πsin⁡nt dt)=2nπ (1−cos⁡nπ)=4nπ for odd n,0 for even nb_n = \frac{1}{\pi}\left(\int_{-\pi}^{0}(-\sin nt)\,dt + \int_{0}^{\pi}\sin nt\,dt\right) = \frac{2}{n\pi}\,(1 - \cos n\pi) = \frac{4}{n\pi} \text{ for odd } n, \quad 0 \text{ for even } n
In words

b sub n equals 1 over pi, times the quantity the integral from minus pi to 0 of (- sine n t) d t plus the integral from 0 to pi of sine n t d t, equals 2 over the quantity n pi, times the quantity 1 minus cos n pi, equals 4 over the quantity n pi, for odd n, 0 for even n

since cos⁡nπ\cos n\pi is −1-1 for odd nn and +1+1 for even nn. (The lecture, sketching this in the last minutes, drops the factor 1π\frac{1}{\pi} and says "four over n".) So

Square wave series
f(t)=4π(sin⁡t+sin⁡3t3+sin⁡5t5+⋯ )f(t) = \frac{4}{\pi}\left(\sin t + \frac{\sin 3t}{3} + \frac{\sin 5t}{5} + \cdots\right)
In words

f(t) equals 4 over pi, times the quantity sine t plus sine 3 t over 3 plus sine 5 t over 5 plus and so on

Partial sums of the square wave's Fourier series, computed from (4/π) Σ sin(nt)/n over odd n: with more terms the sum hugs the square wave more closely, except for an overshoot next to each jump.
Worked example

Two more series

Find the Fourier series of (a) the half-wave f=0f = 0 on (−π,0)(-\pi, 0), f=1f = 1 on (0,π)(0, \pi), and (b) f(t)=∣t∣f(t) = |t|, both on (−π,π)(-\pi, \pi) and continued with period 2π2\pi. (c) Check (b) at t=0t = 0, using 1+19+125+⋯=π281 + \frac{1}{9} + \frac{1}{25} + \cdots = \frac{\pi^2}{8}.

(a) A half-wave

It is half the square wave plus 12\frac{1}{2}, so no new integrals are needed: f=12+2π(sin⁡t+sin⁡3t3+sin⁡5t5+⋯ )f = \frac{1}{2} + \frac{2}{\pi}\left(\sin t + \frac{\sin 3t}{3} + \frac{\sin 5t}{5} + \cdots\right). Directly: the constant term is 12π∫0πdt=12\frac{1}{2\pi}\int_0^{\pi}dt = \frac{1}{2}, and bn=1π∫0πsin⁡nt dt=1−cos⁡nπnπb_n = \frac{1}{\pi}\int_0^{\pi}\sin nt\,dt = \frac{1 - \cos n\pi}{n\pi}.

(b) A triangle wave

∣t∣sin⁡nt|t|\sin nt is odd, so every bn=0b_n = 0. The constant term is 12π∫−ππ∣t∣ dt=π2\frac{1}{2\pi}\int_{-\pi}^{\pi}|t|\,dt = \frac{\pi}{2}, and an=2π∫0πtcos⁡nt dt=2πn2((−1)n−1)a_n = \frac{2}{\pi}\int_0^{\pi}t\cos nt\,dt = \frac{2}{\pi n^2}\left((-1)^n - 1\right), which is −4πn2-\frac{4}{\pi n^2} for odd nn and 0 for even nn. So ∣t∣=π2−4π(cos⁡t+cos⁡3t9+cos⁡5t25+⋯ )|t| = \frac{\pi}{2} - \frac{4}{\pi}\left(\cos t + \frac{\cos 3t}{9} + \frac{\cos 5t}{25} + \cdots\right).

(c) A check

At t=0t = 0: π2−4π⋅π28=π2−π2=0=∣0∣\frac{\pi}{2} - \frac{4}{\pi}\cdot\frac{\pi^2}{8} = \frac{\pi}{2} - \frac{\pi}{2} = 0 = |0|.

Summary#

  • A periodic input is a sum of sines and cosines; by superposition its response is the same sum of known responses.
  • Distinct functions among sin⁡nt\sin nt, cos⁡mt\cos mt are orthogonal on [−π,π][-\pi, \pi]; squares integrate to π\pi. A proof uses only u′′+n2u=0u'' + n^2u = 0 and integration by parts.
  • an=1π∫fcos⁡nta_n = \frac{1}{\pi}\int f\cos nt, bn=1π∫fsin⁡ntb_n = \frac{1}{\pi}\int f\sin nt, constant term a02\frac{a_0}{2}.
  • Square wave: 4π∑n oddsin⁡ntn\frac{4}{\pi}\sum_{n \text{ odd}}\frac{\sin nt}{n}.

Symbols on this page

Show the 30 symbols used here
π\pi pi.
The ratio of a circle's circumference to its diameter, π ≈ 3.14159. Say it: “pi”.
∞\infty infinity.
Infinity: larger than any number. Say it: “infinity”.
≥\ge greater than or equal.
Is greater than or equal to. Say it: “is greater than or equal to”.
≠\neq not equal.
Is not equal to. Say it: “is not equal to”.
⇒\Rightarrow implies.
Implies: what follows is a consequence of what came before. Say it: “which gives”.
±\pm plus or minus.
Plus or minus: both signs, or an uncertainty (67.3 ± 1.2). Say it: “plus or minus”.
⋅\cdot dot.
Times (multiplication). Between two vectors: the dot product. Say it: “times”.
∫\int integral.
Integral: the sum of infinitely many small pieces, such as the area under a curve. Say it: “the integral of”.
∑\sum sum.
Sum: add up the terms over the range written below and above. Say it: “the sum of”.
sin⁡\sin sine.
Sine of an angle. Say it: “sine”.
cos⁡\cos cosine.
Cosine of an angle. Say it: “cos”.
yy y.
The response to the input f. Say it: “y”.
tt t.
The independent variable, usually time. Say it: “t”.
dd d.
The d of dt. Say it: “d”.
nn n.
A positive integer: the frequency of cos nt or sin nt. Say it: “n”.
mm m.
A second integer frequency, different from n. Say it: “m”.
ff f.
A periodic function (input) with period 2π. Say it: “f”.
vv v.
A second function with period 2π. Say it: “v”.
AA A.
The constant coefficient of y′. Say it: “capital A”.
BB B.
The constant coefficient of y. Say it: “capital B”.
y′y' y prime.
The derivative of y. Say it: “y prime”.
uu u.
A function with period 2π; in the proof, a solution of u″ + n²u = 0. Say it: “u”.
a0a_{0} a nought.
Twice the constant term: a₀/2 = (1/2π)∫f dt. Say it: “a nought”.
y′′y'' y double prime.
The second derivative of the response y. Say it: “y double prime”.
u′′u'' u double prime.
The second derivative of u. Say it: “u double prime”.
ana_{n} a n.
The Fourier cosine coefficient of cos nt. Say it: “a sub n”.
c0c_{0} c nought.
The constant term of a Fourier series. Say it: “c nought”.
bnb_{n} b sub n.
The Fourier sine coefficient of sin nt. Say it: “b sub n”.
unu_{n} u sub n.
One of the functions sin nt, cos nt (frequency n). Say it: “u sub n”.
vmv_{m} v sub m.
Another of the functions sin mt, cos mt (frequency m ≠ n). Say it: “v sub m”.

Tap or click a symbol in a formula to see the same explanation. All symbols: symbols and notation.

Words on this page

Show the 27 words used here

New here

orthogonal.
At right angles; more generally, of two vectors or functions, having a dot product, or an integral of their product, of zero.
symmetric.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged.

Also used

p..
Page, in a reference to a source; pp. means pages, as in pp. 3–5.
Fourier series.
A way of writing a repeating function as a sum of sines and cosines whose frequencies are whole-number multiples of one frequency. Explained in Normal modes of a string and Fourier series.
period.
The time one full cycle of a repeating motion takes, such as one turn round a circle or one swing of a pendulum. Explained in Uniform circular motion: centripetal acceleration, period and frequency.
complexify.
To replace a real problem by a complex one, such as a cosine by an exponential, whose real or imaginary part gives the answer. Explained in Constant coefficients: steady state, superposition and sinusoidal input.
linear.
The property that sums and multiples of solutions are again solutions, so the responses to separate inputs simply add. Explained in First-order linear equations and integrating factors.
superposition.
Adding effects: the total force, field or wave from several sources is the sum of what each would give alone. Explained in Superposition and standing waves.
resonance.
The large response of an oscillating system when it is pushed at, or close to, its own natural frequency. Explained in Resonance.
vector.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.
theorem.
A statement that has been proved true, step by step, from definitions and earlier results. Explained in Limits and continuity.
differential equation.
An equation that links an unknown function to its derivatives; solving it means finding the function. Explained in Circular motion dynamics: worked problems.
proof.
A chain of reasoning showing beyond doubt that a statement follows from definitions and results already known. Explained in Limits and continuity.
ODE.
Ordinary differential equation: an equation linking a function of one variable to its derivatives.
integration.
Finding an integral: adding up very many small pieces, or finding an antiderivative. Explained in Differentials and antiderivatives.
integral.
A sum of very many very small pieces, such as the area under a graph; it undoes taking a derivative. Explained in Rates of change and area under a graph.
periodic.
Repeating itself exactly after a fixed interval of time or distance, called the period. Explained in Angles, radians and trigonometry.
odd function.
A function that changes sign when x does, f(−x) = −f(x), such as x³ or sin x. Explained in Fourier series: even and odd functions, convergence and other periods.
integration by parts.
A rule for integrating a product of two functions, ∫ u dv = uv − ∫ v du, which comes from the product rule. Explained in Integration by parts and reduction formulas.

Academic

transcript.
A written record of exactly what was said in a recorded lecture, word for word.
payoff.
The useful result that makes earlier effort worthwhile.
via.
By way of; through, or by means of.
satisfy.
To make an equation or condition true.
vanish.
To become zero; sometimes, of a fixed point or solution, to stop existing.
error.
The difference between a measured or computed value and the true one; often how large that difference may be.
hence.
For this reason; as a result of what was just said.
convention.
An agreed choice, such as which direction counts as positive, that could have been made differently.

Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).

Where this leads

In cosmology

31 more cosmology pages that build on this

Pages that build on this

Practise

Check your understanding

  1. What is ∫−ππsin⁡3tcos⁡4t dt\int_{-\pi}^{\pi}\sin 3t\cos 4t\,dt?
  2. Which formula gives the Fourier coefficient ana_n (n≥1n \ge 1)?
  3. The square wave (−1-1 on (−π,0)(-\pi, 0), +1+1 on (0,π)(0, \pi)) has which sine coefficients?
0 of 3 answered

Flashcards

1 / 3