Вы находитесь на странице: 1из 6

Math 124B – January 12, 2012 «Viktor Grigoryan

2 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πx
φ(x) = An sin . (1)
n=1
l

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



A0 X nπx
φ(x) = + An cos . (2)
2 n=1
l

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 An 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 nπx o∞
sin , (3)
l n=1
which is similar to expansions of vectors in terms of a basis. Recall that if {e1 , e2 , . . . , ek } forms an
orthonormal basis, and the vector v is written as a linear combination of these basis elements,

v = c1 e1 + c2 e2 + · · · + ck ek ,

then the components of the vector v = (c1 , c2 , . . . ck ) can be found by projecting the vector v onto the
respective directions e1 , e2 , . . . , ek . This is done by taking the dot (scalar, inner) product of the vector
v with the corresponding basis element.
X
v · ei = cj ej · ei = ci ,
j

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 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
ˆ l
(f, g) = f (x)g(x) dx. (4)
0
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
nπx mπx
sin sin dx = 0, if m 6= n. (5)
0 l l

1
Using the trigonometric identity for the product of two sines,
1 1
sin α sin β = cos(α − β) − cos(α + β), (6)
2 2
we can compute the above integral as follows:
ˆ l ˆ l 
nπx mπx 1 (n − m)πx 1 (n + m)πx
sin sin dx = cos − cos dx
0 l l 0 2 l 2 l
l l
l (n − m)πx l (n + m)πx
=
2(n − m)π
sin
l − 2(n + m)π sin l = 0,
0 0

since sine vanishes for any multiple of π. Thus, (5) holds, and we can find the coefficients in the ex-
pansion (1) just as was done for regular vectors. For this, we form the dot product of the function φ(x)
with the functions sin(mπx/l) for m = 1, 2, . . . , and integrate the resulting series term by term to get
ˆ l ˆ lX ∞
mπx nπx mπx
φ(x) sin dx = An sin sin dx
0 l 0 n=1 l l
∞ ˆ l ˆ l
X nπx mπx mπx
= An sin sin dx = Am sin2 dx,
n=1 0 l l 0 l

since, due to the pairwise orthogonality, only the term with n = m survives in the sum. For the last
integral we use the trigonometric identity (6) with n = m to compute
ˆ l ˆ l 
2 mπx 1 1 2mπx l
sin dx = − cos dx = .
0 l 0 2 2 l 2

Substituting this into the previous computation, we get


ˆ l
mπx l
φ(x) sin dx = Am ,
0 l 2
or ˆ l
2 mπx
Am = φ(x) sin dx. (7)
l 0 l
This means that if φ(x) can be written in the form (1), then the coefficients of this expansion are
necessarily given by (7).
We can compute the coefficients of the Fourier cosine series (2) in a similar way. For this, we need to
guarantee that the set n nπx o∞ n nπx o
cos = 1, cos : n = 1, 2, . . . (8)
l n=0 l
is orthogonal as well. To show this, we employ the trigonometric identity for the product of cosines,
1 1
cos α cos β = cos(α − β) + cos(α + β). (9)
2 2
We thus have for m 6= n,
ˆ l ˆ l 
nπx mπx 1 (n − m)πx 1 (n + m)πx
cos cos dx = cos + cos dx = 0,
0 l l 0 2 l 2 l

2
while when n = m, ˆ ˆ l
l 
mπx 2 1 1 2mπx l
cos dx = + cos dx = .
0 l 0 2 2 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 ˆ l ∞
!
mπx A0 X nπx mπx
φ(x) cos dx = + An cos cos dx
0 l 0 2 n=1
l l
ˆ l ∞ ˆ l ˆ l
A0 mπx X nπx mπx mπx l
= cos dx + An cos cos dx = Am cos2 dx = Am .
2 0 l n=1 0 l l 0 l 2

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


ˆ l ˆ l ∞ ˆ l
A0 X nπx 0πx A0
φ(x) dx = dx + An cos cos dx = l.
0 2 0 n=1 0 l l 2

So for all n = 0, 1, 2, . . . , we have the following formula for the coefficients of the Fourier cosine series (2)
ˆ l
2 nπx
An = φ(x) cos dx. (10)
l 0 l
Similar to the case of the sine series, this formula means that if a function can be written in the form
(2), then the coefficients of this expansion must be necessarily given by formula (10). Notice that the
coefficient A0 can be computed by the same formula (10), which is exactly the reason we used the factor
of 1/2 in front of the A0 term in expansion (2).
2.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
coefficients formulas 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 − c2 uxx = 0 for 0 < x < l,


