11.2: Fourier Series I
( \newcommand{\kernel}{\mathrm{null}\,}\)
In Example 11.1.4 and Exercises 11.1.4-11.1.22 we saw that the eigenfunctions of Problem 5 are orthogonal on [−L,L] and the eigenfunctions of Problems 1–4 are orthogonal on [0,L]. In this section and the next we introduce some series expansions in terms of these eigenfunctions. We’ll use these expansions to solve partial differential equations in Chapter 12.
Suppose the functions ϕ1, ϕ2, ϕ3, …, are orthogonal on [a,b] and
∫baϕ2n(x)dx≠0,n=1,2,3,….
Let c1, c2, c3,…be constants such that the partial sums fN(x)=N∑m=1cmϕm(x) satisfy the inequalities
|fN(x)|≤M,a≤x≤b,N=1,2,3,…
for some constant M<∞. Suppose also that the series
f(x)=∞∑m=1cmϕm(x)
converges and is integrable on [a,b]. Then
cn=∫baf(x)ϕn(x)dx∫baϕ2n(x)dx,n=1,2,3,….
- Proof
-
Multiplying Equation ??? by ϕn and integrating yields
∫baf(x)ϕn(x)dx=∫baϕn(x)(∞∑m=1cmϕm(x))dx.
It can be shown that the boundedness of the partial sums {fN}∞N=1 and the integrability of f allow us to interchange the operations of integration and summation on the right of Equation 11.2.5, and rewrite Equation 11.2.5 as
∫baf(x)ϕn(x)dx=∞∑m=1cm∫baϕn(x)ϕm(x)dx.
(This isn’t easy to prove.) Since
∫baϕn(x)ϕm(x)dx=0ifm≠n,
Equation 11.2.6 reduces to
∫baf(x)ϕn(x)dx=cn∫baϕ2n(x)dx.
Now Equation ??? implies Equation ???.
Theorem 11.2.1 motivates the next definition.
Suppose ϕ1, ϕ2, …, ϕn,…are orthogonal on [a,b] and ∫baϕ2n(x)dx≠0, n=1, 2, 3, …. Let f be integrable on [a,b], and define
cn=∫baf(x)ϕn(x)dx∫baϕ2n(x)dx,n=1,2,3,….
Then the infinite series ∞∑n=1cnϕn(x) is called the Fourier expansion of f in terms of the orthogonal set {ϕn}∞n=1, and c1, c2, …, cn, … are called the Fourier coefficients of f with respect to {ϕn}∞n=1. We indicate the relationship between f and its Fourier expansion by
f(x)∼∞∑n=1cnϕn(x),a≤x≤b.
You may wonder why we don’t write
f(x)=∞∑n=1cnϕn(x),a≤x≤b,
rather than Equation ???. Unfortunately, this isn’t always true. The series on the right may diverge for some or all values of x in [a,b], or it may converge to f(x) for some values of x and not for others. So, for now, we’ll just think of the series as being associated with f because of the definition of the coefficients {cn}, and we’ll indicate this association informally as in Equation ???.
Fourier Series
We’ll now study Fourier expansions in terms of the eigenfunctions
1,cosπxL,sinπxL,cos2πxL,sin2πxL,…,cosnπxL,sinnπxL,….
of Problem 5. If f is integrable on [−L,L], its Fourier expansion in terms of these functions is called the Fourier series of f on [−L,L]. Since
∫L−L12dx=2L,
∫L−Lcos2nπxLdx=12∫L−L(1+cos2nπxL)dx=12(x+L2nπsin2nπxL)|L−L=L,
and
∫L−Lsin2nπxLdx=12∫L−L(1−cos2nπxL)dx=12(x−L2nπsin2nπxL),|L−L=L,
we see from Equation ??? that the Fourier series of f on [−L,L] is
a0+∞∑n=1(ancosnπxL+bnsinnπxL),
where
a0=12L∫L−Lf(x)dx,
an=1L∫L−Lf(x)cosnπxLdx,andbn=1L∫L−Lf(x)sinnπxLdx,n≥1.
Note that a0 is the average value of f on [−L,L], while an and bn (for n≥1) are twice the average values of
f(x)cosnπxL and f(x)sinnπxL
on [−L,L], respectively.
Convergence of Fourier Series
The question of convergence of Fourier series for arbitrary integrable functions is beyond the scope of this book. However, we can state a theorem that settles this question for most functions that arise in applications.
A function f is said to be piecewise smooth on [a,b] if:
- f has at most finitely many points of discontinuity in (a,b);
- f′ exists and is continuous except possibly at finitely many points in (a,b);
- f(x0+)=limx→x0+f(x) and f′(x0+)=limx→x0+f′(x) exist if a≤x0<b;
- f(x0−)=limx→x0−f(x) and f′(x0−)=limx→x0−f′(x) exist if a<x0≤b.
Since f and f′ are required to be continuous at all but finitely many points in [a,b], f(x0+)=f(x0−) and f′(x0+)=f′(x0−) for all but finitely many values of x0 in (a,b). Recall from Section 8.1 that f is said to have a jump discontinuity at x0 if f(x0+)≠f(x0−).
The next theorem gives sufficient conditions for convergence of a Fourier series. The proof is beyond the scope of this book.
If f is piecewise smooth on [−L,L], then the Fourier series
F(x)=a0+∞∑n=1(ancosnπxL+bnsinnπxL) of f on [−L,L] converges for all x in [−L,L]; moreover,
F(x)={f(x),if −L<x<L and f is continuous at xf(x−)+f(x+)2,if −L<x<L and f is discontinuous at xf(−L+)+f(L−)2,if x=L or x=−L
Since f(x+)=f(x−) if f is continuous at x, we can also say that
F(x)={f(x+)+f(x−)2,if −L<x<Lf(L−)+f(−L+)2,if x=±L
Note that F is itself piecewise smooth on [−L,L], and F(x)=f(x) at all points in the open interval (−L,L) where f is continuous. Since the series in Equation ??? converges to F(x) for all x in [−L,L], you may be tempted to infer that the error
EN(x)=|F(x)−a0−N∑n=1(ancosnπxL+bnsinnπxL)|
can be made as small as we please for all x in [−L,L] by choosing N sufficiently large. However, this isn’t true if f has a discontinuity somewhere in (−L,L), or if f(−L+)≠f(L−). Here’s the situation in this case.
If f has a jump discontinuity at a point α in (−L,L), there will be sequences of points {uN} and {vN} in (−L,α) and (α,L), respectively, such that
limN→∞uN=limN→∞vN=α
and
EN(uN)≈.09|f(α−)−f(α+)|andEN(vN)≈.09|f(α−)−f(α+)|.
Thus, the maximum value of the error EN(x) near α does not approach zero as N→∞, but just occurs closer and closer to (and on both sides of ) α, and is essentially independent of N.
If f(−L+)≠f(L−), then there will be sequences of points {uN} and {vN} in (−L,L) such that
limN→∞uN=−L,limN→∞vN=L,
EN(uN)≈.09|f(−L+)−f(L−)|andEN(vN)≈.09|f(−L+)−f(L−)|.
This is the Gibbs phenomenon. Having been alerted to it, you may see it in Figures 11.2.2 - 11.2.4 , below; however, we’ll give a specific example at the end of this section.
Find the Fourier series of the piecewise smooth function
f(x)={−x,−2<x<0,12,−0<x<2
on [−2,2] (Figure 11.2.1 ). Determine the sum of the Fourier series for −2≤x≤2.
Solution
Note that we didn’t bother to define f(−2), f(0), and f(2). No matter how they may be defined, f is piecewise smooth on [−2,2], and the coefficients in the Fourier series
F(x)=a0+∞∑n=1(ancosnπx2+bnsinnπx2)
are not affected by them. In any case, Theorem 11.2.4 implies that F(x)=f(x) in (−2,0) and (0,2), where f is continuous, while
F(−2)=F(2)=f(−2+)+f(2−)2=12(2+12)=54
and
F(0)=f(0−)+f(0+)2=12(0+12)=14.
To summarize,
F(x)={54,−x=−2−x,−2<x<0,14,−x=0,12,−0<x<2,54,−x=2.
We compute the Fourier coefficients as follows:
a0=14∫2−2f(x)dx=14[∫0−2(−x)dx+∫2012dx]=34.
If n≥1, then
an=12∫2−2f(x)cosnπx2dx=12[∫0−2(−x)cosnπx2dx+∫2012cosnπx2dx]=2n2π2(cosnπ−1),
and
bn=12∫2−2f(x)sinnπx2dx=12[∫0−2(−x)sinnπx2dx+∫2012sinnπx2dx]=12nπ(1+3cosnπ).
Therefore
F(x)=34+2π2∞∑n=1cosnπ−1n2cosnπx2+12π∞∑n=11+3cosnπnsinnπx2.
Figure 11.2.2 shows how the partial sum
Fm(x)=34+2π2m∑n=1cosnπ−1n2cosnπx2+12πm∑n=11+3cosnπnsinnπx2
approximates f(x) for m=5 (dotted curve), m=10 (dashed curve), and m=15 (solid curve).
Even and Odd Functions
Computing the Fourier coefficients of a function f can be tedious; however, the computation can often be simplified by exploiting symmetries in f or some of its terms. To focus on this, we recall some concepts that you studied in calculus. Let u and v be defined on [−L,L] and suppose that
u(−x)=u(x) and v(−x)=−v(x),−L≤x≤L.
Then we say that u is an even function and v is an odd function. Note that:
- The product of two even functions is even.
- The product of two odd functions is even.
- The product of an even function and an odd function is odd.
The functions u(x)=cosωx and u(x)=x2 are even, while v(x)=sinωx and v(x)=x3 are odd. The function w(x)=ex is neither even nor odd.
You learned parts (a) and (b) of the next theorem in calculus, and the other parts follow from them (Exercise 11.2.1).
Suppose u is even and v is odd on [−L,L]. Then:
- ∫L−Lu(x)dx=2∫L0u(x)dx,
- ∫L−Lv(x)dx=0,
- ∫L−Lu(x)cosnπxLdx=2∫L0u(x)cosnπxLdx,
- ∫L−Lv(x)sinnπxLdx=2∫L0v(x)sinnπxLdx,
- ∫L−Lu(x)sinnπxLdx=0
- ∫L−Lv(x)cosnπxLdx=0.
Find the Fourier series of f(x)=x2−x on [−2,2], and determine its sum for −2≤x≤2.
Solution
Since L=2,
F(x)=a0+∞∑n=1(ancosnπx2+bnsinnπx2)
where
a0=14∫2−2(x2−x)dx,
an=12∫2−2(x2−x)cosnπx2dx,n=1,2,3,…,
and
bn=12∫2−2(x2−x)sinnπx2dx,n=1,2,3,….
We simplify the evaluation of these integrals by using Theorem 11.2.5 with u(x)=x2 and v(x)=x; thus, from Equation ???,
a0=12∫20x2dx=x36|20=43.
From Equation ???,
an=∫20x2cosnπx2dx=2nπ[x2sinnπx2|20−2∫20xsinnπx2dx]=8n2π2[xcosnπx2|20−∫20cosnπx2dx]=8n2π2[2cosnπ−2nπsinnπx2|20]=(−1)n16n2π2.
From Equation ???,
bn=−∫20xsinnπx2dx=2nπ[xcosnπx2|20−∫20cosnπx2dx]=2nπ[2cosnπ−2nπsinnπx2|20]=(−1)n4nπ.
Therefore
F(x)=43+16π2∞∑n=1(−1)nn2cosnπx2+4π∞∑n=1(−1)nnsinnπx2.
Theorem 11.2.4 implies that
F(x)={4,−x=−2,x2−x,−2<x<2,4,−x=2.
Figure 11.2.3 shows how the partial sum
Fm(x)=43+16π2m∑n=1(−1)nn2cosnπx2+4πm∑n=1(−1)nnsinnπx2
approximates f(x) for m=5 (dotted curve), m=10 (dashed curve), and m=15 (solid curve).
Theorem 11.2.5 implies the next theorem.
Suppose f is integrable on [−L,L].
- If f is even, the Fourier series of f on [−L,L] is F(x)=a0+∞∑n=1ancosnπxL, where a0=1L∫L0f(x)dxandan=2L∫L0f(x)cosnπxLdx,n≥1.
- If f is odd, the Fourier series of f on [−L,L] is F(x)=∞∑n=1bnsinnπxL, where bn=2L∫L0f(x)sinnπxLdx.
Find the Fourier series of f(x)=x on [−π,π], and determine its sum for −π≤x≤π.
Solution
Since f is odd and L=π,
F(x)=∞∑n=1bnsinnx
where
bn=2π∫π0xsinnxdx=−2nπ[xcosnx|π0−∫π0cosnxdx]=−2ncosnπ+2n2πsinnx|π0=(−1)n+12n.
Therefore
F(x)=-2\sum_{n=1}^\infty{(-1)^n\over n}\sin nx.\nonumber
Theorem 11.2.4 implies that
F(x)= \left\{\begin{array}{cl} 0,&\phantom{-}x=-\pi,\\[4pt] x,&-\pi<x<\pi,\\[4pt]0,&\phantom{-}x=\pi. \end{array}\right.\nonumber
Figure 11.2.4 shows how the partial sum
F_m(x)=-2\sum_{n=1}^m{(-1)^n\over n}\sin nx\nonumber
approximates f(x) for m=5 (dotted curve), m=10 (dashed curve), and m=15 (solid curve).
Find the Fourier series of f(x)=|x| on [-\pi,\pi] and determine its sum for
-\pi\le x\le\pi.
Solution:
Since f is even and L=\pi,
F(x)=a_0+\sum_{n=1}^\infty a_n\cos nx.\nonumber
Since f(x)=x if x\ge0,
a_0=\left. {1\over\pi}\int_0^\pi x\,dx={x^2\over2\pi}\right|_{0}^{\pi }={\pi\over2}\nonumber
and, if n\ge1,
\begin{aligned} a_n&=\left.{2\over\pi}\int_0^\pi x\cos nx\,dx={2\over n\pi}\left[x\sin nx\right|_{0}^{\pi }-\int_0^\pi\sin nx\,dx\right]\\[4pt] &=\left.{2\over n^2\pi}\cos nx\right|_{0}^{\pi }=\frac{2}{n^2\pi}(\cos n\pi-1)={2\over n^2\pi}[(-1)^n-1].\end{aligned}\nonumber
Therefore
\label{eq:11.2.12} F(x)={\pi\over2}+{2\over\pi}\sum_{n=0}{(-1)^n-1\over n^2}\cos nx.
However, since
(-1)^n-1= \left\{\begin{array}{rl} 0&\mbox{ if }n=2m,\\[4pt] -2&\mbox{ if }n=2m+1, \end{array}\right.\nonumber
the terms in Equation \ref{eq:11.2.12} for which n=2m are all zeros. Therefore we only to include the terms for which n=2m+1; that is, we can rewrite Equation \ref{eq:11.2.12} as
F(x)={\pi\over2}-{4\over\pi}\sum_{m=0}^\infty {1\over(2m+1)^2} \cos(2m+1)x.\nonumber
However, since the name of the index of summation doesn’t matter, we prefer to replace m by n, and write
F(x)={\pi\over2}-{4\over\pi}\sum_{n=0}^\infty {1\over(2n+1)^2} \cos(2n+1)x.\nonumber
Since |x| is continuous for all x and |-\pi|=|\pi|, Theorem 11.2.4 implies that F(x)=|x| for all x in [-\pi,\pi].
Find the Fourier series of f(x)=x(x^2-L^2) on [-L,L], and determine its sum for -L\le x\le L.
Solution:
Since f is odd,
F(x)=\sum_{n=1}^\infty b_n\sin\frac{n\pi x}{L},\nonumber
where
\begin{aligned} b_n&={2\over L}\int_0^Lx(x^2-L^2)\sin{n\pi x\over L}\,dx\\[4pt] &\left.=-{2\over n\pi}\left[x(x^2-L^2)\cos{n\pi x\over L}\right|_{0}^{L}- \int_0^L (3x^2-L^2)\cos{n\pi x\over L}\,dx\right]\\[4pt] &=\left.{2L\over n^2\pi^2}\left[(3x^2-L^2)\sin{n\pi x\over L}\right|_{0}^{L}-6 \int_0^Lx\sin{n\pi x\over L}\,dx\right]\\[4pt] &=\left.{12L^2\over n^3\pi^3}\left[x\cos{n\pi x\over L}\right|_{0}^{L}- \int_0^L\cos{n\pi x\over L}\,dx\right] =(-1)^n{12L^3\over n^3\pi^3}.\end{aligned}\nonumber
Therefore
F(x)={12L^3\over\pi^3}\sum_{n=1}^\infty{(-1)^n\over n^3}\sin{n\pi x\over L}.\nonumber
Theorem 11.2.4 implies that F(x)=x(x^2-L^2) for all x in [-L,L].
The Fourier series of
f(x)=\left\{\begin{array}{cl} 0,&-1<x<-{1\over2},\\[4pt] 1,&-{1\over2}<x<{1\over2},\\[4pt] 0,&\phantom{-}{1\over2}<x<1 \end{array}\right.\nonumber
on [-1,1] is
F(x)={1\over2}+{2\over\pi}\sum_{n=1}^\infty {(-1)^{n-1}\over2n-1}\cos(2n-1)\pi x.\nonumber
(Verify.) According to Theorem 11.2.4 ,
F(x)=\left\{\begin{array}{cl} 0,&-1\le x<-{1\over2},\\[4pt] {1\over2},& x=-{1\over2},\\[4pt] 1,&-{1\over2}<x<{1\over2},\\[4pt] {1\over2},& x={1\over2},\\[4pt] 0,&{1\over2}<x\le 1; \end{array}\right.\nonumber
thus, F (as well as f) has unit jump discontinuities at x=\pm\frac{1}{2}. Figures 11.2.5 -11.2.7 show the graphs of y=f(x) and
y=F_{2N-1}(x)=\frac{1}{2}+ {2\over\pi}\sum_{n=1}^N {(-1)^{n-1}\over2n-1}\cos(2n-1)\pi x\nonumber
for N=10, 20, and 30. You can see that although F_{2N-1} approximates F (and therefore f) well on larger intervals as N increases, the maximum absolute values of the errors remain approximately equal to .09, but occur closer to the discontinuities x=\pm\frac{1}{2} as N increases.
The computation of Fourier coefficients will be tedious in many of the exercises in this chapter and the next. To learn the technique, we recommend that you do some exercises in each section “by hand,” perhaps using the table of integrals at the front of the book. However, we encourage you to use your favorite symbolic computation software in the more difficult problems.