Because the integral of any Odd product from −L to L cancels to zero while the integral of any Even product doubles the integral from 0 to L, half of the full Fourier series drops out whenever f(x) is symmetric on [−L,L]:
If f(x) is Even on [−L,L]:bnAverageHeightan=0,=L1∫0Lf(x)dx,=L2∫0Lf(x)cos(Lnπx)dxIf f(x) is Odd on [−L,L]:a0bn=0,an=0,=L2∫0Lf(x)sin(Lnπx)dx
2
Extending a Function from [0,L] to [−L,L]
Now suppose f(x) is only defined on a rod from x=0 to x=L, and we want to write it using only cosines or only sines. Since there is no physical rod on [−L,0], we can draw a fake curve on the left side to force the whole function on [−L,L] to be Even or Odd.
Even and odd extensions on [0, L]
Mirroring f(x) across the y-axis creates the Even Extension, which cancels all the sine terms to zero and leaves the Fourier Cosine Series on [0,L]:
(Note: You might also see the constant term written as 2a0, which uses the same L2 factor in front for a0=L2∫0Lf(x)dx. Dividing that by 2 gives the exact same average height L1∫0Lf(x)dx.)
Mirroring f(x) across the y-axis and flipping it upside down creates the Odd Extension, which cancels the constant and cosine terms to zero and leaves the Fourier Sine Series on [0,L]:
Try dragging the curve on [0,L] below to see how both extensions always double the integrals that survive and cancel the rest to zero:
For any curve on the rod, mirroring it to the left cancels every sine product and doubles the cosine product, while mirroring and flipping it upside down cancels the average height and cosine product and doubles the sine product.
3
Choosing Sine or Cosine Series from Boundary Conditions
Since any function on [0,L] can be expanded in either cosines or sines, we look at the boundary conditions at the ends of the rod, x=0 and x=L, to tell us which series to use.
Choosing sine or cosine series from boundary conditions
Each boundary condition matches how one set of waves behaves at the endpoints:
Plug in the endpoints x=L and x=0Because sin(nπ)=0 and sin(0)=0, the sine term is zero at both ends, leaving only the cosine term with cos(nπ)=(−1)n and cos(0)=1:
an=L2(nπL)2(cos(nπ)−cos(0))=n2π22L((−1)n−1)
Assemble the Cosine SeriesPutting the average height and cosine terms together gives the series on [0,L]:
f(x)=2L+n=1∑∞n2π22L((−1)n−1)cos(Lnπx)
Because the Even Extension meets its reflection at the same height at both x=0 and x=L to form a continuous triangle wave, this Cosine Series converges to x everywhere on [0,L] with no Gibbs overshoot, and every even term (n=2,4,6,…) drops out because (−1)n−1=0.
5
Sine Series of f(x)=x
Now let's expand the exact same line f(x)=x on [0,L] in a Fourier Sine Series.
Sine series of f(x) = x
Text solution
Set the constant and cosine terms to zeroBecause the Odd Extension mirrors across the y-axis and flips upside down, the average height and all cosine terms cancel to zero automatically:
a0=0,an=0
Integrate xsin(Lnπx) by parts on [0,L]Doubling the sine integral on [0,L] and integrating by parts gives the sine weights bn:
Plug in the endpoints x=L and x=0The sine term is zero at both ends, and the cosine term is zero at x=0 because of the x in front, leaving only the x=L part:
Assemble the Sine SeriesAdding up the sine terms gives the series on [0,L]:
f(x)=n=1∑∞nπ2L(−1)n+1sin(Lnπx)
So the Sine Series equals x inside [0,L), but at the right endpoint x=L every sine wave is 0, which is the midpoint of the periodic sawtooth wave's jump from +L down to −L. Because of that jump, the series has Gibbs overshoot right next to x=L.
Move the endpoints on [0,L] below to see why the Even Extension always connects without a jump while the Odd Extension jumps whenever an endpoint isn't at zero:
At both endpoints, the even extension always meets its reflection with no jump, while the odd extension jumps and has Gibbs overshoot at any endpoint that isn't at zero.
Key concepts
Start by checking which interval the problem gives you:
Already on [−L,L]: check symmetry before integrating
You do not need to invent an extension when f(x) is already defined on [−L,L]. If f(x) mirrors across the y-axis (Even, like f(x)=x2), then bn=0 automatically. If f(x) mirrors and flips upside down (Odd, like a step from −1 on [−L,0) to +1 on (0,L]), then a0=0 and an=0 automatically.
Only on [0,L] with insulated ends (y′(0)=0,y′(L)=0): Even Extension and Cosine Series
Mirroring across the y-axis matches the flat endpoint slopes of cosines and joins at the same height at x=0 and x=L without creating endpoint jumps (for f(x)=x, a continuous triangle wave with average height 2L):
Only on [0,L] with zero ends (y(0)=0,y(L)=0): Odd Extension and Sine Series
Mirroring and flipping upside down matches the zero endpoints of sines. If f(x) is non-zero at x=0 or x=L, the periodic wave jumps between +f and −f there, so the series converges to the midpoint 0 with Gibbs overshoot (for f(x)=x, a sawtooth wave jumping at x=L):
Use symmetry to find the full Fourier series on [−L,L] of the step function f(x)=−1 for −L≤x<0 and f(x)=1 for 0<x≤L.
How does the left half on [−L,0) compare to the right half on (0,L]: is it a direct reflection, or reflected and flipped upside down?
Because f(−x)=−f(x), the step function is Odd, so a0=0 and an=0 automatically. Since Odd×Odd=Even, the integral on [−L,L] is just double the integral on [0,L]:
(Watch out: cos(0)=1, not 0. Dropping the x=0 endpoint gives the wrong coefficient −nπ2(−1)n, and forgetting to double the integral when switching from [−L,L] to [0,L] gives half the answer, nπ1(1−(−1)n).)
bn=nπ2(1−cos(nπ))=nπ2(1−(−1)n)
f(x)=n=1∑∞nπ2(1−(−1)n)sin(Lnπx)
2
A rod from x=0 to x=L has initial temperature f(x)=L−x. (a) If both ends are held at zero temperature (y(0)=0,y(L)=0), which extension and series apply, what value does the series converge to at x=0 and at x=L, and near which endpoint does Gibbs overshoot occur? (b) Answer the same questions if both ends are insulated (y′(0)=0,y′(L)=0).
Check the heights of f(x)=L−x at x=0 and x=L first: at which endpoint is the line at height L, and at which endpoint is it already at 0?
(a) Zero ends require the Odd Extension and the Sine Series. (Watch out: Don't assume the jump happens at x=L like it did for f(x)=x. Here f(0)=L and f(L)=0, so the two endpoints switch roles.) On (−L,0), mirroring and flipping L−x gives −L−x. At x=0, the periodic wave jumps from −L on the left to +L on the right, so the Sine Series converges to the midpoint 0 at x=0 with Gibbs overshoot near x=0. At x=L, both sides meet at height 0 with no jump and no Gibbs overshoot, and the series converges to 0.
(b) Insulated ends require the Even Extension and the Cosine Series. (Watch out: Because cosine waves are not held at 0 at the ends, the Cosine Series converges to the actual endpoint height f(0)=L at x=0, not 0.) On [−L,0], mirroring L−x across the y-axis gives L+x, forming a continuous triangle wave with no jumps anywhere. The series converges to L at x=0 and to 0 at x=L with no Gibbs overshoot.
3
A rod of length L with insulated ends (y′(0)=0,y′(L)=0) has initial temperature f(x)=T0 for 0≤x<2L and f(x)=0 for 2L<x≤L. Find the Fourier series of f(x) on [0,L].
Watch out: Divide the area by the full rod length L, and don't use L2 in front without dividing by 2, which gives the wrong constant term T0 instead of 2T0.
Which series matches zero slopes at the ends, and over what part of [0,L] is the temperature non-zero?
Insulated ends require the Even Extension and the Cosine Series (bn=0). Since f(x)=0 on (2L,L], the integrals only run from 0 to 2L.
First, find the average height on [0,L]:(Watch out: Divide the area by the full rod length L, and don't use L2 in front without dividing by 2, which gives the wrong constant term T0 instead of 2T0.)
Average Height=L1∫0L/2T0dx=2T0
Next, find the cosine weights an:(Watch out: Keep the wave as cos(Lnπx) using the full rod length L. Replacing L with 2L inside the cosine gives sin(nπ)=0 and makes every an=0.)
Find the Fourier Sine Series of f(x)=L−x on [0,L].
Watch out: at x=0, the factor (L−x) equals L, not 0. Crossing out the x=0 cosine term by habit from f(x)=x gives bn=0.
In tabular integration by parts with L−x in the derivative column, what is the derivative of L−x with respect to x, and which endpoint makes L−x equal 0?
Using the Odd Extension, a0=0 and an=0. For the sine weights bn, integrate by parts on [0,L]:(Watch out: The derivative of L−x is −1, not +1, so the second term has a minus sign. Also, at x=0, the factor (L−x) equals L, not 0. Crossing out the x=0 cosine term by habit from f(x)=x gives bn=0.)
The sine term is zero at both endpoints, and the cosine term is zero at x=L because L−L=0, leaving only the x=0 endpoint where cos(0)=1:
bn=L2(0−(−L⋅nπLcos(0)))=nπ2L
f(x)=n=1∑∞nπ2Lsin(Lnπx)
5
Find the Fourier Cosine Series of f(x)=x2 on [0,L], and explain why it is identical to the full Fourier series of f(x)=x2 on [−L,L].
What do you get when you mirror x2 across the y-axis by replacing x with −x, and how many steps of tabular integration by parts does x2 take to reach 0?
Mirroring x2 across the y-axis onto [−L,0] gives (−x)2=x2, so the Even Extension of x2 on [0,L] is already f(x)=x2 on [−L,L] with bn=0.
First, find the average height on [0,L]:(Watch out: Use L1∫0Lx2dx for the average height. Using L2 without dividing by 2 gives 32L2 instead of 3L2.)
Average Height=L1∫0Lx2dx=L1[3x3]0L=3L2
Next, integrate by parts to find an:(Watch out: In tabular integration by parts, the alternating +,−,+ signs combine with the minus sign from integrating sin(Lnπx) to −nπLcos(Lnπx), making the middle cosine term positive. Dropping a minus sign flips the answer to −n2π24L2(−1)n.)