Differential EquationsFourier Series and Boundary Value Problems4 of 6
Fourier Series and Boundary Value Problems · 4

Fourier Sine and Cosine Series

A physical rod or string only runs from x=0x = 0 to x=Lx = L, and its boundary conditions allow only sines or only cosines, not a full Fourier series on [−L,L][-L, L].

1

Even and Odd Symmetry Shortcuts

Before building a series on [0,L][0, L], we want a way to tell right away when half the integrals in a full Fourier series on [−L,L][-L, L] will cancel to zero.

Even:\htmlClass{lc-green}{\text{Even}}\text{:}
mirrors across y-axis\text{mirrors across }y\text{-axis}
−L\htmlClass{lc-mute}{-L}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
∫−LLf(x) dx=2∫0Lf(x) dx\int_{-L}^{L} \htmlClass{lc-blue}{f(x)}\,dx = 2\int_{0}^{L} \htmlClass{lc-blue}{f(x)}\,dx
Odd:\htmlClass{lc-violet}{\text{Odd}}\text{:}
mirrors and flips upside down\text{mirrors and flips upside down}
−L\htmlClass{lc-mute}{-L}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
∫−LLf(x) dx=0\int_{-L}^{L} \htmlClass{lc-blue}{f(x)}\,dx = 0
Even and odd symmetry shortcuts
−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x)\htmlClass{lc-blue}{f(x)}
f(x)=a0+∑n=1∞(ancos⁡(nπxL)+bnsin⁡(nπxL))\begin{aligned}\htmlClass{lc-blue}{f(x)} = \htmlClass{lc-green}{a_0} + \sum_{n=1}^{\infty}\Big(&\htmlClass{lc-green}{a_n\cos\big(\tfrac{n\pi x}{L}\big)}\\[2pt] &+ \htmlClass{lc-violet}{b_n\sin\big(\tfrac{n\pi x}{L}\big)}\Big)\end{aligned}
−L≤x≤L-L \le x \le L

When we multiply Even and Odd functions inside a Fourier integral, their symmetries combine by the exact same rules as multiplying +1\cosfam{+1} and −1\sinfam{-1}:

Even×Even=Even(+×+=+)Odd×Odd=Even(−×−=+)Even×Odd=Odd(+×−=−)\displaystyle \begin{aligned} \cosfam{\text{Even}} \times \cosfam{\text{Even}} &= \cosfam{\text{Even}} & (\cosfam{+} \times \cosfam{+} &= \cosfam{+}) \\ \sinfam{\text{Odd}} \times \sinfam{\text{Odd}} &= \cosfam{\text{Even}} & (\sinfam{-} \times \sinfam{-} &= \cosfam{+}) \\ \cosfam{\text{Even}} \times \sinfam{\text{Odd}} &= \sinfam{\text{Odd}} & (\cosfam{+} \times \sinfam{-} &= \sinfam{-}) \end{aligned}

Because the integral of any Odd product from −L-L to LL cancels to zero while the integral of any Even product doubles the integral from 00 to LL, half of the full Fourier series drops out whenever f(x)\fn{f(x)} is symmetric on [−L,L][-L, L]:

If f(x) is Even on [−L,L]:bn=0,AverageHeight=1L∫0Lf(x) dx,an=2L∫0Lf(x)cos⁡(nπxL)dxIf f(x) is Odd on [−L,L]:a0=0,an=0,bn=2L∫0Lf(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} &\text{If } \fn{f(x)} \text{ is } \cosfam{\text{Even}} \text{ on } [-L, L]: \\ &\begin{aligned} \sinfam{b_n} &= 0, \\ \cosfam{\text{Average}} \\ \cosfam{\text{Height}} &= \frac{1}{L}\int_0^L \fn{f(x)}\,dx, \\ \cosfam{a_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \end{aligned} \\[6pt] &\text{If } \fn{f(x)} \text{ is } \sinfam{\text{Odd}} \text{ on } [-L, L]: \\ &\begin{aligned} \cosfam{a_0} &= 0, \qquad \cosfam{a_n} = 0, \\ \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \end{aligned} \end{aligned}
2

Extending a Function from [0,L][0, L] to [−L,L][-L, L]

Now suppose f(x)\fn{f(x)} is only defined on a rod from x=0x = 0 to x=Lx = L, and we want to write it using only cosines or only sines. Since there is no physical rod on [−L,0][-L, 0], we can draw a fake curve on the left side to force the whole function on [−L,L][-L, L] to be Even or Odd.

−L\htmlClass{lc-mute}{-L}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x)\htmlClass{lc-blue}{f(x)}
Even Extension\htmlClass{lc-green}{\text{Even Extension}}
(mirror across y-axis)\text{(mirror across }y\text{-axis)}
−L\htmlClass{lc-mute}{-L}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Odd Extension\htmlClass{lc-violet}{\text{Odd Extension}}
(mirror and flip upside down)\text{(mirror and flip upside down)}
−L\htmlClass{lc-mute}{-L}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
Even and odd extensions on [0, L]
−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x)\htmlClass{lc-blue}{f(x)}
??

Mirroring f(x)\fn{f(x)} across the yy-axis creates the Even Extension, which cancels all the sine terms to zero and leaves the Fourier Cosine Series on [0,L][0, L]:

f(x)=1L∫0Lf(x) dx⏟Average Height+∑n=1∞ancos⁡(nπxL),an=2L∫0Lf(x)cos⁡(nπxL)dx\displaystyle \begin{aligned} \fn{f(x)} &= \underbrace{\frac{1}{L}\int_0^L \fn{f(x)}\,dx}_{\cosfam{\text{Average Height}}} \\ &\qquad + \sum_{n=1}^{\infty} \cosfam{a_n} \cosfam{\cos\left(\frac{n\pi x}{L}\right)}, \\ \cosfam{a_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \end{aligned}

(Note: You might also see the constant term written as a02\cosfam{\frac{a_0}{2}}, which uses the same 2L\frac{2}{L} factor in front for a0=2L∫0Lf(x) dx\cosfam{a_0} = \frac{2}{L}\int_0^L \fn{f(x)}\,dx. Dividing that by 22 gives the exact same average height 1L∫0Lf(x) dx\frac{1}{L}\int_0^L \fn{f(x)}\,dx.)

Mirroring f(x)\fn{f(x)} across the yy-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][0, L]:

f(x)=∑n=1∞bnsin⁡(nπxL),bn=2L∫0Lf(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} \fn{f(x)} &= \sum_{n=1}^{\infty} \sinfam{b_n} \sinfam{\sin\left(\frac{n\pi x}{L}\right)}, \\ \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \end{aligned}

Try dragging the curve on [0,L][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][0, L] can be expanded in either cosines or sines, we look at the boundary conditions at the ends of the rod, x=0x = 0 and x=Lx = L, to tell us which series to use.

Zero ends:\text{Zero ends:}
y(0)=0,  y(L)=0\htmlClass{lc-blue}{y(0)} = 0,\; \htmlClass{lc-blue}{y(L)} = 0
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
sin⁡(nπxL)\htmlClass{lc-violet}{\sin\left(\tfrac{n\pi x}{L}\right)}
Zero slopes (insulated):\text{Zero slopes (insulated):}
y′(0)=0,  y′(L)=0\htmlClass{lc-pink}{y'(0)} = 0,\; \htmlClass{lc-pink}{y'(L)} = 0
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
cos⁡(nπxL)\htmlClass{lc-green}{\cos\left(\tfrac{n\pi x}{L}\right)}
Choosing sine or cosine series from boundary conditions
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
y(0)=0,  y(L)=0\htmlClass{lc-blue}{y(0)} = 0,\; \htmlClass{lc-blue}{y(L)} = 0
→  ?\to\;?
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
y′(0)=0,  y′(L)=0\htmlClass{lc-pink}{y'(0)} = 0,\; \htmlClass{lc-pink}{y'(L)} = 0
→  ?\to\;?

Each boundary condition matches how one set of waves behaves at the endpoints:

Zero ends (y(0)=0,  y(L)=0)⟶Odd Extension⟶Sine SeriesZero slopes / insulated ends (y′(0)=0,  y′(L)=0)⟶Even Extension⟶Cosine Series\displaystyle \begin{aligned} &\text{Zero ends } \big(\fn{y(0)} = 0,\; \fn{y(L)} = 0\big) \\ &\longrightarrow \sinfam{\text{Odd Extension}} \longrightarrow \sinfam{\text{Sine Series}} \\[10pt] &\text{Zero slopes / insulated ends } \\ &\big(\slope{y'(0)} = 0,\; \slope{y'(L)} = 0\big) \\ &\longrightarrow \cosfam{\text{Even Extension}} \longrightarrow \cosfam{\text{Cosine Series}} \end{aligned}
4

Cosine Series of f(x)=xf(x) = x

Let's find the Fourier Cosine Series of the straight line f(x)=x\fn{f(x) = x} on [0,L][0, L].

−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
∣x∣\htmlClass{lc-blue}{|x|}
L\htmlClass{lc-blue}{L}
L2\htmlClass{lc-green}{\dfrac{L}{2}}
2L\htmlClass{lc-mute}{2L}
x\htmlClass{lc-mute}{x}
Cosine series of f(x) = x
−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x)=x\htmlClass{lc-blue}{f(x) = x}
Average Height=  ?an=  ?\begin{aligned}\htmlClass{lc-green}{\text{Average Height}} &= \;?\\[2pt] \htmlClass{lc-green}{a_n} &= \;?\end{aligned}
Text solution
Find the average height on [0,L][0, L]The constant term is the average height of the line from 00 to LL:
Average Height=1L∫0Lx dx=1L[x22]0L=L2\displaystyle \begin{aligned} \cosfam{\text{Average Height}} &= \frac{1}{L}\int_0^L \fn{x}\,dx \\ &= \frac{1}{L}\left[\frac{x^2}{2}\right]_0^L \\ &= \cosfam{\frac{L}{2}} \end{aligned}
Integrate xcos⁡(nπxL)\fn{x}\cosfam{\cos\left(\tfrac{n\pi x}{L}\right)} by parts on [0,L][0, L]Doubling the integral on [0,L][0, L] and integrating by parts gives the cosine weights an\cosfam{a_n}:
an=2L∫0Lxcos⁡(nπxL)dx=2L[x⋅Lnπsin⁡(nπxL)+(Lnπ)2cos⁡(nπxL)]0L\displaystyle \begin{aligned} \cosfam{a_n} &= \frac{2}{L}\int_0^L \fn{x}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\Bigg[\fn{x}\cdot\frac{L}{n\pi}\sinfam{\sin\left(\frac{n\pi x}{L}\right)} \\ &\qquad + \left(\frac{L}{n\pi}\right)^2\cosfam{\cos\left(\frac{n\pi x}{L}\right)}\Bigg]_0^L \end{aligned}
Plug in the endpoints x=Lx = L and x=0x = 0Because sin⁡(nπ)=0\sinfam{\sin(n\pi)} = 0 and sin⁡(0)=0\sinfam{\sin(0)} = 0, the sine term is zero at both ends, leaving only the cosine term with cos⁡(nπ)=(−1)n\cosfam{\cos(n\pi)} = (-1)^n and cos⁡(0)=1\cosfam{\cos(0)} = 1:
an=2L(Lnπ)2(cos⁡(nπ)−cos⁡(0))=2Ln2π2((−1)n−1)\displaystyle \begin{aligned} \cosfam{a_n} &= \frac{2}{L}\left(\frac{L}{n\pi}\right)^2 \\ &\qquad \big(\cosfam{\cos(n\pi)} - \cosfam{\cos(0)}\big) \\ &= \frac{2L}{n^2\pi^2}\big((-1)^n - 1\big) \end{aligned}
Assemble the Cosine SeriesPutting the average height and cosine terms together gives the series on [0,L][0, L]:
f(x)=L2+∑n=1∞2Ln2π2((−1)n−1)cos⁡(nπxL)\displaystyle \begin{gathered} \fn{f(x)} = \cosfam{\frac{L}{2}} \\ + \sum_{n=1}^{\infty} \frac{2L}{n^2\pi^2}\big((-1)^n - 1\big)\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \end{gathered}

Because the Even Extension meets its reflection at the same height at both x=0x = 0 and x=Lx = L to form a continuous triangle wave, this Cosine Series converges to x\fn{x} everywhere on [0,L][0, L] with no Gibbs overshoot, and every even term (n=2,4,6,…n = 2, 4, 6, \dots) drops out because (−1)n−1=0(-1)^n - 1 = 0.

5

Sine Series of f(x)=xf(x) = x

Now let's expand the exact same line f(x)=x\fn{f(x) = x} on [0,L][0, L] in a Fourier Sine Series.

−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
+L\htmlClass{lc-blue}{+L}
−L\htmlClass{lc-blue}{-L}
00
x\htmlClass{lc-mute}{x}
Sine series of f(x) = x
−L\htmlClass{lc-mute}{-L}
0\htmlClass{lc-mute}{0}
L\htmlClass{lc-mute}{L}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
f(x)=x\htmlClass{lc-blue}{f(x) = x}
bn=  ?\htmlClass{lc-violet}{b_n} = \;?
Text solution
Set the constant and cosine terms to zeroBecause the Odd Extension mirrors across the yy-axis and flips upside down, the average height and all cosine terms cancel to zero automatically:
a0\displaystyle \cosfam{a_0} =0,an\displaystyle = 0, \qquad \cosfam{a_n} =0\displaystyle = 0
Integrate xsin⁡(nπxL)\fn{x}\sinfam{\sin\left(\tfrac{n\pi x}{L}\right)} by parts on [0,L][0, L]Doubling the sine integral on [0,L][0, L] and integrating by parts gives the sine weights bn\sinfam{b_n}:
bn=2L∫0Lxsin⁡(nπxL)dx=2L[−x⋅Lnπcos⁡(nπxL)+(Lnπ)2sin⁡(nπxL)]0L\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{x}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\Bigg[-\fn{x}\cdot\frac{L}{n\pi}\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \\ &\qquad + \left(\frac{L}{n\pi}\right)^2\sinfam{\sin\left(\frac{n\pi x}{L}\right)}\Bigg]_0^L \end{aligned}
Plug in the endpoints x=Lx = L and x=0x = 0The sine term is zero at both ends, and the cosine term is zero at x=0x = 0 because of the x\fn{x} in front, leaving only the x=Lx = L part:
bn=2L(−L⋅Lnπcos⁡(nπ))=−2Lnπ(−1)n=2Lnπ(−1)n+1\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{L}\left(-\fn{L}\cdot\frac{L}{n\pi}\cosfam{\cos(n\pi)}\right) \\ &= -\frac{2L}{n\pi}(-1)^n \\ &= \frac{2L}{n\pi}(-1)^{n+1} \end{aligned}
Assemble the Sine SeriesAdding up the sine terms gives the series on [0,L][0, L]:
f(x)\displaystyle \fn{f(x)} =∑n=1∞2Lnπ(−1)n+1sin⁡(nπxL)\displaystyle = \sum_{n=1}^{\infty} \frac{2L}{n\pi}(-1)^{n+1}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}

So the Sine Series equals x\fn{x} inside [0,L)[0, L), but at the right endpoint x=Lx = L every sine wave is 00, which is the midpoint of the periodic sawtooth wave's jump from +L\fn{+L} down to −L\fn{-L}. Because of that jump, the series has Gibbs overshoot right next to x=Lx = L.

Move the endpoints on [0,L][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][-L, L]: check symmetry before integrating

You do not need to invent an extension when f(x)\fn{f(x)} is already defined on [−L,L][-L, L]. If f(x)\fn{f(x)} mirrors across the yy-axis (Even, like f(x)=x2\fn{f(x) = x^2}), then bn=0\sinfam{b_n} = 0 automatically. If f(x)\fn{f(x)} mirrors and flips upside down (Odd, like a step from −1\fn{-1} on [−L,0)[-L, 0) to +1\fn{+1} on (0,L](0, L]), then a0=0\cosfam{a_0} = 0 and an=0\cosfam{a_n} = 0 automatically.

Only on [0,L][0, L] with insulated ends (y′(0)=0,y′(L)=0\slope{y'(0)} = 0, \slope{y'(L)} = 0): Even Extension and Cosine Series

Mirroring across the yy-axis matches the flat endpoint slopes of cosines and joins at the same height at x=0x = 0 and x=Lx = L without creating endpoint jumps (for f(x)=x\fn{f(x) = x}, a continuous triangle wave with average height L2\cosfam{\tfrac{L}{2}}):

f(x)=1L∫0Lf(x) dx+∑n=1∞ancos⁡(nπxL),an=2L∫0Lf(x)cos⁡(nπxL)dx\displaystyle \begin{aligned} \fn{f(x)} &= \frac{1}{L}\int_0^L \fn{f(x)}\,dx \\ &\qquad + \sum_{n=1}^{\infty} \cosfam{a_n}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}, \\ \cosfam{a_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \end{aligned}

Only on [0,L][0, L] with zero ends (y(0)=0,y(L)=0\fn{y(0)} = 0, \fn{y(L)} = 0): Odd Extension and Sine Series

Mirroring and flipping upside down matches the zero endpoints of sines. If f(x)\fn{f(x)} is non-zero at x=0x = 0 or x=Lx = L, the periodic wave jumps between +f\fn{+f} and −f\fn{-f} there, so the series converges to the midpoint 00 with Gibbs overshoot (for f(x)=x\fn{f(x) = x}, a sawtooth wave jumping at x=Lx = L):

f(x)=∑n=1∞bnsin⁡(nπxL),bn=2L∫0Lf(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} \fn{f(x)} &= \sum_{n=1}^{\infty} \sinfam{b_n}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}, \\ \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{f(x)}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \end{aligned}

6

Practice

1

Use symmetry to find the full Fourier series on [−L,L][-L, L] of the step function f(x)=−1\fn{f(x) = -1} for −L≤x<0-L \le x < 0 and f(x)=1\fn{f(x) = 1} for 0<x≤L0 < x \le L.

How does the left half on [−L,0)[-L, 0) compare to the right half on (0,L](0, L]: is it a direct reflection, or reflected and flipped upside down?

