How a function given only on an interval from 0 to L can be written as a series of sines alone or cosines alone, and how the choice affects the endpoints and the speed of convergence.
A guitar string is fixed at both ends and only exists between them. To describe its shape with waves you have a choice to make, because nothing outside the string tells you what the function should be there. Filling in the missing half by mirror symmetry gives a series with only sines or only cosines, and the two choices behave quite differently.
Key terms
Odd and even extensions
Definition Let f be defined on (0,L) with L>0. The odd extension fo is the function with period 2L given on (−L,L) by
fo(x)=⎩⎨⎧f(x),0,−f(−x),0<x<L,x=0,−L<x<0,
and fo(±L)=0. If f is defined on [0,L], the even extension fe is the function with period 2L given by fe(x)=f(∣x∣) for −L≤x≤L. This is consistent because fe(−L)=fe(L)=f(L).
In plain words For the odd extension you copy the graph into the left half turned upside down. For the even extension you copy it as a mirror image. Then you repeat the picture forever in both directions.
Example Take f(x)=x on (0,1). The odd extension is x on (−1,1) repeated with period 2, a sawtooth wave that jumps from 1 down to −1 at every odd integer. The even extension is ∣x∣ on [−1,1] repeated with period 2, a triangle wave with no jumps at all.
Half-range expansions
Definition Let f be integrable on [0,L]. A half-range expansion of f is the Fourier series of either its odd or its even extension. It has period 2L, its coefficients are computed only from the values of f on [0,L], and it contains only sine terms (odd extension) or only cosine terms (even extension).
Recall that an integrable function with period 2L has the Fourier series
In plain words You only know the function on half of a period. You choose how to fill in the other half, and the choice decides which kind of wave appears.
Example The odd extension of f is odd, so fo(x)cosLnπx is odd and every an is 0. The product fo(x)sinLnπx is even, so
It is the Fourier series of the even extension of f. The constant term 2a0 is the average value of f on [0,L].
In plain words You build f from a constant and the shapes cosLnπx, which all have zero slope at both ends.
Example For f(x)=x on [0,π] the constant term is
2a0=π1∫0πxdx=2π,
and for n≥1 integration by parts gives
an=π2∫0πxcos(nx)dx=π2⋅n2(−1)n−1,
which is −πn24 for odd n and 0 for even n. So the cosine series of x on [0,π] is
x∼2π−π4(cosx+9cos3x+25cos5x+⋯).
Endpoint behavior
Definition Let f be piecewise smooth on [0,L], meaning f and f′ are piecewise continuous there. Then for 0<x<L both half-range series converge to
2f(x+)+f(x−),
which is f(x) wherever f is continuous. At the ends the sine series converges to 0 at both x=0 and x=L, whatever the values of f there, while the cosine series converges to f(0+) at x=0 and to f(L−) at x=L.
In plain words Every sine term vanishes at the ends, so the sine series is stuck at 0 there. The even extension has no jump at the ends, so the cosine series lands on the true end values.
Example For f(x)=x on [0,π], the sine series at x=π is ∑bnsin(nπ)=0, the average of the jump from π to −π in the sawtooth. The cosine series at x=0 is
2π−π4k=1∑∞(2k−1)21=2π−π4⋅8π2=0=f(0).
The second step uses the known sum
k=1∑∞(2k−1)21=8π2.
Approximating periodic signals
Definition For an integrable function f with period 2L, the partial sum
SN(x)=2a0+n=1∑N(ancosLnπx+bnsinLnπx)
is an approximation built from finitely many frequencies. If f is continuous on R and f′ is piecewise continuous, then ∑(∣an∣+∣bn∣) converges and SN→f uniformly on R. If f has a jump, SN cannot converge uniformly near it, and the overshoot of the Gibbs phenomenon persists. For a half-range expansion this means the cosine series of a continuous piecewise smooth f always converges uniformly on [0,L], while the sine series does so only when also f(0)=f(L)=0.
In plain words A signal with no jumps is captured well by a handful of frequencies. A jump forces you to keep many terms and still leaves a ripple next to the jump.
Example For f(x)=x on [0,π], the sine coefficients shrink like n2 and the cosine coefficients like πn24. The largest error of the cosine partial sum on [0,π] occurs at the ends.
Terms up to n=N
Largest error of cosine sum on [0,π]
5
0.105
20
0.032
100
0.0064
The sine partial sums equal 0 at x=π while f(π)=π, and they are continuous, so their largest error on (0,π) comes arbitrarily close to π for every N.
Check yourself
Find the sine series of f(x)=1 on (0,π).
Show the answer
The coefficients are
bn=π2∫0πsin(nx)dx=π2⋅n1−(−1)n,
which is πn4 for odd n and 0 for even n. So on (0,π)
1∼π4(sinx+3sin3x+5sin5x+⋯).
What is the cosine series of f(x)=1 on [0,π]?
Show the answer
Just the constant 1. The even extension is the constant function 1, so a0=2 and an=0 for n≥1.
To what value does the sine series of f(x)=x2 on [0,2] converge at x=2? What about the cosine series?
Show the answer
The sine series converges to 0 at x=2, since every term sin(nπ) is 0. The cosine series converges to f(2)=4, because the even extension is continuous there.
May we count page visits to understand which courses and learning features are useful? Cloudflare collects visit and performance statistics, without your account details or answers. Your choice does not affect access. Details