(
u(x, 0) = φ(x), ut (x, 0) = ψ(x), (11)
u(0, t) = u(l, t) = 0.

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


∞  
X nπct nπct nπx
u(x, t) = An cos + Bn sin sin , (12)
n=1
l l l

provided the initial data can be expanded into the series


∞ ∞
nπx
X X nπc nπx
φ(x) = An sin , ψ(x) = Bn sin .
n=1
l n=1
l l

But then from our previous discussion, we know that An , and (nπc/l)Bn are given by the Fourier sine
series coefficients formula (7). Hence,
ˆ l ˆ l
2 nπx 2 nπx
An = φ(x) sin dx, Bn = ψ(x) sin dx.
l 0 l nπc 0 l

3
Computing these values of the coefficients An and Bn for n = 1, 2, . . . from the given initial data, and
plugging them 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,
one works with cosine series. We demonstrate this on the example of Neumann heat problem,
ut − kuxx = 0 for 0 < x < l,
(
u(x, 0) = φ(x), (13)
ux (0, t) = ux (l, t) = 0.

Recall that the series solution is



A0 X −(nπ/l)2 kt nπx
u(x, t) = + e cos , (14)
2 n=1
l

provided the initial data can be expanded into the series



A0 X nπx
φ(x) = + An cos .
2 n=1
l

The coefficients An can be computed from the given initial data using the Fourier cosine series coeffi-
cients formula (10). One then plugs the values of these coefficients into the series solution (14), arriving
at the solution for the Neuman heat problem (13).
2.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 2.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).
ˆ l
2 l

nπx 2 l nπx 2 4/(nπ) for n − odd,
An = 1 · sin dx = − cos = (1 − cos nπ) =
l 0 l l nπ l 0 nπ
0 for n − even.

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


4 nπx 4 3πx 4 5πx 4 X 1 nπx
1= sin + sin + sin + ··· = sin .
π l 3π l 5π l π n−odd n l

To find the cosine series, we use formula (10), and compute for n = 1, 2, . . .
ˆ l
2 l nπx 2 l nπx
An = 1 · cos dx = sin = 0,
l 0 l l nπ l 0

while for n = 0 we have ˆ l


2 2
An = 1 · cos 0 dx = l = 2.
l 0 l
So the Fourier cosine expansion of the function φ(x) ≡ 1 is
2 πx 2πx
1= + 0 · cos + 0 · cos + · · · = 1.
2 l l
In other words, the constant function 1 is its own Fourier series, which is not surprising, taking into
account the fact that the constant 1 function is an element of the set (8).

4
Example 2.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
ˆ l ˆ l
2 l nπx 2 l nπx 2 nπx 2l 2l
An = x sin dx = − x cos + cos dx = − cos nπ = (−1)n+1 .
l 0 l l nπ l 0 nπ 0
l nπ nπ
So the Fourier sine series of φ(x) = x is

2l πx 2l 2πx 2l 3πx X 2l nπx
x= sin − sin + sin − ··· = (−1)n+1 sin . (15)
π l 2π l 3π l n=1
nπ l
From the cosine series coefficients formula, and again integrating by parts, we get for n = 1, 2, . . .
ˆ l ˆ l
2 l nπx 2 nπx 2 nπx
An = x cos dx = x sin − sin dx
l 0 l nπ l 0 nπ 0
l
l 
2l nπx −4l/(n2 π 2 ) for n − odd,
= 2 2 cos =
nπ l 0 0 for n − even.
For n = 0, we have
ˆ l
l
2 2 x2
A0 = x dx = = l.
l 0 l 2 0
So the Fourier cosine series of the function φ(x) = x is
l 4l πx 4l 3πx l X 4l nπx
x= − 2 cos − 2 2 cos − ··· = − 2 2
cos .
2 π l 3π l 2 n−odd n π l

Example 2.3. Find the Fourier cosine series of the function φ(x) = x2 by integration of the sine series
of the 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 X
n+1 2l nπx X 2l2 nπx
=c+ (−1) sin dx = c + (−1)n 2 2 cos ,
2 n=1
nπ l n=1
nπ l
where c is the constant of integration. Thus, we get

X 4l2 nπx
x2 = 2c + (−1)n 2 2
cos .
n=1
nπ l
From the coefficients formula for the Fourier cosine series, we know that the free term 2c must equal
A0 /2, where A0 can be computed directly from the coefficients formula (10) as follows
ˆ l
2 l 2 2 x3 2l2
A0 = x cos 0 dx = = .
l 0 l 3 0 3
Then 2c = A0 /2 = l2 /3, and substituting this into the above series yields the Fourier cosine series of
the function x2 . ∞
2 l2 X 4l2 nπx
x = + (−1)n 2 2 cos .
3 n=1 nπ l
One could, of course, compute the coefficients in the Fourier expansion of x2 directly from the for-
mula (10), however it requires integrating by parts twice, which is a little more involved than the above
procedure. On the other hand, the idea of integrating (or differentiating) Fourier series term by term
can yield Fourier series for new functions by a fairly simple computation.

5
2.3 Conclusion
Using the method of separation of variables for the heat and wave boundary value problems we derived
the series solutions, in which the coefficients came from the sine and cosine expansions of the initial
data. In this lecture 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 should keep 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 series in subsequent lectures, and put the arguments of this lecture
on a rigorous footing.

Вам также может понравиться