Because f(−x)=−f(x)\fn{f(-x)} = -\fn{f(x)}, the step function is Odd, so a0=0\cosfam{a_0} = 0 and an=0\cosfam{a_n} = 0 automatically. Since Odd×Odd=Even\sinfam{\text{Odd}} \times \sinfam{\text{Odd}} = \cosfam{\text{Even}}, the integral on [−L,L][-L, L] is just double the integral on [0,L][0, L]:
bn=2L∫0L1⋅sin⁡(nπxL)dx=2L[−Lnπcos⁡(nπxL)]0L\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{1}\cdot\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\left[-\frac{L}{n\pi}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}\right]_0^L \end{aligned}
(Watch out: cos⁡(0)=1\cosfam{\cos(0)} = 1, not 00. Dropping the x=0x = 0 endpoint gives the wrong coefficient −2nπ(−1)n-\frac{2}{n\pi}(-1)^n, and forgetting to double the integral when switching from [−L,L][-L, L] to [0,L][0, L] gives half the answer, 1nπ(1−(−1)n)\frac{1}{n\pi}(1 - (-1)^n).)
bn=2nπ(1−cos⁡(nπ))=2nπ(1−(−1)n)\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{n\pi}\big(1 - \cosfam{\cos(n\pi)}\big) \\ &= \frac{2}{n\pi}\big(1 - (-1)^n\big) \end{aligned}
f(x)\displaystyle \fn{f(x)} =∑n=1∞2nπ(1−(−1)n)sin⁡(nπxL)\displaystyle = \sum_{n=1}^{\infty} \frac{2}{n\pi}\big(1 - (-1)^n\big)\sinfam{\sin\left(\frac{n\pi x}{L}\right)}
2

A rod from x=0x = 0 to x=Lx = L has initial temperature f(x)=L−x\fn{f(x) = L - x}. (a) If both ends are held at zero temperature (y(0)=0,y(L)=0\fn{y(0)} = 0, \fn{y(L)} = 0), which extension and series apply, what value does the series converge to at x=0x = 0 and at x=Lx = 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\slope{y'(0)} = 0, \slope{y'(L)} = 0).

Check the heights of f(x)=L−x\fn{f(x) = L - x} at x=0x = 0 and x=Lx = L first: at which endpoint is the line at height LL, and at which endpoint is it already at 00?

(a) Zero ends require the Odd Extension and the Sine Series. (Watch out: Don't assume the jump happens at x=Lx = L like it did for f(x)=x\fn{f(x) = x}. Here f(0)=L\fn{f(0)} = \fn{L} and f(L)=0\fn{f(L)} = \fn{0}, so the two endpoints switch roles.) On (−L,0)(-L, 0), mirroring and flipping L−x\fn{L - x} gives −L−x\fn{-L - x}. At x=0x = 0, the periodic wave jumps from −L\fn{-L} on the left to +L\fn{+L} on the right, so the Sine Series converges to the midpoint 00 at x=0x = 0 with Gibbs overshoot near x=0x = 0. At x=Lx = L, both sides meet at height 0\fn{0} with no jump and no Gibbs overshoot, and the series converges to 00.
(b) Insulated ends require the Even Extension and the Cosine Series. (Watch out: Because cosine waves are not held at 00 at the ends, the Cosine Series converges to the actual endpoint height f(0)=L\fn{f(0)} = \fn{L} at x=0x = 0, not 00.) On [−L,0][-L, 0], mirroring L−x\fn{L - x} across the yy-axis gives L+x\fn{L + x}, forming a continuous triangle wave with no jumps anywhere. The series converges to LL at x=0x = 0 and to 00 at x=Lx = L with no Gibbs overshoot.
3

A rod of length LL with insulated ends (y′(0)=0,y′(L)=0\slope{y'(0)} = 0, \slope{y'(L)} = 0) has initial temperature f(x)=T0\fn{f(x) = T_0} for 0≤x<L20 \le x < \tfrac{L}{2} and f(x)=0\fn{f(x) = 0} for L2<x≤L\tfrac{L}{2} < x \le L. Find the Fourier series of f(x)\fn{f(x)} on [0,L][0, L].

Which series matches zero slopes at the ends, and over what part of [0,L][0, L] is the temperature non-zero?

Insulated ends require the Even Extension and the Cosine Series (bn=0\sinfam{b_n} = 0). Since f(x)=0\fn{f(x) = 0} on (L2,L](\tfrac{L}{2}, L], the integrals only run from 00 to L2\tfrac{L}{2}.
First, find the average height on [0,L][0, L]: (Watch out: Divide the area by the full rod length LL, and don't use 2L\frac{2}{L} in front without dividing by 22, which gives the wrong constant term T0T_0 instead of T02\cosfam{\frac{T_0}{2}}.)
Average Height=1L∫0L/2T0 dx=T02\displaystyle \begin{aligned} \cosfam{\text{Average Height}} &= \frac{1}{L}\int_0^{L/2} \fn{T_0}\,dx \\ &= \cosfam{\frac{T_0}{2}} \end{aligned}
Next, find the cosine weights an\cosfam{a_n}: (Watch out: Keep the wave as cos⁡(nπxL)\cosfam{\cos\left(\frac{n\pi x}{L}\right)} using the full rod length LL. Replacing LL with L2\tfrac{L}{2} inside the cosine gives sin⁡(nπ)=0\sinfam{\sin(n\pi)} = 0 and makes every an=0\cosfam{a_n} = 0.)
an=2L∫0L/2T0cos⁡(nπxL)dx=2T0L[Lnπsin⁡(nπxL)]0L/2=2T0nπsin⁡(nπ2)\displaystyle \begin{aligned} \cosfam{a_n} &= \frac{2}{L}\int_0^{L/2} \fn{T_0}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2T_0}{L}\left[\frac{L}{n\pi}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}\right]_0^{L/2} \\ &= \frac{2T_0}{n\pi}\sin\left(\frac{n\pi}{2}\right) \end{aligned}
f(x)=T02+∑n=1∞2T0nπsin⁡(nπ2)cos⁡(nπxL)\displaystyle \begin{gathered} \fn{f(x)} = \cosfam{\frac{T_0}{2}} \\ + \sum_{n=1}^{\infty} \frac{2T_0}{n\pi}\sin\left(\frac{n\pi}{2}\right)\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \end{gathered}
4

