Differential EquationsFourier Series and Boundary Value Problems2 of 6
Fourier Series and Boundary Value Problems · 2
Fourier Series
We know how to solve a differential equation when the driving force is a pure sine or cosine wave, and we need a way to turn any repeating wave, even one with flat tops, sharp corners, or jumps, into a sum of pure sines and cosines.
1
Building Periodic Waves from Sines and Cosines
Suppose we want to solve y′′+10y=f(t) when the driving force f(t) is a repeating wave like a square wave or a sawtooth wave. We can rebuild f(t) by adding a constant shift to pure cosine and sine waves that share the same period.
Building Periodic Waves from Sines and Cosines
For a wave f(t) that repeats every 2π on [−π,π], only waves with whole-number frequencies n=1,2,3,… complete a whole number of cycles inside 2π and repeat in step with f(t):
f(t)=vertical shiftC+1 cycle in 2πa1cos(t)+b1sin(t)+2 cycles in 2πa2cos(2t)+b2sin(2t)+3 cycles in 2πa3cos(3t)+b3sin(3t)+…
Because pure sine waves are always zero at t=0 and pure cosine waves always start at a top or bottom peak at t=0, shifting a wave of frequency n left or right to any other starting position requires mixing ancos(nt) and bnsin(nt) together.
Because cosine always has its peak or valley at t=0 and sine always equals zero at t=0, shifting a wave sideways takes a mix of both.
2
Finding the Coefficients by Averaging
Given a repeating wave f(t), we want to find the constant shift C and each wave coefficient an and bn in its series:
To isolate a single term like cos(3t), we multiply f(t) by cos(3t) and average over [−π,π].
Multiplying the fixed cosine wave by any other whole-cycle sine or cosine wave averages to zero across the interval, but when the two waves match, the average is one half.
Because every non-matching wave cancels out on average and a squared wave cos2(nt) or sin2(nt) averages to 21, multiplying both sides of the series by cos(nt) and averaging over one period leaves half of an:
Average of (f(t)cos(nt))=an⋅Average of (cos2(nt))=2an
Doubling that average gives the coefficient of cos(nt) or sin(nt) inside f(t). When a wave repeats on [−L,L] with full period 2L, rescaling the angle from nt to Lnπt fits the waves onto [−L,L] and averaging divides by the full width 2L:
On [−π,π], the half-period is L=π, so Lnπt simplifies to nt and L1 becomes π1. We write the constant term at the front as 2a0 so the formula for a0 uses the same L1 factor as an when n=0. Dividing by 2 in 2a0 gives back the true average height C.
3
Symmetry and the Square Wave Series
Now let's find the Fourier series for the 2π-periodic square wave that jumps between −1 and +1 on [−π,π]:
f(t)={−1,+1,−π<t<00<t<π
Symmetry and the Square Wave Series
Text solution
Drop the constant and cosine terms by odd symmetryBecause the square wave is flipped upside-down across the origin, it cannot contain a constant shift or any cosine waves, which are mirror images across the vertical axis:
C=2a0an=0,=0for all n
Double the sine integral on the right half [0,π]Since f(t) and sin(nt) are both odd, each one changes sign when t is replaced by −t, so their product f(t)sin(nt) has the same value at −t as at t. The two halves have the same average, so the average over [−π,π] equals the average over [0,π] where f(t)=1:
bn=π1∫−ππf(t)sin(nt)dt=π2∫0π1⋅sin(nt)dt
Count the sine arches on [0,π] for even and odd nOn [0,π],sin(nt) makes n arches of area n2 each. Even values of n give an equal number of positive and negative arches that cancel to 0, while odd values of n leave one extra positive arch of area n2:
bn=⎩⎨⎧0,π2⋅n2=nπ4,n=2,4,6,…n=1,3,5,…
Write out the odd sine seriesPutting together the odd frequencies gives the Fourier series for the square wave:
Let's see how adding more odd sine terms flattens the top and sharpens the corners into a square wave.
Each odd harmonic pushes out the sides and moves the middle back toward the flat top, flattening the round sine wave into a square wave.
4
The Triangle Wave and Integration by Parts
Next, let's find the Fourier series for a 4-periodic triangle wave on [−2,2] with half-period L=2:
f(t)=∣t∣on [−2,2]
Because the wave is the sloped line t on [0,2] rather than a flat constant, finding an requires integrating the product tcos(2nπt). We integrate a power of t times a wave using integration by parts, choosing u=t so taking the derivative turns it into du=dt:
∫udv=uv−∫vdu
The Triangle Wave and Integration by Parts
Text solution
Drop the sine terms by even symmetry and read off the average heightBecause f(t)=∣t∣ is a mirror image across the vertical axis, every sine coefficient is zero, and the line climbing straight from 0 to 2 has average height 1:
bnC=2a0=0for all n,=1(a0=2)
Double the cosine integral on [0,2] where ∣t∣=tBecause both ∣t∣ and cos(2nπt) are even, their product has the same integral on [−2,0] and [0,2]:
Integrate by parts and drop the sine boundary termChoosing u=t and dv=cos(2nπt)dt gives v=nπ2sin(2nπt), and the uv term is zero at t=2 (since sin(nπ)=0) and at t=0:
On a graph of a straight line like ∣t∣ from 0 to 2, you can see the average height C=1 right away, which is the actual number that goes at the front of the series. If you are asked separately for the coefficient a0, remember that a0=2C=2.
5
Driven Oscillators and Hidden Resonance
Now we can solve the differential equation y′′+10y=f(t) for a mass on a spring driven by the 2π-periodic square wave f(t):
y′′+10y=f(t)
Driven Oscillators and Hidden Resonance
Text solution
Replace the square wave f(t) with its Fourier seriesWriting the square wave as its sum of odd sine waves turns the right side into pure sine terms:
y′′+10y=π4sin(t)+3π4sin(3t)+5π4sin(5t)+…
Solve for the response to a single term bnsin(nt)Guessing yn(t)=Ansin(nt) brings out −n2 from the second derivative:
⟹An(−n2An+10An)sin(nt)=bnsin(nt)=10−n2bn
Add the individual responses togetherDividing each square-wave coefficient bn=nπ4 by 10−n2 gives the steady-state motion of the spring:
Even though the square wave flips slowly at the base frequency n=1, the sin(3t) term in the spring's motion (3π4) is three times as large as the sin(t) term (9π4). That happens because the n=3 frequency inside the square wave is right next to the spring's natural frequency 10≈3.16.
Watch how different terms in the square wave take turns dominating the motion as we change the spring's natural frequency.
Whenever the spring’s natural frequency gets close to one of the square wave’s odd harmonics, that tiny sine wave inside the square wave grows huge and takes over the spring’s motion.
Key concepts
To write the Fourier series of a 2L-periodic wave f(t) on [−L,L], we write it as its average height C=2a0 plus rescaled cosine and sine waves:
f(t)=2a0+n=1∑∞(ancos(Lnπt)+bnsin(Lnπt))
When not to integrate
If f(t) is already given as a finite sum of sines and cosines, such as f(t)=5−2cos(t)+4sin(3t), do not set up any integrals. You can read its coefficients right off the equation (C=2a0=5 so a0=10,a1=−2,b3=4, and all other an,bn=0), and the average of f(t) times any wave cos(nt) or sin(nt) over one period is half that wave's coefficient.
Check symmetry before integrating
Even wave (mirror image across the vertical axis, like ∣t∣ or t2): bn=0 for all n, and we double the remaining integrals on [0,L]:
Odd wave (flipped upside-down across the origin, like the ±1 square wave or t): a0=0 and an=0 for all n, leaving only sines doubled on [0,L]:
bn=L2∫0Lf(t)sin(Lnπt)dt
Shifted wave: If a wave becomes odd or even after removing its vertical shift (like a step wave between 0 and 2 with average height C=1), subtract C first and find the series for the centered wave.
Evaluating the integral on [0,L]
A flat constant step integrates directly, while a power like t or t2 times a wave uses integration by parts (∫udv=uv−∫vdu) with u=t or t2. At t=L, simplify using sin(nπ)=0 and cos(nπ)=(−1)n.
Driven oscillators (y′′+ω02y=f(t))
Replace f(t) with its Fourier series and solve term by term. Taking two derivatives of cos(Lnπt) or sin(Lnπt) brings out −(Lnπ)2, dividing each coefficient by ω02−(Lnπ)2. The term whose frequency Lnπ is closest to the natural frequency ω0 is amplified the most.
6
Practice
1
A 2π-periodic wave is already written as a finite sum of pure sines and cosines:
f(t)=3−4cos(t)+6sin(3t)+2cos(5t)
Without finding any antiderivatives, use the averaging method to find the exact values of: (a) 2π1∫−ππf(t)dt (b) 2π1∫−ππf(t)cos(3t)dt (c) 2π1∫−ππf(t)sin(3t)dt (d) the constant coefficient a0 in the standard formula f(t)=2a0+∑n=1∞(ancos(nt)+bnsin(nt)).
Each integral with 2π1 out front is the average over one period. Which term in f(t) doesn't average to zero when multiplied by the wave inside the integral, and what is the average of that squared wave?
(a)Over a full period [−π,π], every sine and cosine wave in f(t) averages to 0, leaving only the constant shift:
2π1∫−ππf(t)dt=3
(b)Multiplying f(t) by cos(3t) gives only products of different waves (including 6sin(3t)cos(3t)) because f(t) has no cos(3t) term, and every product of two different waves averages to 0:
2π1∫−ππf(t)cos(3t)dt=0
(c)Multiplying f(t) by sin(3t) makes every non-matching term average to 0 while the matching term 6sin2(3t) averages to 6⋅21. (Be careful not to answer b3=6: the coefficient formula b3=π1∫−ππf(t)sin(3t)dt has π1 out front, whereas this integral has 2π1 and asks for the average itself, 2b3.)
2π1∫−ππf(t)sin(3t)dt=6⋅21=3
(d)Because the constant term at the front of the standard series is 2a0=C=3 (don't write a0=3 without doubling C):
a0=6
2
A periodic voltage switch repeats every 6 seconds on [−3,3]:
f(t)={0,2,−3<t<00<t<3
Find its Fourier series and write out the constant term and the first three non-zero wave terms.
Find the average height C over [−3,3] first. If you subtract C from f(t), what familiar wave is left on [−3,3], and what is its half-period L?
Average height and centered waveOn [−3,3], the wave spends half the period at 0 and half at 2, so its average height is C=2a0=1 (with a0=2). Subtracting 1 leaves f(t)−1, which jumps between −1 on (−3,0) and +1 on (0,3). That is our odd square wave with an=0 for all n≥1 and bn=nπ4 for odd n.
Rescale the frequencies for L=3Because the full period is 2L=6, the half-period is L=3, so each angle rescales to 3nπt. (A common mistake is plugging the full period 6 in for L, which gives 6nπt, or forgetting to rescale nt altogether.)
Find the Fourier series for the 2π-periodic sawtooth wave f(t)=t on [−π,π], and write out the first three non-zero terms.
Check whether f(t)=t is even or odd to see whether the cosine or sine terms are zero, then double the remaining integral on [0,π] and choose u and dv for integration by parts.
Use odd symmetryBecause f(t)=t is odd on [−π,π],a0=0 and an=0 for all n, and the sine integral doubles on [0,π]:
bn=π2∫0πtsin(nt)dt
Integrate by partsWith u=t and dv=sin(nt)dt, we have du=dt and v=−n1cos(nt). (Be careful not to drop the minus sign when integrating sin(nt) to −n1cos(nt), which would flip every sign in the series to −2sin(t)+sin(2t)−32sin(3t)+….)
bn=π2([−ntcos(nt)]0π+∫0πncos(nt)dt)
Evaluate at the boundsThe remaining integral [n2sin(nt)]0π is zero because sin(nπ)=0, while the uv term at t=π uses cos(nπ)=(−1)n:
bn=π2(−nπcos(nπ))=−n2(−1)n=n2(−1)n+1
Write out the series for n=1,2,3,…
f(t)=2sin(t)−sin(2t)+32sin(3t)−…
4
Find the Fourier series for the 2π-periodic parabolic wave f(t)=t2 on [−π,π], and write out the constant term and the first three wave terms.
Be careful not to put a0=32π2 directly at the front of the series instead of 2a0=3π2.
Use the symmetry of t2 to see which coefficients are zero, find the average height C=2a0 separately from an, and use integration by parts twice on ∫0πt2cos(nt)dt so taking derivatives turns t2 into 2t and then 2.
Use even symmetry and find the constant termBecause f(t)=t2 is even on [−π,π],bn=0 for all n. Doubling the average height integral on [0,π] gives C=2a0:
Find the steady-state periodic response y(t) out to the first three wave terms, and identify which term n in the triangle wave is amplified the most by near-resonance.
Solve for the constant term and each cosine term separately. When you take two derivatives of cos(2nπt), what constant factor comes out in front?
Constant term responseGuessing y0=A0 for the constant driving term 1 gives 20A0=1, so A0=201.
Cosine response termsFor each term ancos(2nπt), guessing yn(t)=Ancos(2nπt) brings out −(2nπ)2=−4n2π2 from yn′′:
(20−4n2π2)An⟹An=an=20−4n2π2an
(Don't divide by 20−n2 by forgetting the chain-rule factor 2π inside cos(2nπt); using 20−n2 would give the wrong denominators and wrongly pick n=5 since 52=25 is close to 20.)
Combine the terms and compare denominatorsBecause the driving frequency 23π≈4.71 for n=3 is closest to the spring's natural frequency 20≈4.47 (making the denominator 20−49π2≈−2.21 closest to zero), the n=3 term is amplified the most: