Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

29
Math 342 Partial Differential Equations Viktor Grigoryan 21 Fourier series - finding the coefficients Recall that to solve the Dirichlet and Neumann problems for the heat and wave equations on the finite interval (0,l), we need to find respectively: i) the Fourier sine series expansion of a function φ(x) (representing the initial data) on the interval (0,l), φ(x)= X n=1 A n sin nπx l . (1) ii) the Fourier cosine series expansion of φ(x) on (0,l), φ(x)= A 0 2 + X n=1 A n cos nπx l . (2) Leaving the question of whether such an infinite series is well-defined and in which sense φ(x) is equivalent to its Fourier series for later lectures, let us assume that φ(x) can be written as such series, and that the Fourier series in question do converge to the function φ(x) in a suitable sense. In order to use the Fourier expansions in solving boundary value problems with the separation of variables method, we need to find the coefficients A n in the expansions (1) and (2). Let us start with the sine expansion (1). Notice that φ(x) is written as a linear combination of the functions n sin nπx l o n=1 , (3) which is similar to expansions of vectors in terms of a basis. Recall that if {e 1 , e 2 ,..., e k } forms an orthonormal basis, and the vector v is written as a linear combination of these basis elements, v = c 1 e 1 + c 2 e 2 + ··· + c k e k , then the components of the vector v =(c 1 ,c 2 ,...c k ) can be found by projecting the vector v onto the respective directions e 1 , e 2 ,..., e k . This is done by taking the dot (scalar, inner) product of the vector v with the corresponding basis element. v · e i = X j c j e j · e i = c i , since e j · e i = 1, if i = j, and zero otherwise due to the orthonormality of the basis. Thus, c i = v · e i . We would like to compute the Fourier coefficients in a similar way. But in order for this procedure to work for expansion (1), the elements in the set (3) must be pairwise orthogonal in an appropriate sense. This turns out to be the case, if one takes the dot product of two functions f,g defined on the interval (0,l) to be (f,g)= ˆ l 0 f (x)g(x) dx. (4) This definition gives a proper inner product, and one has the associated orthogonality notion: f and g are orthogonal to each other, if their dot product is zero, (f,g) = 0. Let us now check that the set (3) is indeed orthogonal, i.e. consists of pairwise orthogonal elements in the sense of the above defined dot product. That is, we want to show that ˆ l 0 sin nπx l sin mπx l dx =0, if m 6 = n. (5) 1

Transcript of Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Page 1: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Math 342 Partial Differential Equations «Viktor Grigoryan

21 Fourier series - finding the coefficients

Recall that to solve the Dirichlet and Neumann problems for the heat and wave equations on the finite interval(0, l), we need to find respectively:

i) the Fourier sine series expansion of a function φ(x) (representing the initial data) on the interval (0, l),

φ(x) =∞∑n=1

An sinnπx

l. (1)

ii) the Fourier cosine series expansion of φ(x) on (0, l),

φ(x) =A0

2+∞∑n=1

An cosnπx

l. (2)

Leaving the question of whether such an infinite series is well-defined and in which sense φ(x) is equivalentto its Fourier series for later lectures, let us assume that φ(x) can be written as such series, and that the Fourierseries in question do converge to the function φ(x) in a suitable sense. In order to use the Fourier expansionsin solving boundary value problems with the separation of variables method, we need to find the coefficientsAn in the expansions (1) and (2).

Let us start with the sine expansion (1). Notice that φ(x) is written as a linear combination of the functions{sin

nπx

l

}∞n=1

, (3)

which is similar to expansions of vectors in terms of a basis. Recall that if {e1,e2, . . . ,ek} forms an orthonormalbasis, and the vector v is written as a linear combination of these basis elements,

v = c1e1 + c2e2 + · · ·+ ckek,

then the components of the vector v = (c1, c2, . . . ck) can be found by projecting the vector v onto the respectivedirections e1,e2, . . . ,ek. This is done by taking the dot (scalar, inner) product of the vector v with thecorresponding basis element.

v · ei =∑j

cjej · ei = ci,

since ej · ei = 1, if i = j, and zero otherwise due to the orthonormality of the basis. Thus, ci = v · ei.We would like to compute the Fourier coefficients in a similar way. But in order for this procedure to work

for expansion (1), the elements in the set (3) must be pairwise orthogonal in an appropriate sense. This turnsout to be the case, if one takes the dot product of two functions f, g defined on the interval (0, l) to be

(f, g) =

ˆ l

0

f(x)g(x)dx. (4)

This definition gives a proper inner product, and one has the associated orthogonality notion: f and g areorthogonal to each other, if their dot product is zero, (f, g) = 0.

Let us now check that the set (3) is indeed orthogonal, i.e. consists of pairwise orthogonal elements in thesense of the above defined dot product. That is, we want to show that

ˆ l

0

sinnπx

lsin

mπx

ldx = 0, if m 6= n. (5)

1

Page 2: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Using the trigonometric identity for the product of two sines,

sinα sinβ =1

2cos(α− β)− 1

2cos(α+ β), (6)

we can compute the above integral as follows:

ˆ l

0

sinnπx

lsin

mπx

ldx =

ˆ l

0

(1

2cos

(n−m)πx

l− 1

2cos

(n+m)πx

l

)dx

=l

2(n−m)πsin

(n−m)πx

l

∣∣∣∣l0

− l

2(n+m)πsin

(n+m)πx

l

∣∣∣∣l0

= 0,

since sine vanishes for any multiple of π. Thus, (5) holds, and we can find the coefficients in the expansion (1)just as was done for regular vectors. For this, we form the dot product of the function φ(x) with the functionssin(mπx/l) for m = 1,2, . . . , and integrate the resulting series term by term to get

ˆ l

0

φ(x) sinmπx

ldx =

ˆ l

0

∞∑n=1

An sinnπx

lsin

mπx

ldx

=∞∑n=1

An

ˆ l

0

sinnπx

lsin

mπx

ldx = Am

ˆ l

0

sin2 mπx

ldx,

since, due to the pairwise orthogonality, only the term with n = m survives in the sum. For the last integralwe use the trigonometric identity (6) with n = m to compute

ˆ l

0

sin2 mπx

ldx =

ˆ l

0

(1

2− 1

2cos

2mπx

l

)dx =

l

2.

Substituting this into the previous computation, we get

ˆ l

0

φ(x) sinmπx

ldx = Am

l

2,

or

Am =2

l

ˆ l

0

φ(x) sinmπx

ldx. (7)

This means that if φ(x) can be written in the form (1), then the coefficients of this expansion are necessarilygiven by (7).

We can compute the coefficients of the Fourier cosine series (2) in a similar way. For this, we need to guaranteethat the set {

cosnπx

l

}∞n=0

={

1, cosnπx

l: n = 1,2, . . .

}(8)

is orthogonal as well. To show this, we employ the trigonometric identity for the product of cosines,

cosα cosβ =1

2cos(α− β) +

1

2cos(α+ β). (9)

We thus have for m 6= n,

ˆ l

0

cosnπx

lcos

mπx

ldx =

ˆ l

0

(1

2cos

(n−m)πx

l+

1

2cos

(n+m)πx

l

)dx = 0,

2

Page 3: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

while when n = m, ˆ l

0

cos2mπx

ldx =

ˆ l

0

(1

2+

1

2cos

2mπx

l

)dx =

l

2.

Then taking the dot product of φ(x) with cos(mπx/l) for m = 1,2, . . . , and using expansion (2), we get

ˆ l

0

φ(x) cosmπx

ldx =

ˆ l

0

(A0

2+∞∑n=1

An cosnπx

l

)cos

mπx

ldx

=A0

2

ˆ l

0

cosmπx

ldx+

∞∑n=1

An

ˆ l

0

cosnπx

lcos

mπx

ldx = Am

ˆ l

0

cos2mπx

ldx = Am

l

2.

For m = 0, cos(mπx/l) = 1, and hence,

ˆ l

0

φ(x)dx =A0

2

ˆ l

0

dx+∞∑n=1

An

ˆ l

0

cosnπx

lcos

0πx

ldx =

A0

2l.

So for all n = 0,1,2, . . . , we have the following formula for the coefficients of the Fourier cosine series (2)

An =2

l

ˆ l

0

φ(x) cosnπx

ldx. (10)

Similar to the case of the sine series, this formula means that if a function can be written in the form (2), thenthe coefficients of this expansion must be necessarily given by formula (10). Notice that the coefficient A0 canbe computed by the same formula (10), which is exactly the reason we used the factor of 1/2 in front of theA0 term in expansion (2).

21.1 Application to heat and wave problems

Let us now go back to the boundary value problems for the heat and wave equations, and see how the coefficientsformulas allow one to find the series solution through the method of separation of variables. As an example,we will look at the Dirichlet problem for the wave equation,{

utt − c2uxx = 0 for 0 < x < l,u(x,0) = φ(x), ut(x,0) = ψ(x),u(0, t) = u(l, t) = 0.

(11)

As we know, the series solution for the above Dirichlet problem is

u(x, t) =∞∑n=1

(An cos

nπct

l+Bn sin

nπct

l

)sin

nπx

l, (12)

provided the initial data can be expanded into the series

φ(x) =∞∑n=1

An sinnπx

l, ψ(x) =

∞∑n=1

nπc

lBn sin

nπx

l.

But then from our previous discussion, we know that An, and (nπc/l)Bn are given by the Fourier sine seriescoefficients formula (7). Hence,

An =2

l

ˆ l

0

φ(x) sinnπx

ldx, Bn =

2

nπc

ˆ l

0

ψ(x) sinnπx

ldx.

3

Page 4: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Computing these values of the coefficients An and Bn for n = 1, 2, . . . from the given initial data, and pluggingthem into the series solution (12) will yield the solution to the Dirichlet wave problem (11).

One proceeds in exactly the same way for the case of Neumann problems, where instead of sine series, oneworks with cosine series. We demonstrate this on the example of Neumann heat problem,{

ut − kuxx = 0 for 0 < x < l,u(x,0) = φ(x),ux(0, t) = ux(l, t) = 0.

(13)

Recall that the series solution is

u(x, t) =A0

2+∞∑n=1

e−(nπ/l)2kt cos

nπx

l, (14)

provided the initial data can be expanded into the series

φ(x) =A0

2+∞∑n=1

An cosnπx

l.

The coefficients An can be computed from the given initial data using the Fourier cosine series coefficientsformula (10). One then plugs the values of these coefficients into the series solution (14), arriving at the solutionfor the Neuman heat problem (13).

21.2 Examples of computing Fourier series

Let us now consider several examples of computing the coefficients in Fourier expansions for particular functions,using the coefficients formulas (7) and (10).

Example 21.1. Compute the Fourier sine and cosine series for the function φ(x) ≡ 1 on the interval (0, l).To find the sine series for this function, we use the coefficients formula (7).

An =2

l

ˆ l

0

1 · sin nπxldx = −2

l

l

nπcos

nπx

l

∣∣∣∣l0

=2

nπ(1− cosnπ) =

{4/(nπ) for n− odd,0 for n− even.

So the Fourier sine series of the function φ(x) ≡ 1 is

1 =4

πsin

nπx

l+

4

3πsin

3πx

l+

4

5πsin

5πx

l+ · · · = 4

π

∑n−odd

1

nsin

nπx

l.

To find the cosine series, we use formula (10), and compute for n = 1,2, . . .

An =2

l

ˆ l

0

1 · cosnπx

ldx =

2

l

l

nπsin

nπx

l

∣∣∣∣l0

= 0,

while for n = 0 we have

An =2

l

ˆ l

0

1 · cos 0dx =2

ll = 2.

So the Fourier cosine expansion of the function φ(x) ≡ 1 is

1 =2

2+ 0 · cos

πx

l+ 0 · cos

2πx

l+ · · · = 1.

In other words, the constant function 1 is its own Fourier series, which is not surprising, taking into accountthe fact that the constant 1 function is an element of the set (8).

4

Page 5: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Example 21.2. Compute the Fourier sine and cosine series for the function φ(x) = x on the interval (0, l).Using the formulas for the coefficients of the sine series and integrating by parts, we compute

An =2

l

ˆ l

0

x sinnπx

ldx = −2

l

l

nπx cos

nπx

l

∣∣∣∣l0

+2

ˆ l

0

cosnπx

ldx = − 2l

nπcosnπ = (−1)n+1 2l

nπ.

So the Fourier sine series of φ(x) = x is

x =2l

πsin

πx

l− 2l

2πsin

2πx

l+

2l

3πsin

3πx

l− · · · =

∞∑n=1

(−1)n+1 2l

nπsin

nπx

l. (15)

From the cosine series coefficients formula, and again integrating by parts, we get for n = 1,2, . . .

An =2

l

ˆ l

0

x cosnπx

ldx =

2

nπx sin

nπx

l

∣∣∣∣l0

− 2

ˆ l

0

sinnπx

ldx

=2l

n2π2cos

nπx

l

∣∣∣∣l0

=

{−4l/(n2π2) for n− odd,0 for n− even.

For n = 0, we have

A0 =2

l

ˆ l

0

xdx =2

l

x2

2

∣∣∣∣l0

= l.

So the Fourier cosine series of the function φ(x) = x is

x =l

2− 4l

π2cos

πx

l− 4l

32π2cos

3πx

l− · · · = l

2−∑n−odd

4l

n2π2cos

nπx

l.

Example 21.3. Find the Fourier cosine series of the function φ(x) = x2 by integration of the sine series ofthe function x. Assume that one can integrate the Fourier sine series of x term by term.

Integrating both sides of identity (15), we get

x2

2= c+

∞∑n=1

(−1)n+1 2l

ˆsin

nπx

ldx = c+

∞∑n=1

(−1)n2l2

n2π2cos

nπx

l,

where c is the constant of integration. Thus, we get

x2 = 2c+∞∑n=1

(−1)n4l2

n2π2cos

nπx

l.

From the coefficients formula for the Fourier cosine series, we know that the free term 2c must equal A0/2, whereA0 can be computed directly from the coefficients formula (10) as follows

A0 =2

l

ˆ l

0

x2 cos 0dx =2

l

x3

3

∣∣∣∣l0

=2l2

3.

Then 2c = A0/2 = l2/3, and substituting this into the above series yields the Fourier cosine series of the function x2.

x2 =l2

3+∞∑n=1

(−1)n4l2

n2π2cos

nπx

l.

One could, of course, compute the coefficients in the Fourier expansion of x2 directly from the formula (10),however it requires integrating by parts twice, which is a little more involved than the above procedure. Onthe other hand, the idea of integrating (or differentiating) Fourier series term by term can yield Fourier seriesfor new functions by a fairly simple computation.

5

Page 6: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

21.3 Conclusion

Using the method of separation of variables for the heat and wave boundary value problems we derived theseries solutions, in which the coefficients came from the sine and cosine expansions of the initial data. In thislecture we developed a method of computing these coefficients, arriving at formulas (7) and (10) respectively,thus providing a means of computing the solutions to the boundary value problems completely. One shouldkeep in mind, however, that in all of our computations we assumed that the series expansion is well defined,i.e. the series converges in an appropriate sense. We will return to the question of convergence of Fourier seriesin subsequent lectures, and put the arguments of this lecture on a rigorous footing.

6

Page 7: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

22 Full Fourier series

We saw in previous lectures how the Dirichlet and Neumann boundary conditions lead to respectively sine andcosine Fourier series of the initial data. In the same way the periodic boundary conditions

u(−l, t) = u(l, t), ux(−l, t) = ux(l, t), (16)

lead to the full Fourier expansion, i.e. the Fourier series that contains both sines and cosines. Such boundaryconditions arise naturally in applications. For example heat conduction phenomena in a circular rod will bedescribed by the heat equation subject to boundary conditions (16).

To see how the full Fourier series comes about, let us consider the eigenvalue problem associated with theboundary conditions (16), {

X′′ = −λXX(−l) = X(l),X′(−l) = X′(l).

(17)

To find the eigenvalues and eigenfunctions for (17), we consider the qualitatively distinct cases λ < 0, λ = 0and λ > 0 separately.

We first assume λ = −γ2 < 0. In this case the equation takes the form X′′ = γ2X, and the solutions arethus X(x) = Ceγx +De−γx. The boundary conditions then imply{

Ce−γl +Deγl = Ceγl +De−γl,Cγe−γl −Dγeγl = Cγeγl −Dγe−γl.

Multiplying the first equation by γ and adding to the second equation gives

2Cγe−γl = 2Cγeγl ⇒ 2Cγeγl(1− e−2γl) = 0 ⇒ C = 0,

since γ, l 6= 0. Similarly, D = 0, which implies that there are no negative eigenvalues.We next assume that λ = 0, which results in the equation X′′ = 0. The solution is then X(x) = C +Dx,

and the boundary conditions imply{C −Dl = C +DlD = D

⇒ 2Dl = 0 ⇒ D = 0.

So X(x) ≡ 1 is an eigenfunction corresponding to the eigenvalue λ0 = 0.Finally, we consider the case λ = β2 > 0. The equation then takes the form X′′ = −β2X, and hence, has

the solution X(x) = C cosβx+D sinβx. Checking the boundary conditions gives{C cosβl−D sinβl = C cosβl+D sinβlCβ sinβl+Dβ cosβl = −Cβ sinβl+Dβ cosβl

⇒{

2D sinβl = 02Cβ sinβl = 0

Since C and D cannot both be equal to zero, and β 6= 0, we must have

sinβl = 0 ⇒ β =nπ

l, for n = 1,2, . . . .

Then the positive eigenvalues and the corresponding eigenfunctions are

λn =(nπl

)2, Xn(x) = C cos

nπx

l+D sin

nπx

l, for n = 1,2, . . . .

Notice that for each of the eigenvalues λn, n = 1, 2, . . . we have two linearly independent eigenfunctions, cos(nπx/l)and sin(nπx/l). This differs from the case of the Dirichlet and Neumann boundary conditions, where we hadonly one linearly independent eigenfunction for each of the same eigenvalues, namely sin(nπx/l) for Dirichlet, and

7

Page 8: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

cos(nπx/l) for Neumann. We will see in the next lecture that in the cases where there are more than one linearlyindependent eigenfunctions corresponding to the same eigenvalue, one can always choose a pairwise orthogonalset of eigenfunctions, which is necessary for the method of computing the Fourier coefficients to go through.

Having solved the eigenvalue problem (17), it is now clear that the series solutions of PDEs subject to theperiodic boundary conditions (16) will have both sines and cosines in their expansions. For example the solutionto the heat equation satisfying the boundary conditions (16) will be given by the series

u(x, t) =A0

2+∞∑n=1

e−(nπ/l)2kt(An cos

nπx

l+Bn sin

nπx

l),

where the coefficients An,Bn come from the expansion of the initial data

φ(x) =A0

2+∞∑n=1

An cosnπx

l+Bn sin

nπx

l. (18)

The series (18) is called the full Fourier series of the function φ(x) on the interval (−l, l).It is now clear that to solve boundary value problems with periodic boundary conditions (16) via separation

of variables, one needs to find the coefficients in the expansion (18). This procedure is similar to finding thecoefficients of the Fourier cosine and sine series, and relies on the pairwise orthogonality of the eigenfunctions.Notice that (18) is a linear combination of the elements of the set{

1, cosnπx

l, sin

nπx

l: n = 1,2, . . .

}. (19)

Now, if we can prove that the elements of this set are pairwise orthogonal, then the coefficients in (18) can befound by taking the dot product of the series (18) with the corresponding eigenfunction. Since the interval inthis case is (−l, l), we define the dot product of two functions to be

(f, g) =

ˆ l

−lf(x)g(x)dx.

Let us now check the orthogonality of the set (19). We need to show that

ˆ l

−lcos

nπx

lsin

mπx

ldx = 0, for all n,m = 1,2, . . . , (20)

ˆ l

−lcos

nπx

lcos

mπx

ldx = 0, for n 6= m, (21)

ˆ l

−lsin

nπx

lsin

mπx

ldx = 0, for n 6= m, (22)

ˆ l

−l1 · cos

mπx

ldx = 0, for all m = 1,2, . . . , (23)

ˆ l

−l1 · sin mπx

ldx = 0, for all m = 1,2, . . . . (24)

Notice that, since sin(nπx/l) and cos(nπx/l) sin(mπx/l) are odd functions, (20) and (24) are trivial, sincethe integration is performed over a symmetric interval. The integrands in (21), (22) and (23) are even functions,so the integrals are equal to twice the corresponding integrals over the interval (0, l). Then, say for (21), we have

ˆ l

−lcos

nπx

lcos

mπx

ldx = 2

ˆ l

0

cosnπx

lcos

mπx

ldx = 0, for n 6= m,

8

Page 9: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

as was computed in the last lecture, when considering Fourier cosine series over the interval (0, l). Proofs of(22)and (23) are similar.

Thus, the set (19) is indeed orthogonal. To compute the coefficients in (18), we take the dot product of theseries with the corresponding eigenfunctions. For example,

ˆ l

−lφ(x) cos

mπx

ldx =

ˆ l

−l

(A0

2+∞∑n=1

An cosnπx

l+Bn sin

nπx

l

)cos

mπx

l= Am

ˆ l

−lcos2

mπx

ldx,

and similarly for the eigenfunctions 1 = cos(0πx/l), and sin(mπx/l). But

ˆ l

−lcos2

mπx

ldx = 2

ˆ l

0

cos2mπx

ldx = 2 · l

2= l,

ˆ l

−lsin2 mπx

ldx = 2

ˆ l

0

sin2 mπx

ldx = 2 · l

2= l,

ˆ l

−l12 dx = 2l.

So the coefficients can be computed as

Am =1

l

ˆ l

−lφ(x) cos

mπx

ldx, n = 0,1,2, . . . ,

Bm =1

l

ˆ l

−lφ(x) sin

mπx

ldx, n = 1,2, . . . .

(25)

Example 22.1. Find the full Fourier series of the function φ(x) = x on the interval (−l, l).We compute the coefficients in the expansion

x =A0

2+∞∑n=1

An cosnπx

l+Bn sin

nπx

l

using formulas (25).

An =1

l

ˆ l

−lx cos

nπx

ldx = 0,

since the function x cos(nπx/l) is odd, and the integration interval is symmetric. Using evenness of the functionx sin(nπx/l), we have

Bn =1

l

ˆ l

−lx sin

nπx

ldx =

2

l

ˆ l

0

x sinnπx

ldx = (−1)n+1 2l

nπ,

where the last integral is exactly the coefficient of the Fourier sine series of function φ(x) = x, computed inthe last lecture. Thus the full Fourier series of x on the interval (−l, l) is

x =∞∑n=1

(−1)n+1 2l

nπsin

nπx

l,

which exactly coincides with the Fourier sine series of the function x on the interval (0, l).

9

Page 10: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

22.1 Even, odd and periodic functions

In the previous example we could take any odd function φ(x), and the coefficients of the cosine terms in thefull Fourier series would vanish for exactly the same reason, leading to the Fourier sine series. Thus the fullFourier series of an odd function on the interval (−l, l) coincides with its Fourier sine series on the interval (0, l).Analogously, the full Fourier series of an even function on the interval (−l, l) coincides with its Fourier cosineseries on the interval (0, l). This is not surprising, taking into account the fact that the sine and cosine functionsare themselves respectively odd and even.

So how can the same function φ(x), be it odd, even, or neither, have both a nonzero Fourier cosine and anonzero Fourier sine expansion on the interval (0, l)? The answer to this question is trivial, if one recalls thereflection method used to solve boundary value problems on the finite interval (0, l). In the reflection methodone takes either an odd (Dirichlet BCs), or an even (Neumann BCs) extension of the data. Then the resultingextended data is either odd or even on the symmetric interval (−l, l), and is extended to be periodic with period2l to the rest of the number line. But then one can find the full Fourier series of this extended data, whichwill contain only sines or cosines, depending on the evenness or the oddness of the extension, thus giving eitherthe Fourier cosine, or Fourier sine series of the function φ(x) on the interval (0, l).

In short, one has the following correspondence between the boundary conditions, extensions, and Fourier series.Dirichlet: u(0, t) = u(l, t) = 0 → odd extension → Fourier sine series.Neumann: ux(0, t) = ux(l, t) = 0 → even extension → Fourier cosine series.Periodic: u(−l, t) = u(l, t), ux(−l, t) = ux(l, t) → periodic extension → full Fourier series.

22.2 The complex form of the full Fourier series

Instead of writing the Fourier series in terms of cosines and sines, one can use complex exponential functions.Recall the Euler’s formula,

eiθ = cos θ+ i sin θ, (26)

from which one can get the formula for e−iθ in terms of cosine and sine by plugging in −θ. Solving from thesetwo equations, we have the expressions of sine and cosine in terms of the complex exponentials

cos θ =eiθ + e−iθ

2, sin θ =

eiθ − e−iθ

2i. (27)

So instead of (18), one can write the Fourier expansion in terms of the functions einπx/l and e−inπx/l, themselveseigenfunctions corresponding to the eigenvalue λn = n2π2/l2.

The convenience of the complex form is in that the Fourier series can be written compactly as

φ(x) =∞∑

n=−∞

Cneinπx/l, (28)

which is a linear combination in terms of the elements of the set{1, eiπx/l, e−iπx/l, ei2πx/l, e−i2πx/l, . . .

}={

1, e±inπx/l : n = 1,2, . . .}, (29)

replacing the set (19).In order to find the coefficients in the expansion (28), we first need to show that the set (29) is orthogonal, after

which the coefficients can be found by taking the dot product of the series with the corresponding eigenfunction. No-tice that the functions in the set (29) are complex valued. For complex valued functions the dot product is defined as

(f, g) =

ˆ l

−lf(x)g(x)dx,

where the bar stands for the complex conjugate. Then the dot product of two distinct elements of the set (29) is

ˆ l

−leinπx/le−imπx/l dx =

1

i(n−m)πei(n−m)πx/l

∣∣∣∣l−l

=e−i(n−m)π

i(n−m)π(ei2(n−m)π − 1) = 0, for n 6= m.

10

Page 11: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

So taking the dot product of the series (28) with one of the eigenfunctions in (29) gives

ˆ l

−lφ(x)e−imπx/l dx =

ˆ l

−l

∞∑n=−∞

Cneinπx/le−imπx/l dx = Cm

ˆ l

−leimπx/le−imπx/l dx = Cm · 2l.

Thus, the coefficients can be computed as

Cn =1

2l

ˆ l

−lφ(x)e−inπx/l dx. (30)

22.3 Conclusion

We saw how the separation of variables in the case of periodic boundary conditions leads to the full Fourier series(18) in the same way as the Dirichlet and Neumann boundary conditions lead to the Fourier sine and cosineseries respectively. The coefficients in the full Fourier expansion were computed by making use of the pairwiseorthogonality of eigenfunctions, resulting in the coefficients formulas (25). We also explored the connectionbetween the Fourier cosine, respectively sine, expansions on the interval (0, l) and the full Fourier expansionon the interval (−l, l), using the idea of even and odd extensions. Finally using Euler’s formula (26), we rewrotethe full Fourier series in the complex form (28), the coefficients of which were again computed by taking thedot product of the series with the eigenfunctions, and relying on the fact that the distinct eigenfunctions areorthogonal. We will see in the next lecture that one always has orthogonal eigenfunctions, provided the boundaryconditions are symmetric in an appropriate sense. This will lead to the notion of generalized Fourier series.

11

Page 12: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

23 Orthogonality, generalized Fourier series

In the last two lectures we saw how various boundary conditions for the eigenvalues of the operator A = −d2/dx2gave rise to the sine, cosine, and the full Fourier series. This corresponded to the Dirichlet, Neumann and periodicboundary conditions respectively. Today we would like to extend the procedure of obtaining Fourier series tomore general boundary conditions, which in turn will allow one to solve a wider class of boundary value problems.

We will consider the ODE−X′′ = λX, (31)

on the interval a < x < b, along with the pair of boundary conditions

α1X(a) + β1X(b) + γ1X′(a) + δ1X

′(b) = 0,

α2X(a) + β2X(b) + γ2X′(a) + δ2X

′(b) = 0.(32)

Suppose Xn denotes the eigenfunction for the eigenvalue problem (31)-(32). We would like to find a way ofexpanding any reasonably nice function φ(x) in terms of these eigenfunctions, and to find the coefficients of the series

φ(x) =∑n

AnXn. (33)

Recall that for the classical Fourier series we relied on the pairwise orthogonality of the eigenfunctions, whichuniquely determined the coefficients in the expansion (33). This pairwise orthogonality was simple to verify for thetrigonometric functions, however for the general boundary conditions (32), one cannot use explicit eigenfunctions.We thus need to find a condition for (32), that would guarantee the orthogonality of the set of eigenfunctions {Xn}.

To do this, let us assume that X1 and X2 are two eigenfunctions corresponding to the distinct eigenvaluesλ1, λ2. That is,

−X′′1 = λ1X1,

−X′′2 = λ2X2.

Taking the dot product of the first equation with X2, and the second equation with X1, and then subtractingthe second equation from the first, and using commutativity of the dot product, we get

(λ1 − λ2)(X1,X2) =

ˆ b

a

(−X′′1X2 +X1X′′2)dx.

But notice that−X′′1X2 +X1X

′′2 = (−X′1X2 +X1X

′2)′.

Plugging this into the previous identity, and using the Fundamental Theorem of Calculus gives

(λ1 − λ2)(X1,X2) =

ˆ b

a

(−X′1X2 +X1X′2)′ dx = (−X′1X2 +X1X

′2)∣∣∣ba.

Now, since the eigenvalues are distinct, and thus λ1 − λ2 6= 0, we can deduce that the dot product of theeigenfunctions X1,X2 is zero, i.e. they are orthogonal, if the quantity on the right hand side is zero,

(−X′1X2 +X1X′2)∣∣∣ba

= 0. (34)

Notice that in the last identity all the terms are either the values of the functions X1,X2, or their derivatives atthe endpoints of the interval (a, b). But these come from the boundary conditions (32), prompting the followingdefinition.

Definition 23.1. We say that the boundary conditions (32) are symmetric, if for any two functions X1 andX2 satisfying these boundary conditions identity (34) holds.

12

Page 13: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

It is easy to check that all the boundary conditions that we have encountered so far are symmetric. Indeed:

Dirichlet: X1(a) = X1(b) = 0 = X2(a) = X2(b), and clearly (34) holds.

Neumann: X′1(a) = X′1(b) = 0 = X′2(a) = X′2(b), and again (34) holds trivially.

Periodic: X1(a) = X1(b), X′1(a) = X′1(b); X2(a) = X2(b), X

′2(a) = X′2(b). Then one also has that

(−X′1X2 +X1X′2)(a) = (−X′1X2 +X1X

′2)(b), and thus (34) holds.

It is not hard to show that mixed Dirichlet-Neumann, as well as Robin conditions are also symmetric. It isthen not surprising, that in all these cases the eigenvalues were found to be pairwise orthogonal. For the generalboundary conditions (32), the above computation established the following.

Theorem 23.2. If the boundary conditions (32) are symmetric, then the eigenfunctions corresponding to distincteigenvalues of the eigenvalue problem (31)-(32) are orthogonal.

Using this fact, we can compute the coefficients in the expansion (33) following the same strategy that weemployed for the classical Fourier series. That is, to find a particular coefficient, we take the dot product ofthe expansion with the corresponding eigenvalue.

(φ,Xm) =

ˆ b

a

φ(x)Xm(x)dx =

ˆ b

a

(∑n

AnXn,Xm

)dx =

∑n

(AnXn,Xm) = Am(Xm,Xm),

since due to the pairwise orthogonality only the term with n = m survives. We can then solve for the coefficient,obtaining

Am =(φ,Xm)

(Xm,Xm). (35)

This is the coefficients formula for the generalized Fourier series (33). The procedure of finding the coefficients,of course, again resembles finding the components of a vector in terms of the orthogonal basis elements. Thequestion of convergence of such expansions will be addressed later on.

We should remark that in proving pairwise orthogonality of the eigenfunctions we ignored the case of havingmore than one linearly independent eigenfunction corresponding to the same eigenvalue. In the above proofwe relied on the fact that X1 and X2 corresponded to distinct eigenvalues. However, this is not always so,and the set {Xn} may contain linearly independent eigenfunctions corresponding to the same eigenvalue. Thiswas the case for the periodic boundary conditions, for which we had two linearly independent eigenfunctionscorresponding to each of the eigenvalues λn = (nπ/l)2, namely, cos(nπx/l), and sin(nπx/l). These happenedto be mutually orthogonal, as was shown explicitly, however, if we instead chose the pair of eigenfunctionssin(nπx/l) and sin(nπx/l) + cos(nπx/l) for the same eigenvalue, we would not have the pairwise orthogonalityrequired for the derivation of the coefficients formula (35).

We thus need a way of extracting pairwise orthogonal sets from the eigenfunctions corresponding to the sameeigenvalue. And such a way out is provided by the Gram-Schmidt orthogonalization procedure. We demonstratethis on a set of two eigenfunctions, but it can be trivially generalized to any number of them. If X1 and X2

correspond to the same eigenvalue λ, then take the pair

X1, X2 = X2 −(X1,X2)

(X1,X1)X1.

the new function X2 will be an eigenfunction corresponding to the eigenvalue λ, and it is essentially the projection

of X2 onto the “direction orthogonal to X1”. It is not hard to check that (X1, X2) = 0, i.e. they are orthogonal.

13

Page 14: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

23.1 Complex eigenvalues

So far we have completely ignored the question of complex eigenvalues and eigenfunctions, however the complexform of the full Fourier series discussed last time hints at the usefulness of considering such eigenfunctions.Notice that the complex valued function einπx/l = cos(nπx/l) + i sin(nπx/l) is an eigenvalue corresponding toλn = (nπ/l)2 for the eigenvalue problem associated with the periodic boundary conditions. We thus would liketo find all such eigenfunctions, for which we also need to consider the question of having complex eigenvaluesassociated with the general boundary conditions (32).

First, recall that for complex valued functions the dot product was defined to be

(f, g) =

ˆ b

a

f(x)g(x)dx,

where the upper bar denotes the complex conjugate. In this case one has (f, g) = (g, f), and two functionswill be orthogonal if their dot product is zero. This is similar to how the dot product for complex vectors isdefined. The reason for having the complex conjugation in the definition is to guarantee that the dot productof a function (vector) with itself is a real positive number.

We now consider the general boundary conditions (32) with real coefficients α1,2, β1,2, γ1,2, δ1,2. We say that theboundary conditions are hermitian, if for any two functions X1,X2 satisfying them the following identity holds

(−X′1X2 +X1X′2)∣∣∣ba

= 0. (36)

Notice that for real functions X1,X2 this definition coincides with the definition of symmetric boundary conditions.Also, under this condition Theorem 23.2 is true for complex valued functions with no change. In addition, thehermitian symmetry of the boundary conditions guarantees that there are no complex eigenvalues.

Theorem 23.3. If the boundary conditions (32) are hermitian, then all the eigenvalues of the eigenvalue problem(31)-(32) are real. Moreover, all the eigenfunctions can be chosen to be real valued.

The proof of the above Theorem relies on the observation that, if X is an eigenfunction corresponding tothe eigenvalue λ, then its complex conjugate X will be an eigenfunction corresponding to the eigenvalue λ.

Indeed, taking the complex conjugate of both sides of the equation −X′′ = λX gives −X′′ = λX. The boundaryconditions will be also satisfied, since the coefficients are real, and do not change under complex conjugation.But then taking the (complex) dot product of the first equation with X and the second equation with X, and

subtracting them using the facts that X = X and (X,X) = (X,X), we have

(λ− λ)(X,X) =

ˆ b

a

(−X′′X +XX′′)dx = (−X′X +XX

′)∣∣∣ba

= 0,

by the hermitian property. So

(λ− λ)

ˆ b

a

XX dx = 0.

But XX = |X|2 ≥ 0, and the function X(x) 6≡ 0, so the above integral cannot be zero, and hence, λ = λ, whichmeans that λ is real.

Now, if X is a complex eigenfunction corresponding to the eigenvalue λ, then so is X, since λ is real. But thenany (complex) linear combination of these will be an eigenfunction as well, and will satisfy the same boundaryconditions (32). Taking

Y (x) =1

2(X +X), and Z(x) =

1

2i(X −X),

we will have two real eigenfunctions. These are, of course, the real and imaginary parts of X(x), i.e.X(x) = Y (x) + iZ(x).

14

Page 15: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

23.2 Conclusion

In this lecture we explored the eigenvalue problem for the operator −d2/dx2 with the general boundary conditions(32), and showed that if the BC’s are symmetric, then the eigenfunctions are pairwise orthogonal, and onecan determine Fourier expansions in terms of these eigenfunctions. These generalized Fourier expansions aresimilar to the expansions in terms of a basis in linear algebra, where the basis is formed by the eigenvectorsof a linear symmetric transformation given by a real symmetric matrix. So the operator −d2/dx2 acts on the setof functions satisfying the symmetric boundary conditions like a symmetric linear transformation. The difference,as we pointed out several times before, is in the fact that the space of functions is infinite dimensional, andthe expansion takes the form of a series, rather than a finite linear combination.

We also showed that if the boundary conditions are hermitian, then all the eigenvalues are real and one canwork exclusively with real eigenfunctions. In the coming lectures we will show that these eigenfunctions form atrue basis, in the sense that any (L2) function can be uniquely expanded into a series in terms of these functions.

15

Page 16: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

24 Convergence of Fourier series

Starting from the method of separation of variables for the homogeneous Dirichlet and Neumann boundaryvalue problems, we studied the eigenvalue problem −X′′ = λX with the associated boundary conditions. Thislead to the sine and cosine Fourier series respectively, and then the full Fourier series, which corresponds tothe periodic boundary conditions. Using the pairwise orthogonality of the eigenfunctions in each of these cases,we were able to derive formulas for the Fourier coefficients. Finally, in the last lecture we demonstrated thatthese ideas survive for general boundary conditions for the interval (a, b), provided the boundary conditionsare symmetric (hermitian). We showed that in this case the eigenvalues are all real, and the eigenfunctions canbe chosen to be real valued and pairwise orthogonal.

One can also show that the eigenvalues form a sequence λn → ∞, as n → ∞ for the general symmetricboundary conditions. Notice that for the eigenvalues of the classical Fourier series, which we computed explicitlyto be λn = (nπ/l)2, this property holds. Then for the eigenvalues listed as

λ1 ≤ λ2 ≤ · · · → ∞,

we will have the corresponding eigenfunctions X1,X2, . . . , which are real valued and pairwise orthogonal. We areinterested in expanding any function f(x) defined on the interval (a, b) in terms of these eigenfunctions. Formallywriting

f(x) =∞∑n=1

AnXn, (37)

we found the coefficients An using the pairwise orthogonality of the eigenfunctions to be

An =(f,Xn)

(Xn,Xn)=

´ baf(x)Xn(x)dx´ baX2n(x)dx

.

If we now use these formulas to compute the coefficients, and form the series∑

nAnXn, then one should makesure that this series converges for the equality (37) to make any sense. Since this is a series of functions, there aredifferent ways in which the convergence may be understood. We next define three different notions of convergence,followed by criteria for convergence of the Fourier series for each of the three notions.

24.1 Notions of convergence

The convergence of the series of functions∑∞

n=1 fn(x) is equivalent to the convergence of the partial sums ofthe series, S1, S2, . . . , where

SN =N∑n=1

fn(x).

Conversely, the convergence of a sequence of functions F1(x), F2(x), . . . is equivalent to the convergence of thetelescoping series

∑∞n=1 fn(x), where f1(x) = F1(x), and fn(x) = Fn(x)− Fn−1(x), for n = 2,3, . . . , since the

functions FN(x) are the partial sums of this telescoping series.

Definition 24.1 (Convergence). We say that

(i)∑∞

n=1 fn(x) converges to f(x) pointwise in (a, b), if for each fixed x ∈ (a, b),∣∣∣∣∣f(x)−N∑n=1

fn(x)

∣∣∣∣∣→ 0 as N →∞ (equivalently |f(x)− SN(x)| → 0).

That is, for each fixed a < x < b the numeric sequence∑∞

n=1 fn(x) converges to the number f(x).

16

Page 17: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

(ii)∑∞

n=1 fn(x) converges to f(x) uniformly in [a, b], if

maxa≤x≤b

∣∣∣∣∣f(x)−N∑n=1

fn(x)

∣∣∣∣∣→ 0 as N →∞ (equivalently maxa≤x≤b

|f(x)− SN(x)| → 0).

That is, the overall “distance” between the function f(x) and the partial sums SN(x) converges to zero.Notice that the endpoints of the interval are included in the definition.

(iii)∑∞

n=1 fn(x) converges to f(x) in the mean-square (or L2 sense) in (a, b), if

ˆ b

a

∣∣∣∣∣f(x)−N∑n=1

fn(x)

∣∣∣∣∣2

dx→ 0 as N →∞ (equivalently

ˆ b

a

|f(x)− SN(x)|2 dx→ 0).

That is, the the “distance” between f(x) and the partial sums SN(x) in the mean-square sense convergesto zero.

It is obvious from the definition that uniform convergence is the strongest notion of the three, since uniformlyconvergent series will clearly converge pointwise, as well as in L2 sense (for finite intervals). The converse is nottrue, since not every pointwise or L2 convergent series is uniformly convergent. An example is the telescoping series∑∞

n=1(xn−1 − xn) in the interval (0,1) (check that it converges pointwise and in L2 sense, but not uniformly).

Between the pointwise and L2 convergence, neither is stronger than the other, since there are series thatconverge pointwise, but not in L2, and vice versa.

An example of a pointwise convergent series that fails to be L2 convergent is the telescoping series∑∞n=1 f(x) =

∑∞n=1(gn(x)− gn−1(x)) in (0,1), where

gn(x) =

{n 0 < x < 1

n0 1

n≤ x < 1,

forn = 1,2, . . . , and g0(x) ≡ 0.

Check that∑N

n=1 fn(x)→ 0 pointwise, but´ 10|0−SN(x)|2 dx =

´ 10g2n(x)dx→∞ as N →∞. In this example

the functions in the series are discontinuous, but one can cook up a similar example with continuous, and evendifferentiable (smooth) functions.

Finally, an example of a series which converges in L2, but not pointwise, is the telescoping series∑∞

n=1 fn(x) =∑∞n=1(gn(x)− gn−1(x)) in (0,1), where

gn(x) =

{(−1)n x = 1

20 otherwise,

forn = 0,1,2, . . . , and g0(x) ≡ 0.

Clearly,∑N

n=1 fn(x)→ 0 in the L2 sense, since´ 10|0− SN(x)|2 dx =

´ 10g2n(x) dx = 0. But the numeric series∑

n fn(1/2) diverges, so the series∑∞

n=1 fn(x) does not converge pointwise. Notice that again the functions inthe series are discontinuous. In this case this is necessary, since for series of continuous functions L2 convergenceimplies pointwise convergence, the proof of which is left as a simple exercise.

24.2 Convergence theorems

We will next list criteria for convergence of the Fourier series of a function f(x)

f(x) ∼ A0

2+∞∑n=1

An cosnx+Bn sinnx. (38)

For convenience, we will write the series as∑∞

n=1AnXn(x), which will include the full, as well as sine and cosineFourier series.

Definition 24.2. A function f(x) is called piecewise continuous on an interval [a, b], if17

Page 18: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

(i) f(x) is continuous on [a, b], except for at most finitely many points x1, x2, . . . , xk.

(ii) at each of the points x1, x2, . . . , xk, both the left-hand and right-hand limits of f(x) exist,

f(xi−) = limx→xi−

f(x), f(xi+) = limx→xi+

f(x).

We say that the function has a jump discontinuity at such a point with the jump equal to f(xi+)−f(xi−).At the points x = a, b the continuity and limits are understood to be one-sided.

Next we state the convergence theorems for the Fourier series (38). We begin with a criteria for mean-squareconvergence

Theorem 24.3 (L2 convergence). The Fourier series∑

nAnXn converges to f(x) in the mean-square sensein (a, b), if f(x) is square integrable over (a, b), that is

ˆ b

a

|f(x)|2 dx <∞.

We remark that this very weak condition on the function f(x) can be made even weaker, by replacing theRiemann integral above with the Lebesgue integral. The condition then simply states that f ∈ L2, where L2

is the space of square-integrable functions in the Lebesgue sense. The above theorem also holds for generalizedFourier series originating from the eigenvalue problem −X′′ = λX with symmetric boundary conditions.

The next criteria is for uniform convergence.

Theorem 24.4 (Uniform convergence). The Fourier series converges to f(x) uniformly in [a, b], if

(i) f(x) is continuous, and f ′(x) is piecewise continuous on [a, b].

(ii) f(x) satisfies the associated boundary conditions.

The boundary conditions for the classical Fourier series will be the Dirichlet conditions for the sine series,Neumann for the cosine, and periodic for the full Fourier series. As the L2 convergence theorem above, theuniform convergence theorem can be extended to hold for the generalized Fourier series, in which case one needsto add the condition that f ′′(x) be piecewise continuous on [a, b] as well.

Finally, we give the criteria for pointwise convergence.

Theorem 24.5 (Pointwise convergence). (i) The Fourier series converges to f(x) pointwise in (a, b), if f(x)is continuous, and f ′(x) is piecewise continuous on [a, b].

(ii) More generally, if f(x) is only piecewise continuous on (a, b), as is f ′(x), then the Fourier series convergesat every point x in the interval (a, b), and we have

∞∑n=1

AnXn(x) =1

2[f(x+) + f(x−)], for all a < x < b.

Thus, if a function has a jump discontinuity, then its Fourier series converges to the average of the one-sided limits.In the above theorems we used the interval (a, b), which in the case of the classical Fourier series is either (0, l),

or (−l, l). It is clear that the above convergence theorems will hold for the periodic extension of the functionto the entire real line as well.

Example 24.1. We have seen many examples of Fourier series that converge pointwise, but fail to be uniformlyconvergent. One such example is the sine Fourier series of the function f(x) ≡ 1 on the interval (0, π),

1 =∑n−odd

4

nπsinnx.

This function satisfies the criteria for pointwise convergence, however, the series vanishes at x = 0, π, but thefunction is 1 in the neighborhoods of these points. So the series cannot converge uniformly. Notice that thesecond condition of the uniform convergence is not satisfied in this case, since the function 1 does not satisfythe Dirichlet conditions X(0) = X(π) = 0.

18

Page 19: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

24.3 Integration and differentiation of Fourier series

We are interested in using Fourier series to solve boundary value problems for PDEs, so we would like to knowunder which conditions one can differentiate or integrate the Fourier series of a function. The following theoremsgive these necessary conditions, which we state for 2l-periodic functions. It is obvious how the statements willchange for the sine and cosine series.

Theorem 24.6 (Integration of Fourier series). Suppose f is a piecewise continuous function with the Fouriercoefficients an, bn,

f(x) ∼ a02

+∞∑n=1

an cosnπx

l+ bn sin

nπx

l.

Let F(x) =´ x0f(y)dy. If a0 = 0, then for all x in (a, b) we have

F(x) =A0

2+∞∑n=1

annπ/l

sinnπx

l− bnnπ/l

cosnπx

l, (39)

where A0 = 1l

´ l−l F(x)dx. If a0 6= 0, then the sum of the series on the right of (39) is F(x)− a0

2x.

The series (39) is obtained by formally integrating the series of f(x) term by term, irrespective of whetherthis series converges or not.

Notice that if a0 = 0, then

F(x+ 2l)− F(x) =

ˆ x+2l

x

f(y)dy =

ˆ l

−lf(y)dy = la0 = 0,

so F(x) is 2l-periodic. It is also continuous, with piecewise continuous derivative F ′(x) = f(x). But then itsFourier series will converge uniformly, and the coefficients in (39) can be obtained by integration by parts as follows.

An =1

l

ˆ l

−lF(x) cos

nπx

ldx =

1

l· 1

nπ/lF(x) sin

nπx

l

∣∣∣∣l−l− 1

l· 1

nπ/l

ˆ l

−lf(x) sin

nπx

ldx = − bn

nπ/l,

since F(x) sin(nπx/l) is 2l-periodic. We can compute Bn similarly to get Bn = an/(nπ/l).

If a0 6= 0, then the above argument can be applied to the function f(x)− a02

.

Theorem 24.7 (Differentiation of Fourier series). If f is 2l-periodic, continuous, with continuous derivativef ′(x), and piecewise continuous second order derivative f ′′(x), and has the Fourier series

f(x) =A0

2+∞∑n=1

An cosnπx

l+Bn sin

nπx

l,

then we have

f ′(x) =∞∑n=1

−nπlAn sin

nπx

l+nπ

lBn cos

nπx

l,

and this series converges uniformly.

Notice that the series of f ′(x) is the term by term derivative of f(x). Indeed, if A′n,B′n are the Fourier

coefficients of f ′(x), then

A′n =1

l

ˆ l

−lf ′(x) cos

nπx

ldx =

1

lf(x) cos

nπx

l

∣∣∣∣l−l

+1

l· nπl

ˆ l

−lf(x) sin

nπx

ldx =

lBn,

where we used the 2l-periodicity of f(x), which is crucial in this case. The coefficients B′n can be computedsimilarly, and we have B′n = −(nπ/l)An. The uniform convergence then follows from Theorem (24.4), sincef ′(x) satisfies the criteria for uniform convergence.

19

Page 20: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

24.4 Conclusion

After defining three notions of convergence – uniform, pointwise and in mean-square sense – we gave the criteriafor convergence of the Fourier series for each of these notions. We will see in the next lecture that the spaceof square integrable functions (L2) is the natural space to consider for the Fourier series. For such functionsapproximation by the Fourier series can be interpreted in terms of orthogonal projections, and expected properties,such as an analog of the Pythagorean theorem, hold. Using these tools we will give the proof of the uniformconvergence theorem (24.4). The proof of the L2 convergence requires some techniques from the measure theory,and is beyond the scope of this class. The proof of the pointwise convergence can be found in the textbook.

20

Page 21: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

25 Completeness

Recall that we defined the dot product of two (real) functions on the interval (a, b) as

(f, g) =

ˆ b

a

f(x)g(x)dx.

We can then define the L2-norm of the function f as

‖f‖ = (f, f)12 =

[ˆ b

a

|f(x)|2 dx]1

2

.

This notion corresponds to the length of vectors in linear algebra, |v| = (v,v)1/2 =√v21 + v22 + · · ·+ v2n.

Analogously, we define the “distance” between two function f, g as

‖f − g‖ =

[ˆ b

a

|f(x)− g(x)|2 dx]1

2

.

Thus, the norm gives a natural metric in L2, or a way of measuring “distances” between functions. The L2

convergence theorem of the Fourier series discussed in the last lecture can then be restated as∥∥∥∥∥f −N∑n=1

AnXn

∥∥∥∥∥→ 0, as N →∞, if f is square integrable (f ∈ L2).

Recall that the Fourier coefficients An were found by taking the dot product of the function f(x) with theeigenfunctions Xn, which form an orthogonal set. It is not surprising then, that one has the following property.

Theorem 25.1. Let {Xn} be any orthogonal set of functions, and ‖f‖ < ∞. With N fixed, among all thepossible choices of constants c1, c2, . . . cN , the choice that minimizes the quantity∥∥∥∥∥f −

N∑n=1

cnXn

∥∥∥∥∥ ,is c1 = A1, c2 = A2, . . . , cN = AN , where An’s are the Fourier coefficients of f with respect to the orthogonalset {Xn}.

This theorem asserts that the least square approximation of f by the functions X1,X2, . . . ,XN is exactlygiven by the Fourier combination. In other words, the closest function to f in the span of the orthogonal set{Xn} is its orthogonal projection onto the space spanned by this set.

The proof of the above theorem requires estimation of the square of the approximation error,

EN =

∥∥∥∥∥f −N∑n=1

cnXn

∥∥∥∥∥2

=

ˆ b

a

∣∣∣∣∣f(x)−N∑n=1

cnXn(x)

∣∣∣∣∣2

dx

=

ˆ b

a

|f(x)|2 dx− 2N∑n=1

cn

ˆ b

a

f(x)Xn(x)dx+∑n,m

cncm

ˆ b

a

Xn(x)Xm(x)dx,

where we simply expanded the square under the integral. Since Xn’s are pairwise orthogonal, only the summandswith m = n survive in the last term. So we get

EN = ‖f‖2 − 2N∑n=1

cn(f,Xn) +N∑n=1

c2n‖Xn‖2. (40)

21

Page 22: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Completing the squares for the last two terms, we obtain

EN =N∑n=1

‖Xn‖2[cn −

(f,Xn)

‖Xn‖2

]2+ ‖f‖2 −

N∑n=1

(f,Xn)2

‖Xn‖2.

The only term that depends on cn above is the first term, which will be smallest when

cn =(f,Xn)

‖Xn‖2= An,

as we wanted to show.Notice also that we have

0 ≤ EN ≤ ‖f‖2 −N∑n=1

(f,Xn)2

‖Xn‖2= ‖f‖2 −

N∑n=1

A2n‖Xn‖2,

which implies that

N∑n=1

A2n‖Xn‖2 ≤ ‖f‖2, or

N∑n=1

A2n

ˆ b

a

|Xn(x)|2 dx ≤ˆ b

a

|f(x)|2 dx.

So the partial sums of a positive series∑

nA2n‖Xn‖2 are bounded, hence, it must converge, and we have

∞∑n=1

A2n‖Xn‖2 ≤ ‖f‖2.

This is Bessel’s inequality, which asserts that the norm (length) of the projection of f onto the span of {Xn}is less than the norm (length) of f itself.

We observe that for the series∑∞

n=1AnXn to converge to f in L2 sense, the error EN must converge to zeroas N →∞. But then taking cn = An = (f,Xn)/‖Xn‖2 in (40), we have

EN = ‖f‖2 − 2N∑n=1

A2n‖Xn‖2 +

N∑n=1

A2n‖Xn‖2→ 0, or

∞∑n=1

A2n‖Xn‖2 = ‖f‖2.

This is Parseval’s equality, and it is the analogue of the Pythagorean theorem for L2 functions. Thus, theconvergence of Fourier series in the sense of L2 is equivalent to Parseval’s identity.

We now define the notion of completeness of an orthogonal set, followed by the statement of equivalence ofcompleteness and Parseval’s identity.

Definition 25.2 (Completeness). The infinite orthogonal set of functions {X1,X2, . . .} is called complete inL2, if any function f ∈ L2 can be uniquely expanded into a series in terms of these functions.

Theorem 25.3. The following are equivalent

(i) {X1,X2, . . .} is complete in L2.

(ii) If f ⊥ Xn, for all n = 1,2, . . . , then ‖f‖ = 0.

(iii) Parseval’s identity holds for any f ∈ L2.22

Page 23: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

The proof of this equivalence is rather easy, and is left as an exercise for the curious student.Finally, using the theorem of L2 convergence of the Fourier series, which as we pointed above is equivalent to

Parseval’s identity, we see that the set of eigenfunctions of −X′′ = λX with the associated symmetric conditionsis complete in L2. In particular, the set {1, cosnx, sinnx : n = 1,2, . . .} is complete in the space of squareintegrable functions over the interval (−π,π) (L2(−π,π)).

Example 25.1. Let us see how Parseval’s identity can be applied to Fourier series of particular functions toyield the sums of some curious series. We consider the Fourier sine series of the function x on the interval (0, l),

x =∞∑n=1

(−1)n+1 2l

nπsin

nπx

l.

First, notice that the squares of the norms of the functions Xn(x) = sin(nπx/l) are

‖Xn‖2 =

ˆ l

0

sin2 nπx

ldx =

l

2.

Then Parseval’s identity implies that

∞∑n=1

(2l

)2l

2=

ˆ l

0

x2 dx =l3

3.

Hence,∞∑n=1

1

n2=π2

6.

25.1 Proof of uniform convergence

We now turn to the proof of uniform convergence of Fourier series, provided the conditions of the uniformconvergence theorem of last lecture are met. We use the interval [−π,π], and assume periodic boundary conditions.The Dirichlet and Neumann cases are similar.

We need to show that the series

f(x) ∼ A0

2+∞∑n=1

An cosnx+Bn sinnx

converges uniformly on [0, π]. Notice that the piecewise continuity of f ′(x) implies that´ π−π |f

′(x)|2 dx <∞.But then for the Fourier series of f ′(x),

f ′(x) ∼∞∑n=1

A′n cosnx+B′n sinnx,

we have by Bessel’s inequality∞∑n=1

|A′n|2 + |B′n|2 ≤2

l‖f‖2 <∞.

As we found last time when discussing differentiation of Fourier series, the Fourier coefficients of f(x) are relatedto the Fourier coefficients of f ′(x) as follows

An = −B′n

n, and Bn =

A′nn, for n 6= 0. (41)

23

Page 24: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

Hence,

∞∑n=1

|An cosnx|+ |Bn sinnx| ≤∞∑n=1

|An|+ |Bn| =∞∑n=1

1

n(|B′n|+ |A′n|)

(∞∑n=1

1

n2

)12(∞∑n=1

(|A′n|+ |B′n|)2)1

2

(∞∑n=1

1

n2

)12(∞∑n=1

2(|A′n|2 + |B′n|2)

)12

<∞,

where we used Schwarz’s inequality for infinite series in the next to last step,∑anbn ≤

(∑a2n

)1/2 (∑b2n

)1/2,

and the algebraic inequality (a + b)2 ≤ 2(a2 + b2) in the last step. So the Fourier series of f(x) convergesabsolutely. But then

max |f(x)− SN(x)| ≤ max∞∑

n=N+1

|An cosnx+Bn sinnx| ≤∞∑

n=N+1

(|An|+ |Bn|)→ 0, as N → 0,

as the tail of an absolutely convergent series.In the above argument the 2π periodicity is needed for the relations (41) to hold, without which the proof

falls apart. As we saw in the example of the sine series of the constant function f(x) ≡ 1, the condition thatf(x) satisfies the boundary conditions is necessary for the uniform convergence of the Fourier series.

25.2 Conclusion

In this lecture we defined the norm of square integrable functions, which induces a notion of distance betweenfunctions in L2. Then we showed that the least square approximation of a function by an orthogonal set inL2 exactly coincides with the Fourier combination in terms of this set. All these ideas relied on the notion ororthogonality, with which the space L2 is naturally equipped. Extending these ideas, we arrived at an analogof the Pythagorean theorem in the space of functions, which was also seen to be equivalent to mean-squareconvergence of the Fourier series. Using these tools, we were also able to show that, provided a function iscontinuous with piecewise continuous derivative, and satisfies the associated boundary conditions, its Fourier seriesconverges absolutely, and hence also uniformly, thus proving the uniform convergence theorem for Fourier series.

24

Page 25: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

26 Inhomogeneous boundary value problems

Having studied the theory of Fourier series, with which we successfully solved boundary value problems forthe homogeneous heat and wave equations with homogeneous boundary conditions, we would like to turn toinhomogeneous problems, and use the Fourier series in our search for solutions. We start with the followingboundary value problem for the inhomogeneous heat equation with homogeneous Dirichlet conditions.{

ut − kuxx = f(x, t), for 0 < x < l, t > 0,u(x,0) = φ(x),u(0, t) = u(l, t) = 0.

(42)

A naıve separation of variables will not amount to much, since the source function f(x, t) may not be separable.Instead, we can use the eigenfunctions of the corresponding (homogeneous) eigenvalue problem, and look fora solution in the series form

u(x, t) =∞∑n=1

un(t) sinnπx

l. (43)

This is, of course, the Fourier sine series of u(x, t) for each fixed t > 0, the coefficients of which will vary withthe variable t. Such an expansion always exists due to completeness of the set of eigenfunctions {sin(nπx/l)}.The coefficients will then be given by the Fourier sine coefficients formula

un(t) =2

l

ˆ l

0

u(x, t) sinnπx

ldx.

We can similarly expand the source function,

f(x, t) =∞∑n=1

fn(t) sinnπx

l, where fn(t) =

2

l

ˆ l

0

f(x, t) sinnπx

ldx. (44)

Now, since we are looking for a twice differentiable function u(x, t) that satisfies the homogeneous Dirichletboundary conditions, we can differentiate the Fourier series (43) term by term to obtain

uxx(x, t) = −∞∑n=1

un(t)(nπl

)2sin

nπx

l. (45)

Notice that to be able to differentiate twice, we need to guarantee that ux satisfies homogeneous Neumannconditions, which can be arranged by taking the odd extension of u to the interval (−l, 0), and then the periodicextension to the rest of the real line.

We can also differentiate the series (43) with respect to t to obtain

ut(x, t) =∞∑n=1

u′n(t) sinnπx

l, (46)

since the Fourier coefficients of ut(x, t) are

2

l

ˆ l

0

ut(x, t) sinnπx

ldx =

∂t

[2

l

ˆ l

0

u(x, t) sinnπx

ldx

]= u′n(t).

Differentiation under the above integral is allowed since the resulting integrand is continuous.Substituting (46) and (45) into the equation, and using (44), we have

∞∑n=1

[u′n(t) + k

(nπl

)2un(t)

]sin

nπx

l=∞∑n=1

fn(t) sinnπx

l.

25

Page 26: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

But then, due to the completeness,

u′n + k(nπl

)2un = fn(t), for n = 1,2, . . . ,

which are ODEs for the coefficients un(t) of the series (43). Using the integrating factor ek(nπ/l)2t, we can rewrite

the ODE as (ek(nπ/l)

2tun

)′= ek(nπ/l)

2tfn(t).

Hence, we get

un(t) = u(0)e−k(nπ/l)2t + e−k(nπ/l)

2t

ˆ t

0

ek(nπ/l)2sfn(s)ds.

But the initial condition implies

u(x,0) = φ(x) =∞∑n=1

un(0) sinnπx

l,

thus,

un(0) = φn =2

l

ˆ l

0

φ(x) sinnπx

ldx. (47)

So the solution can be written in the series form as

u(x, t) =∞∑n=1

[φne

−k(nπ/l)2t +

ˆ t

0

ek(nπ/l)2(s−t)fn(s)ds

]sin

nπx

l, (48)

where φn, and fn are the Fourier coefficients of the initial data φ(x) and the source term f(x, t), and can befound from (47) and (44) respectively. Notice that the first coefficient term in the above series comes from thehomogeneous heat equation, while the second term can be thought of as coming from the variation of parametersfor the inhomogeneous equation.

The case of the Neumann boundary conditions for the inhomogeneous heat equation is similar, with the onlydifference that one looks for a series solution in terms of cosines, rather than the sine series (43).

The boundary value problem for the inhomogeneous wave equation,{utt − c2uxx = f(x, t), for 0 < x < l,u(x,0) = φ(x), ut(x,0) = ψ(x),u(0, t) = u(l, t) = 0,

(49)

can also be solved by expanding the solution into the series (43). In this case the ODEs for the coefficients will be

u′′n + c2(nπl

)2un = fn(t), for n = 1,2, . . . ,

with the initial conditionsun(0) = φn, u′n(0) = ψn.

These ODEs can be solved explicitly using variation of parameters to obtain the coefficients un(t), with whichone can form the series solution (43).

26

Page 27: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

26.1 Inhomogeneous boundary conditions

We next study the case of inhomogeneous boundary conditions, and consider the following boundary valueproblem for the inhomogeneous heat equation.{

ut − kuxx = f(x, t), for 0 < x < l, t > 0,u(x,0) = φ(x),u(0, t) = h(t), u(l, t) = j(t).

(50)

We will use the method of shifting the data to reduce this problem to one with homogeneous boundary conditions,which will be equivalent to (42). The idea of this method is to subtract a function satisfying the inhomogeneousboundary conditions from the solution to the above problem. Let us define the function

U(x, t) =(

1− x

l

)h(t) +

x

lj(t),

for which trivially U(0, t) = h(t), and U(l, t) = j(t). But then for the new quantity v(x, t) = u(x, t)−U(x, t),we have

vt − kvxx = ut − kuxx − (Ut − kUxx) = f(x, t)−(

1− x

l

)h′(t)− x

lj′(t),

v(x,0) = u(x,0)−U(x,0) = φ(x)−(

1− x

l

)h(0)− x

lj(0),

v(0, t) = u(0, t)−U(0, t) = h(t)− h(t) = 0,

v(l, t) = u(l, t)−U(l, t) = j(t)− j(t) = 0.

So v(x, t) satisfies the following boundary value problem with homogeneous boundary conditions, vt − kvxx = f(x, t), for 0 < x < l, t > 0,

v(x,0) = φ(x),v(0, t) = v(l, t) = 0,

(51)

where

f(x, t) = f(x, t)−(

1− x

l

)h′(t)− x

lj′(t),

φ(x) = φ(x)−(

1− x

l

)h(0)− x

lj(0).

(52)

Problem (51) is equivalent to (42), so the function v(x, t) can be found by formula (48), in which φn and fn(s)

must be replaced by respectively φn and fn(s). Clearly, φn and fn(t) can be found in terms of the Fouriercoefficients of φ(x) and f(x, t) using (52). Having found the function v(x, t) in the series form,

v(x, t) =∞∑n=1

[φne

−k(nπ/l)2t +

ˆ t

0

ek(nπ/l)2(s−t)fn(s)ds

]sin

nπx

l,

we can write the solution to problem (50) as

u(x, t) = v(x, t) +U(x, t)

=(

1− x

l

)h(t) +

x

lj(t) +

∞∑n=1

[φne

−k(nπ/l)2t +

ˆ t

0

ek(nπ/l)2(s−t)fn(s)ds

]sin

nπx

l.

(53)

In the case of Neumann boundary conditions,

ux(0, t) = h(t), ux(l, t) = j(t),27

Page 28: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

one should use the function

V (x, t) =

ˆU(x, t)dx =

(x− x2

2l

)h(t) +

x2

2lj(t)

to shift the data, since Vx(0, t) = U(0, t) = h(t), and Vx(l, t) = U(l, t) = j(t).For the inhomogeneous boundary value problem for the wave equation,{

utt − c2uxx = f(x, t), for 0 < x < l,u(x,0) = φ(x), ut(x,0) = ψ(x),u(0, t) = h(t), u(l, t) = j(t),

(54)

one can shift the data in the same way to reduce the problem to one equivalent to (49).

An alternative method to shifting the data, is to use expansion (43) to find the solution of problem (50)directly. The difference between this case and the case of problem (42) is in that the solution does not satisfy thehomogeneous boundary conditions, so the series (43) can not be differentiated term by term when substitutinginto the equation. The way out is to separately expand uxx(x, t) as

uxx(x, t) =∞∑n=1

wn(t) sinnπx

l. (55)

But then using Green’s second identity,

ˆ b

a

(f ′′g− gf ′′)dx = (f ′g − fg′)∣∣∣ba,

we can compute

wn(t) =2

l

ˆ l

0

uxx(x, t) sinnπx

ldx

= −2

l

ˆ l

0

(nπl

)2u(x, t) sin

nπx

ldx+

2

l

(ux sin

nπx

l− nπ

lu cos

nπx

l

) ∣∣∣∣l0

.

Noticing that the first boundary term vanishes, and using the boundary conditions for u from (50) in the secondterm, we have

wn(t) = −(nπl

)2un(t)−

2nπ

l2(−1)nj(t) +

2nπ

l2h(t). (56)

Then substituting (55) and (46) into the equation, and using (56), we get

∞∑n=1

[u′n(t)− k

(−(nπl

)2un(t)−

2nπ

l2(−1)nj(t) +

2nπ

l2h(t)

)]sin

nπx

l=∞∑n=1

fn(t) sinnπx

l.

Using the completeness, we obtain the following ODEs for the coefficients un(t).

u′n + k(nπl

)2un = fn(t)−

2nπ

l2[(−1)nj(t)− h(t)], with un(0) = φn.

One can solve these ODEs using the same integrating factor as before to get

un(t) = φne−k(nπ/l)2t +

ˆ t

0

ek(nπ/l)2(s−t)

(fn(s)−

2nπ

l2[(−1)nj(s)− h(s)]

)ds.

28

Page 29: Math 342 Viktor Grigoryan 21 Fourier series - finding the ...

The solution to (50) will then be given by the series (43). It is left as an exercise to convince yourselves thatthis solution is equivalent to (53).

For the inhomogeneous wave problem (54) this method will yield the following ODEs for the coefficients

u′′n + c2(nπl

)2un = fn(t)−

2nπ

l2[(−1)nj(t)− h(t)],

with the initial conditionsun(0) = φn, u′n(0) = ψn.

Solving these ODEs by variation of parameters, one can find the solution to (54) as the series (43).

26.2 Conclusion

Using the eigenfunctions corresponding to the associated homogeneous boundary value problems as buildingblocks, we searched for a solution to the inhomogeneous heat and wave equations in the form of a series in termsof these eigenfunctions. This lead to ODEs for the coefficients of the series, which is akin to the method ofvariation of parameters, where one varies the coefficients in the linear combination of solutions to the homogeneousequation to obtain a solution of the inhomogeneous one.

We studied two methods of solving problems with inhomogeneous boundary conditions, the first of whichamounted to merely shifting the boundary data to reduce the problem to one with homogeneous boundaryconditions. The second method was to directly look for a solution in the form of a series in terms of theeigenfunctions of the associated homogeneous problem. In this case one can no longer directly substitute theseries into the equation due to the issue of boundary terms when differentiating Fourier series. However, aftertaking care of these boundary terms, we arrived at ODEs for the coefficients of this expansion as well, solvingwhich will give the series solution (43).

29