Find the Fourier Sine Series of f(x)=L−x\fn{f(x) = L - x} on [0,L][0, L].

In tabular integration by parts with L−x\fn{L - x} in the derivative column, what is the derivative of L−x\fn{L - x} with respect to xx, and which endpoint makes L−x\fn{L - x} equal 00?

Using the Odd Extension, a0=0\cosfam{a_0} = 0 and an=0\cosfam{a_n} = 0. For the sine weights bn\sinfam{b_n}, integrate by parts on [0,L][0, L]: (Watch out: The derivative of L−x\fn{L - x} is −1-1, not +1+1, so the second term has a minus sign. Also, at x=0x = 0, the factor (L−x)\fn{(L - x)} equals L\fn{L}, not 00. Crossing out the x=0x = 0 cosine term by habit from f(x)=x\fn{f(x) = x} gives bn=0\sinfam{b_n} = 0.)
bn=2L∫0L(L−x)sin⁡(nπxL)dx=2L[−(L−x)Lnπcos⁡(nπxL)−(Lnπ)2sin⁡(nπxL)]0L\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{L}\int_0^L \fn{(L - x)}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\Bigg[-\fn{(L - x)}\frac{L}{n\pi}\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \\ &\qquad - \left(\frac{L}{n\pi}\right)^2\sinfam{\sin\left(\frac{n\pi x}{L}\right)}\Bigg]_0^L \end{aligned}
The sine term is zero at both endpoints, and the cosine term is zero at x=Lx = L because L−L=0L - L = 0, leaving only the x=0x = 0 endpoint where cos⁡(0)=1\cosfam{\cos(0)} = 1:
bn=2L(0−(−L⋅Lnπcos⁡(0)))=2Lnπ\displaystyle \begin{aligned} \sinfam{b_n} &= \frac{2}{L}\left(0 - \left(-\fn{L}\cdot\frac{L}{n\pi}\cosfam{\cos(0)}\right)\right) \\ &= \frac{2L}{n\pi} \end{aligned}
f(x)\displaystyle \fn{f(x)} =∑n=1∞2Lnπsin⁡(nπxL)\displaystyle = \sum_{n=1}^{\infty} \frac{2L}{n\pi}\sinfam{\sin\left(\frac{n\pi x}{L}\right)}
5

Find the Fourier Cosine Series of f(x)=x2\fn{f(x) = x^2} on [0,L][0, L], and explain why it is identical to the full Fourier series of f(x)=x2\fn{f(x) = x^2} on [−L,L][-L, L].

What do you get when you mirror x2\fn{x^2} across the yy-axis by replacing xx with −x-x, and how many steps of tabular integration by parts does x2\fn{x^2} take to reach 00?

Mirroring x2\fn{x^2} across the yy-axis onto [−L,0][-L, 0] gives (−x)2=x2\fn{(-x)^2} = \fn{x^2}, so the Even Extension of x2\fn{x^2} on [0,L][0, L] is already f(x)=x2\fn{f(x) = x^2} on [−L,L][-L, L] with bn=0\sinfam{b_n} = 0.
First, find the average height on [0,L][0, L]: (Watch out: Use 1L∫0Lx2 dx\frac{1}{L}\int_0^L \fn{x^2}\,dx for the average height. Using 2L\frac{2}{L} without dividing by 22 gives 2L23\frac{2L^2}{3} instead of L23\cosfam{\frac{L^2}{3}}.)
Average Height=1L∫0Lx2 dx=1L[x33]0L=L23\displaystyle \begin{aligned} \cosfam{\text{Average Height}} &= \frac{1}{L}\int_0^L \fn{x^2}\,dx \\ &= \frac{1}{L}\left[\frac{x^3}{3}\right]_0^L \\ &= \cosfam{\frac{L^2}{3}} \end{aligned}
Next, integrate by parts to find an\cosfam{a_n}: (Watch out: In tabular integration by parts, the alternating +,−,++, -, + signs combine with the minus sign from integrating sin⁡(nπxL)\sinfam{\sin\left(\frac{n\pi x}{L}\right)} to −Lnπcos⁡(nπxL)-\frac{L}{n\pi}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}, making the middle cosine term positive. Dropping a minus sign flips the answer to −4L2n2π2(−1)n-\frac{4L^2}{n^2\pi^2}(-1)^n.)
an=2L∫0Lx2cos⁡(nπxL)dx=2L[x2Lnπsin⁡(nπxL)+2x(Lnπ)2cos⁡(nπxL)−2(Lnπ)3sin⁡(nπxL)]0L\displaystyle \begin{aligned} \cosfam{a_n} &= \frac{2}{L}\int_0^L \fn{x^2}\cosfam{\cos\left(\frac{n\pi x}{L}\right)}dx \\ &= \frac{2}{L}\Bigg[\fn{x^2}\frac{L}{n\pi}\sinfam{\sin\left(\frac{n\pi x}{L}\right)} \\ &\qquad + 2x\left(\frac{L}{n\pi}\right)^2\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \\ &\qquad - 2\left(\frac{L}{n\pi}\right)^3\sinfam{\sin\left(\frac{n\pi x}{L}\right)}\Bigg]_0^L \end{aligned}
Both sine terms are zero at x=Lx = L and x=0x = 0, and 2x2x is zero at x=0x = 0, leaving only the middle term at x=Lx = L:
an=2L(2L(Lnπ)2cos⁡(nπ))=4L2n2π2(−1)n\displaystyle \begin{aligned} \cosfam{a_n} &= \frac{2}{L}\left(2L\left(\frac{L}{n\pi}\right)^2\cosfam{\cos(n\pi)}\right) \\ &= \frac{4L^2}{n^2\pi^2}(-1)^n \end{aligned}
f(x)=L23+∑n=1∞4L2n2π2(−1)ncos⁡(nπxL)\displaystyle \begin{gathered} \fn{f(x)} = \cosfam{\frac{L^2}{3}} \\ + \sum_{n=1}^{\infty} \frac{4L^2}{n^2\pi^2}(-1)^n\cosfam{\cos\left(\frac{n\pi x}{L}\right)} \end{gathered}