+ All Categories
Home > Documents > Lecs 316

Lecs 316

Date post: 20-Oct-2015
Category:
Upload: mursid-abidiarso
View: 16 times
Download: 2 times
Share this document with a friend
Description:
lecture class resume
Popular Tags:
98
Math 257 and 316 Partial Differential Equations c 1999 Richard Froese. Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
Transcript
  • Math 257 and 316

    Partial Dierential Equations

    c1999 Richard Froese. Permission is granted to make and distribute verbatim copies of this document providedthe copyright notice and this permission notice are preserved on all copies.

  • Math 257 and 316 1

    Introduction

    This is a course about partial differential equations, or PDEs. These are differential equations involving partialderivatives and multi-variable functions.

    An example: temperature flow

    Consider the following experiment. A copper cube (with side length 10cm) is taken from a refrigerator (attemperature 4) and, at time t = 0 is placed in a large pot of boiling water. What is the temperature of thecentre of the cube after 60 seconds?

    z

    yx

    Introduce the x, y and z co-ordinate axes, with the origin located at one corner of the cube as shown. LetT (x; y; z; t) be the temperature of the point (x; y; z) inside the cube at time t. Then T (x; y; z; t) is defined for all(x; y; z) inside the cube (i.e., 0 x; y; z 10), and all t 0. Our goal is to determine the function T , in particular,to find T (5; 5; 5; 100).

    There are three facts about T (x; y; z; t) that are needed to determine it completely. Firstly, T solves the partialdifferential equation governing heat flow, called the heat equation. This means that for every (x; y; z) in the cubeand every t > 0,

    @T

    @t= 2

    @2T

    @x2+@2T

    @y2+@2T

    @z2

    Here 2 is a constant called the thermal diffusivity. This constant depends on what kind of metal the cube ismade of. For copper 2 = 1:14 cm2=sec

    The second fact about T is that it satisfies a boundary condition. We assume that the pot of water is so large thatthe temperature of the water is not affected by the insertion of the cube. This means that the boundary of thecube is always held at the constant temperature 100. In other words

    T (x; y; z; t) = 100 for all (x; y; z) on the boundary of the cube and all t > 0.

    The third fact about T is that it satisfies an initial condition. At time t = 0 the cube is at a uniform temperatureof 4. This means that

    T (x; y; z; 0) = 4 for all (x; y; z) inside the cube.

  • 2 Math 257 and 316

    Given these three facts we can determine T completely. In this course we will learn how to write down thesolution in the form of an infinite (Fourier) series. For now Ill just write down the answer.

    T (x; y; z; t) = 100 +1X

    n=1

    1Xm=1

    1Xl=1

    an;m;le2m;n;lt sin(nx=10) sin(my=10) sin(lz=10)

    wherem;n;l = (=10)2(n2 +m2 + l2)

    and

    an;m;l = 104

    2

    3 1nml

    (1 (1)n)(1 (1)m)(1 (1)l)

    Problem 1.1: What temperature does the formula above predict for the centre of the cube at time t = 60if you use just one term ((n;m; l) = (1; 1; 1)) in the sum. What is the answer if you include the terms(n;m; l) = (1; 1; 1); (3; 1; 1); (1; 3; 1); (1; 1; 3)?

    Basic equations

    The three basic equations that we will consider in this course are the heat equation, the wave equation andLaplaces equation. We have already seen the heat equation in the section above. The sum of the second partialderivatives with repsect to the space variables (x, y and z) is given a special namethe Laplacian or the Laplaceoperatorand is denoted . Thus the Laplacian of u is denoted

    u =@2u

    @x2+@2u

    @y2+@2u

    @z2

    With this notation the heat equation can be written

    @u

    @t= 2u (1:1)

    Sometimes we are interested in situations where there are fewer than three space variables. For example, if wewant to describe heat flow in a thin plate that is insulated on the top and the bottom, then the temperaturefunction only depends on two space variables, x and y. The heat flow in a thin insulated rod would be describedby a function depending on only one space variable x. In these situations we redefine to mean

    u =@2u

    @x2+@2u

    @y2

    or

    u =@2u

    @x2

    depending on the context. The heat equation is then still written in the form (1.1).

    The second basic equation is the wave equation

    @2u

    @t2= c2u

  • Math 257 and 316 3

    This equation decribes a vibrating string (one space dimension) a vibrating drum or water waves (two spacedimensions) or an electric field propagating in free space (three space dimensions).

    The third basic equation is the Laplace equation

    u = 0

    Notice that a solution of Laplaces equation can be considered to be a solution of the wave or heat equationthat is constant in time (so that @u=@t = @2u=@t2 = 0). So we see that solutions to Laplaces equation describeequilibrium situations. For example, the temperature distrubution after a long time a passed, or the electric fieldproduced by stationary charges are solutions of Laplaces equation.

    These are all second order equations because there are at most two derivatives applied to the unknown function.

    These equations are also all linear. This means that if u1(x; y; z; t) and u2(x; y; z; t) are solutions then so is thelinear combination a1u1(x; y; z; t)+ a2u2(x; y; z; t). This fact is sometimes called the superpostion principle. Forexample, if u1 and u2 both satisfy the heat equation, then

    @

    @t(a1u1 + a2u2) = a1

    @u1@t

    + a2@u2@t

    = a12u1 + a22u2= 2(a1u1 + a2u2)

    Thus the linear combination a1u1 + a2u2 solves the heat equation too. This reasoning can be extended to a linearcombination of any number, even infinitely many, solutions.

    Here is how the superposition principle is applied in practice. We try to get a good supply of basic solutionsthat satisfy the equation, but not neccesarily the desired boundary condition or the initial condition. These basicsolutions are obtained by a technique called separation of variables. Then we try to form a (possibly infinite)linear combination of the basic solutions in such a way that the initial condition and boundary condition aresatisfied as well.

    Problem 1.2: Show that for each xed n, m and l the function

    e2m;n;lt sin(nx=10) sin(mx=10) sin(lx=10)

    is a solution of the heat equation. What is the boundary condition satised by these functions? Is this boundary

    condition preserved when we form a linear combination of these functions? Notice that the solution T aboveis an innite linear combination of these functions, together with constant function 100.

    Problem 1.3: What is the limiting temperature distribution in the example as t ! 1? Show that is an(admitedly pretty trivial) solution of the Laplace equation.

    Problem 1.4: When there is only one space variable, then Laplaces equation is the ordinary dierentialequation u00 = 0 rather than a partial dierential equation. Write down all possible solutions.

    If you have taken a course in complex analysis, you will know that the real part (and the imaginary part) of

    every analytic function is a solution to Laplaces equation in two variables. Thus there are many more solutions

    to Laplaces equations when it is a PDE.

  • 4 Math 257 and 316

    What else is in this course?

    The series arising in the solutions of the basic equations are often Fourier series. Fourier series are of independentinterest, and we will devote some time at the beginning of this course studying them.

    Fourier series expansions can be considered as special cases of expansions in eigenfunctions of Sturm-Liouvilleproblems. More general Sturm-Liouville expansions arise when considering slighly more complicated (andrealistic) versions of the basic equations, or when using non-Cartesian co-ordinate systems, such as polar co-ordinates. We will therefore spend some time looking at Sturm-Liouville problems.

  • Math 257 and 316 5

    Fourier series

    Consider a function f(x) of one variable that is periodic with period L. This means that f(x + L) = f(x) forevery x. Here is a picture of such a function.

    L 2L 3L

    Such a function is completely determined by its values on any interval of length L, for example [0; L] or[L=2; L=2]. If we start with any function defined on an interval of length L, say [0; L],

    L 2L 3L

    we can extend it to be a periodic function by simply repeating its values.

    L 2L 3L

    Notice, however, that the periodic extention will most likely have a jump at the points where it is glued together,and not be a continuous function.

    The Fourier series for f is an infinite series expansion of the form

    f(x) =a02

    +1X

    n=1

    an cos(2nx=L) + bn sin(2nx=L)

    Each function appearing on the right sidethe constant function 1, the functions cos(2nx=L) and the functionssin(2nx=L) for n = 1; 2; 3; : : :are all periodic with periodL. Apart form this, though, there is not any apparentreason why such an expansion should be possible.

    For the moment, we will just assume that it is possible to make such an expansion, and try to determine whatthe coefficients an and bn must be. The basis for this determination are the following integral formulas, calledorthogonality relations. Z L

    0

    cos(2nx=L)dx =Z L

    0

    sin(2nx=L)dx = 0 for every n (2:2)

  • 6 Math 257 and 316

    Z L0

    cos(2nx=L) sin(2mx=L)dx = 0 for every n and m (2:3)

    Z L0

    sin(2nx=L) sin(2mx=L)dx =nL=2 if n = m0 otherwise

    (2:4)

    Z L0

    cos(2nx=L) cos(2mx=L)dx =nL=2 if n = m0 otherwise

    (2:5)

    Notice that we can changeR L0 to

    R L=2L=2 (or to the integral over any other interval of length L) without changing

    the values of the integrals. This can be seen geometrically: the area under the curve of a periodic function betweenx = L=2 and x = L is the same as the area under the curve betweenL=2 and x = 0, so we can shift that part ofthe integral over.

    If we want to determine am (for m 1) we first multiply both sides of (2.1) by cos(2mx=L) and integrate. Thisgives

    Z L0

    cos(2mx=L)f(x)dx =a02

    Z L0

    cos(2mx=L)dx+

    Z L0

    1Xn=1

    an cos(2mx=L) cos(2nx=L) + bn cos(2mx=L) sin(2nx=L)

    !dx

    Now we change the order of summation and integration. This is not always justfied (i.e., summing first and thenintegrating could give a different answer than integrating first and then summing). However, at the moment, wedont really even know that the Fourier series converges, and are just trying to come up with some formula foram. So we will go ahead and make the exchange, obtaining

    Z L0

    cos(2mx=L)f(x)dx =a02

    Z L0

    cos(2mx=L)dx+

    1Xn=1

    an

    Z L0

    cos(2mx=L) cos(2nx=L)dx+ bnZ L

    0

    cos(2mx=L) sin(2nx=L)dx

    Using the orthogonality realtions, we see that all the terms are zero except the one with n = m. Thus

    Z L0

    cos(2mx=L)f(x)dx = amZ L

    0

    cos2(2mx=L)dx = amL=2

    so that

    am =2L

    Z L0

    cos(2mx=L)f(x)dx:

    Similary, multiplying (2.1) by sin(2mx=L), integrating, changing the order of summation and integration, andusing the orthogonality relations, we obtain

    bm =2L

    Z L0

    sin(2mx=L)f(x)dx:

    Finally, if we multiply (2.1) by 1 (which does nothing, of course) and follow the same steps we get

    a0 =2L

    Z L0

    f(x)dx

  • Math 257 and 316 7

    (This can also be written 2=LR L0

    cos(20x=L)f(x)dx, and agrees with the formula for the other ams. This is thereason for the factor of 1=2 in the a0=2 term in the original expression for the Fourier series.)

    Examples

    Given a periodic function f (or a function on [0; L] which we extend periodically) we now have formulas for thecoefficients an and bn in the fourier expansion. We can therefore compute all the terms in the fourier expansion,and see if it approximates the original function.

    Lets try this for a triangular wave defined on [0; 1] by

    f(x) =x if 0 x 1=21 x if 1=2 x 1

    0 1

    1

    In this example L = 1. Using the formulas from the last section we have

    a0 = 2Z 1

    0

    f(x)dx = 1=2

    (since the area under the triangle is 1=4). For n 1 we obtain (after some integration by parts)

    an = 2Z 1

    0

    cos(2nx)f(x)dx

    = 2Z 1=2

    0

    cos(2nx)xdx + 2Z 1

    1=2

    cos(2nx)(1 x)dx

    = ((1)n 1)=(2n2)

    =

    0 if n is even2=(2n2) if n is odd

    and

    bn = 2Z 1

    0

    sin(2nx)f(x)dx

    = 2Z 1=2

    0

    sin(2nx)xdx + 2Z 1

    1=2

    sin(2nx)(1 x)dx

    = 0

    Thus, if the Fourier series for f(x) really does converge to f(x) we have,

    f(x) =14 2

    1Xn=1nodd

    12n2

    cos(2nx)

    =14 2

    1Xn=0

    12(2n+ 1)2

    cos(2(2n+ 1)x)

  • 8 Math 257 and 316

    Does the series converge to f? We can try to look at the partial sums and see how good the approximation is.Here is a graph of the first 2, 3 and 7 non-zero terms.

    0.1

    0.2

    0.3

    0.4

    1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2x

    2 non zero terms

    0.1

    0.2

    0.3

    0.4

    1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2x

    3 non zero terms

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    1 0.8 0.6 0.4 0.2 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2x

    7 non zero terms

    It looks like the series is converging very quickly indeed.

    Lets try another example. This time we take L = 2 and f(x) to be a square wave given by

    f(x) =

    1 if 0 x < 10 if 1 x 2

    0 2 31

    1

    Notice that this function is not continous at x = 1, and since we should be thinking of it as a periodic functionwith period 2, it is also not continuous at x = 0 and x = 2. Using the formulas from the previous section we find

    a0 = 1

  • Math 257 and 316 9

    an =22

    Z 20

    cos((2nx)=2)f(x)dx

    =Z 1

    0

    cos(nx)dx

    = 0

    bn =22

    Z 20

    sin((2nx)=2)f(x)dx

    =Z 1

    0

    sin(nx)dx

    = (1 (1)n)=(n)

    =

    0 if n is even2=(n) if n is odd

    Thus, if the series for this f exists, it is given by

    f(x) =12

    +1X

    n=1nodd

    2n

    sin(nx)

    =12

    +1X

    n=0

    2(2n+ 1)

    sin((2n+ 1)x)

    Here are the graphs of the first 2, 3, 7 and 20 non-zero terms in the series.

    0

    0.2

    0.4

    0.6

    0.8

    1

    2 1 1 2 3 4 5x

    2 non zero terms

    0

    0.2

    0.4

    0.6

    0.8

    1

    2 1 1 2 3 4 5x

    3 non zero terms

    0

    0.2

    0.4

    0.6

    0.8

    1

    2 1 1 2 3 4 5x

    7 non zero terms

  • 10 Math 257 and 316

    0

    0.2

    0.4

    0.6

    0.8

    1

    2 1 1 2 3 4 5x

    20 non zero terms

    The series seems to be converging, although the convergence doesnt seem so good near the discontinuities.The fact that there is a bump near the discontinuity is called Gibbs phenonemon. The bump moves closer andcloser to the point of discontinuity as more and more terms in the series are taken. So for any fixed x, the bumpeventually passes by. But it never quite goes away. (For those of you who know about uniform convergence: thisis an example of a series that converges pointwise but not uniformly.)

    Problem 2.1: Compute the coecents an and bn when L = 1 and

    f(x) =

    1 if 0 x 1=21 if 1=2 < x 1

    Problem 2.2: Compute the coecents an and bn when L = 2 and

    f(x) = x if 0 x 2

    The Fourier theorem

    Suppose that f(x) is a function for which the integrals defining the coefficients an and bn exist. This would betrue, for example, if f is continuous. Then it is possible to define the Fourier series for f . Does this Fourier seriesconverge to f?

    It turns out the answer is: not always! The existence of Gibbs phenonmenon might make you suspect that thingsare not completely simple. And in fact, the complete answer is very complicated. However, for most functionsencountered in practice, the Fourier series does converge. Here is a theorem.

    Theorem 2.1 Suppose that f(x) is a periodic function with period L, and that both f and its derivative f 0

    are continuous. Then the Fourier series for f converges to f .

    This theorem is nice, but doesnt cover either of the examples above. For the triangle wave, f is continuous, butf 0 is not. And for the square wave neither f nor f 0 is continuous.

    Denition: A function f(x) is called piecewise continuous if there are finitely many points x0; x1; : : : ; xk suchthat f is continous on each interval between the points xi and f has finite limits from the left and the right (whichneed not be equal) at each of the points xi. Here is a typical piecewise continuous function. The value of thefunction right at the points xi is irrelevant.

  • Math 257 and 316 11

    0 1

    1

    x x0 1

    Theorem 2.2 Suppose that f(x) is a periodic function with period L, and that both f and its derivative f 0

    are piecewise continuous on each interval of length L. Then at all points of continuity x the Fourier seriesevaluated at x converges to f(x). At the nitely many points of discontinuity xk, the Fourier series evaluatedat xk converges to the average of the limits from the right and the left of f , i.e., to (f(xk+) + f(xk))=2.

    Although we wont be able to prove this theorem in this course, here is some idea how one would go about it.Let Fn(x) be the partial sum

    Fm(x) =a02

    +mX

    n=1

    an cos(2nx=L) + bn sin(2nx=L)

    Our goal would be to show that Fm(x) ! f(x) as m!1. If we substitute the formulas for an and bn we get

    Fm(x) =12

    2L

    Z L0

    f(y)dy

    +mX

    n=1

    2L

    Z L0

    cos(2my=L)f(y)dy

    !cos(2nx=L) +

    2L

    Z L0

    sin(2my=L)f(y)dy

    !sin(2nx=L)

    =Z L

    0

    1L

    +2L

    mXn=1

    cos(2mx=L) cos(2ny=L) + sin(2mx=L) sin(2ny=L)

    !f(y)dy

    =Z L

    0

    1L

    +2L

    mXn=1

    cos(2m(x y)=L)!f(y)dy

    =Z L

    0

    Km(x y)f(y)dy

    where

    Km(x y) = 1L

    +2L

    mXn=1

    cos(2m(x y)=L)

    to understand whyFm(x) should converge to f(x) we have to examine the functionKm(xy). Here is a picture(with m = 20, x = 0 and L = 1).

    0

    10

    20

    30

    40

    0.4 0.2 0.2 0.4x

  • 12 Math 257 and 316

    Notice that there is a big spike when y is close to x. The area under this spike is approximately 1. For values of yaway from x, the function is oscillating. Whenm gets large, the spike get concentrated closer and closer to x andthe the oscillations get more and more wild. SoZ L

    0

    Km(x y)f(y)dy =Z

    y close to xKm(x y)f(y)dy +

    Zy far from x

    Km(x y)f(y)dy

    When m is very large we can restrict the first integral over y values that are so close to x that f(y) is essentiallyequal to f(x). Then we haveZ

    y close to xKm(x y)f(y)dy

    Zy close to x

    Km(x y)f(x)dy = f(x)Z

    y close to xKm(x y)dy f(x)

    because the area under the spike is about 1. On the other handZy far from x

    Km(x y)f(y)dy 0

    for large m since the wild oscillations tend to cancel out in the integral. To make these ideas exact, one needs toassume more about the function f , for example, the assumptions made in the theorems above.

    Complex form

    We will now the Fourier series in complex exponential form.

    f(x) =1X

    n=1cne

    i2nx: (2:6)

    (To simplify the formulas, we will assume that L = 1 in this section.) Recall that

    eit = cos(t) + i sin(t):

    Therefore

    cos(t) =eit + eit

    2

    sin(t) =eit eit

    2i:

    To obtain the complex exponential form of the fourier series we simply substitute these expressions into theoriginal series. This gives

    f(x) =a02

    +1X

    n=1

    an2(ei2nx + ei2nx

    +bn2i(ei2nx ei2nx

    =a02

    +1X

    n=1

    an2

    +bn2i

    ei2nx +

    an2 bn

    2i

    ei2nx

    =1X

    n=1cne

    i2nx

    wherec0 =

    a02

    cn =an2

    +bn2i

    for n > 0

    cn =an2

    bn2i

    for n < 0:

  • Math 257 and 316 13

    This complex form of the Fourier series is completely equivalent to the original series. Given the ans and bnswe can compute the cns using the formula above, and conversely, given the cns we can solve for

    a0 = 2c0an = cn + cn for n > 0bn = icn icn for n > 0

    It is actually often easier to compute the cns directly. To do this we need the appropriate orthogonality relationsfor the functions ei2nx. They are

    Z 10

    ei2mxei2nxdx =Z 1

    0

    ei2(nm)xdx =n

    0 if n 6= m1 if n = m

    So to pick out the coefficient cm in the complex Fourier series, we multiply (2.6) by ei2mx and integrate. Thisgives (after exchanging the integral and the infinite sum)

    Z 10

    ei2mxf(x)dx =1X

    n=1cn

    Z 10

    ei2mxei2nxdx = cm

    Lets compute the complex Fourier series coefficients for the square wave function

    f(x) =

    1 if 0 x 1=21 if 1=2 < x 1

    If n = 0 then ei2nx = e0 = 1 so c0 is simply the integral of f .

    c0 =Z 1

    0

    f(x)dx =Z 1=2

    0

    1dxZ 1

    1=2

    1dx = 0

    Otherwise, we have

    cn =Z 1

    0

    ei2nxf(x)dx

    =Z 1=2

    0

    ei2nxdxZ 1

    1=2

    ei2nxdx

    =ei2nx

    i2nx=1=2x=0

    ei2nx

    i2nx=1x=1=2

    =2 2ein

    2in

    =

    0 if n is even2=in if n is odd

    Thus we conclude that

    f(x) =1X

    n=1nodd

    2in

    ei2nx

    We can deduce the original form of the Fourier series from this. Using an = cn + cn and bn = icn icn wefind that an = 0 for all n, bn = 0 for n even and bn = 4=n for n odd. Thus

    f(x) =1X

    n=1nodd

    4n

    sin(2nx) =1X

    n=0

    4(2n+ 1)

    sin(2(2n+ 1)x)

  • 14 Math 257 and 316

    Problem 2.3: Calculate the formula for the cns when L is dierent from 1. Use your formula to computethe coecents cn when L = 2 and

    f(x) = x if 0 x 2Calculate an and bn from your expression for the cn and compare to the result obtained in a previous problem.

    Even and Odd functions

    A function f(x) is called even if f(x) = f(x) and odd if f(x) = f(x) Here is are picture of an even functionand an odd function.

    x

    f(x)

    x

    f(x)

    If we multiply together two even functions or two odd functions, the result is an even function. If we multiplytogether and odd and an even function, the result is an odd function.

    The integral of an odd function over an interval that is symmetric with respect to the origin is zero. This can beseen geometrically:

    x

    f(x)

    A

    -AB

    -B-a a

    The integral from a to a of this odd function is zero, since the positive areas on one side of the origin cancel thenegative ones on the other side. Similarly, the integral from a to a of an even function is just twice the integralof the same function. Thus Z a

    aodd(x)dx = 0

    Z aa

    even(x)dx = 2Z a

    0

    even(x)dx

    These ideas can be applied to the calculation of Fourier coefficients because cos(2nx=L) is an even function (forevery n) and sin(2nx=L) is an odd function (for every n). Recall that the interval of integration appearing in thedefinition of an and bncan be any interval of length L. Before we chose [0; L]. But now, to apply the formulas forodd and even functions we want an interval that is symmetric about zero. So we choose [L=2; L=2] and write

    an =2L

    Z L=2L=2

    cos(2nx=L)f(x)dx;

    bn =2L

    Z L=2L=2

    sin(2nx=L)f(x)dx:

  • Math 257 and 316 15

    If f(x) is even, then cos(2nx=L)f(x) is also even and sin(2nx=L)f(x) is odd. Thus

    an =4L

    Z L=20

    cos(2nx=L)f(x)dx;

    bn = 0:

    If f(x) is odd, then cos(2nx=L)f(x) is odd and sin(2nx=L)f(x) is even. Thus

    an = 0;bn =

    4L

    Z L=20

    sin(2nx=L)f(x)dx:

    Example

    Let us compute the Fourier coeffients of the function f(x) with period L = 2 given by

    f(x) =

    8 1

    bn =21

    Z 10

    sin(2nx)xdx = 1=(n)

    and the seriesa02

    +1X

    n=1

    an cos(2nx) + bn sin(2nx) =12

    1Xn=1

    1n

    sin(2nx) (2:7)

    converges to a periodic function of period 1 that agrees with f(x) = x on [0; 1] (except right at the discontinuity,where the Fourier series converges to 1=2). Here is a picture of the Fourier series.

    Next, we will start with the same function f(x) = x on the interval [0; 1], but first extend it to be an odd functionon [1; 1], and then extend it to be a periodic function of period L = 2. The complete extension looks like

  • Math 257 and 316 17

    What is the Fourier series for this function. Well, now L = 2 and the function is odd. So all the ans are zero, and

    bn =42

    Z 10

    sin(nx)xdx = 2(1)n+1=(n)

    So the series is 1Xn=1

    bn sin(nx) =1X

    n=1

    2(1)n+1n

    sin(nx) (2:8)

    This is called the sine series for f . It converges to the periodic function with period L = 2 depicted above (exceptfor the points of discontinuity, where it converges to the midpoint).

    Finally, we start again with the same function f(x) = x on the interval [0; 1], extend it to be an even function on[1; 1], and then extend it to be a periodic function of period L = 2. The complete extension now looks like

    This is an even function with L = 2. So all the bns are now zero, while the ans are given by

    42

    Z 10

    cos(nx)xdx =

    1 if n = 02((1)n 1)=(2n2) if n 1

    Therefore the seriesa02

    +1X

    n=1

    an cos(nx) =12

    +1X

    n=1

    2(1)n 12n2

    cos(nx) (2:9)

    converges to the periodic function depicted above. This is called the cosine series.

    If we restrict our attention to values of x in the interval [0; 1] we have produced three different expansions for thesame function, namely (2.7), (2.8) and (2.9). (One could produce even more, by making different extensions.) Wewill see that all these series are useful in solving PDEs.

    Problem 2.8: Which of the expansions (2.7), (2.8), (2.9) converges the fastest? Which of the resulting periodicfunctions are continuous?

    Problem 2.9: Compute the sine and cosine series for

    f(x) =

    1 if 0 x 1=21 if 1=2 < x 1

    Problem 2.10: Suppose f(x) is a function dened on [0; a] (rather than [0; 1]). What are the sine andcosine series for this function. Write down the formulas for the coecients.

  • 18 Math 257 and 316

    Innite orthogonal bases

    Lets write down functions appearing on the right side of the expansions of the previous section. We have

    f12; cos(2x); cos(4x); cos(6x); : : : sin(2x); sin(4x); sin(6x); : : :g

    for (2.7),fsin(x); sin(2x); sin(3x); : : :g

    for (2.8) and

    f12; cos(x); cos(2x); cos(3x); : : :g

    for (2.9). We could also add the set

    f: : : ; e4ix; e2ix; e0ix; e2ix; e4ix; : : :g

    for the complex Fourier series.

    We can think of these lists of functions f1(x); 2(x); 3(x); : : :g as infinite bases in a vector space of functions.A given function f(x) on the interval [0; 1] can be expanded in an infinite sum

    f(x) =X

    i

    aii(x)

    for each of these sets. This is analgous to expanding a given vector with respect to various bases in a vector space.

    To understand this analogy, think back to your last linear algebra course. A collection of vectors in a vector spaceform a basis if they span the space (that is, every vector can be written as a linear combination of basis vectors)and are linearly independent (that is, there is exaclty one way to write this linear combination). Three non-zerovectors fv1;v2;v3g in three dimensional space form a basis if they dont all lie in the same plane. In this case anarbitrary vector v can be expanded in a unique way as a linear combination

    v = a1v1 + a2v2 + a3v3

    However, for a general basis, its not that easy to find the coefficients, a1, a2 and a3. Finding them requires solvinga system of linear equations.

    Things are much easier if the basis is an orthogonal basis. This means that the inner (dot) product hvi;vji is zeroif i 6= j. In this case we can find the coefficients ai by taking inner products. For example, to find a1, we take theinner product with v1. This gives

    hv1;vi = a1hv1;v1i+ a2hv1;v2i+ a3hv1;v3i= a1hv1;v1i+ 0 + 0

    Thusa1 = hv1;vi=hv1;v1i

    The sets of functions above can be thought of as infinite orthogonal bases for a vector space of functions. (Imbeing a bit vague on exactly what functions are allowed, certainly all functions that are piecewise continuouswith continuous derivative are included.)

    What is the inner product of two functions f(x) and g(x)? It is given by the integral

    hf; gi =Z 1

    0

    f(x)g(x)dx

  • Math 257 and 316 19

    (The complex conjugate f is only relevant if f is complex valued. If f is real valued then f = f .) With thisdefinition of inner product each of the sets of functions are orthorgonal bases. This can be verified directly. Forexample, for n and m positive

    Z 10

    sin(nx) sin(mx)dx =14

    Z 10

    (einx einx)(eimx eimx)dx

    =14

    Z 10

    ei(n+m)x ei(nm)x ei(n+m)x + ei(nm)xdx

    For any integer l Z 10

    eilx =

    (1 if l = 0eilx

    il

    1x=0

    = (1)l1

    il if l 6= 0

    Using this, its not hard to see that

    Z 10

    sin(nx) sin(mx)dx =

    12 if n = m0 if n 6= m

    Now we can find the co-efficients in the sine expansion

    f(x) =X

    bn sin(nx)

    directly, namely

    bn = hsin(nx); f(x)i=hsin(nx); sin(nx)i = 2Z 1

    0

    sin(nx)f(x)dx

    Problem 2.11: Verify that v1 = [1; 0; 1], v2 = [1; 0;1] and v3 = [0; 1; 0] form an orthgonal bases.Find the coecients ai in the expansion v = a1v1 + a2v2 + a3v3 when v = [1; 2; 3].

    Problem 2.12: Expand the function f(x) = 1 in a sine series on the interval 0 x 1.

    Problem 2.13: Expand the function f(x) = sin(x) in a cosine series on the interval 0 x 1.

    Symmetric operators, eigenvalues and orthogonal bases

    There is a much more profound analogy between the infinite bases listed above and linear algebra. Let A be ann n matrix. Recall that a vector v is called an eigenvector for A with eigenvalue if

    Av = v

    Recall that A is called symmetric (or, more generally, in the case of complex matrices, hermitian) if

    hx; Ayi = hAx;yi

    (an equivalent condition is thatAT = A (symmetric) or AT = A (hermitian)). There is the following theorem.

  • 20 Math 257 and 316

    Theorem 2.3 If A is a symmetric (hermitian) nn matrix then all the eigenvalues of A are real, and thereis an orthogonal basis of eigenvectors.

    The infinite dimensional analogue of the matrix A will be the operator d2=dx2together with a boundarycondition. (Later on we will also consider more general operators.) When A is a matrix and v is a vector, then Aacts on v by matrix multiplication, producing the new vectorAv. When A is d2=dx2 and (x) a function, thenA acts on by differentiation, producing the new function A = 00. In both cases the action of A is linear.

    Going back to the infinite orthonormal bases in the last section, we can now see that they all consist of eigenfunc-tions of d2=dx2. For example

    d2=dx2 cos(2nx) = (2n)2 cos(2nx)so cos(2nx) is an eigenfunction with eigenvalue (2n)2. (By the way, the reason for the minus sign ind2=dx2is to make the eigenvalues positive.) Similarly

    d2=dx2e2inx = (2n)2e2inx

    and so on, for all the functions appearing.

    Something seems fishy, though. Recall that for a matrix, any two eigenvectors corresponding to differenteigenvalues are orthogonal. While this is true if we pick two eigenfunctions from the same list, it is not true if wepick one eigenfunction from one list and one from another. For example sin(x) (eigenvalue2) is not orthogonalto 1 (eigenvalue 0) since

    R 10 sin(x)dx 6= 0.

    To explain this, lets try to check whether the operator d2=dx2 is symmetric. Using integration by parts we find

    hf; d2

    dx2gi =

    Z 10

    f(x)g00(x)dx

    = f(x)g0(x)10+Z 1

    0

    f 0(x)g0(x)dx

    = f(x)g0(x)10+ f 0(x)g(x)

    10Z 1

    0

    f 00(x)g(x)dx

    = f(1)g0(1) + f(0)g0(0) + f 0(1)g(1) f 0(0)g(0) + h d2

    dx2f; gi

    So we see that there are boundary terms spoiling the symmetry of the operator. To get these boundary term todisappear, we can impose boundary conditions on the functions f and g. For example we can impose

    Dirichlet boundary conditions: functions vanish at the endpoints, i.e., f(0) = f(1) = g(0) = g(1) = 0Neumann boundary conditions: derivatives vanish at the endpoints, i.e., f 0(0) = f 0(1) = g0(0) = g0(1) = 0 periodic boundary conditions: functions (and derivatives) are periodic, i.e., f(0) = f(1), f 0(0) = f 0(1),

    g(0) = g(1) and g0(0) = g0(1)

    The imposition of any one of these boundary conditions makes d2=dx2 a symmetric operator.So the correct analog of a hermitian matrixA is not just the operatord2=dx2, it is the operatord2=dx2 togetherwith suitable boundary condtions, like Dirichlet, Neumann or periodic boundary conditions. (Im saying exactlywhat constitutes a suitable set of boundary conditions here, and am sweeping some technical points under therug.)

    If we insist that all the eigenfunctions obey the same boundary conditions (Dirichlet, Neumann or periodic),then it is true that all the eigenvalues are real, and eigenfunctions corresponding to different eigenvalues areorthogonal. The proofs are exactly the same as for matrices.

    Now let us try to determine the eigenfunctions and eigenvalues ofd2=dx2 with Dirichlet boundary conditionson the interval [0; 1].

    Theorem 2.4 The eigenfunctions of d2=dx2 with Dirichlet boundary conditions on the interval [0; 1] arethe functions sin(x); sin(2x); sin(3x); : : :.

  • Math 257 and 316 21

    Proof: We want to determine all functions (x) satisfying

    00(x) = (x) (2:10)for some and obeying Dirichlet boundary conditions. We know that must be real. Suppose that is negative.Then = 2 and the general solution to (2.10) is

    (x) = aex + bex

    for arbitrary constants a and b. If we insist that the (0) = (1) = 0, then

    0 = a+ b0 = ae + be

    This system of linear equations has no solutions other than the trivial solution a = b = 0. Thus there are noeigenfunctions with negative (the zero function doesnt qualilfy, just as the zero vector doesnt count as aneigenvector for a matrtrix.)

    Next we try = 0. In this case(x) = ax+ b

    for arbitrary constants. If we insist that (0) = 0 then b = 0. Then (1) = a, so (1) = 0 forces a = 0 too. Thus = 0 is not an eigenvalue.

    Finally we try positive . Then = 2 and

    (x) = a sin(x) + b cos(x)

    for arbitrary constants a and b. Now (0) = b so if we impose (0) = 0 then b = 0 and (x) = a sin(x). If wefurther insist that (1) = 0, then a() = 0. This can happen in two ways. Either a = 0, in which case = 0.This we dont want. But a() = a sin(). This will be zero if = n for an integer n. We can rule out n = 0,since this implies = 0. Two eigenfunctions are counted as the same if they are multiples of each other. Sincesin(n) = sin(n), n and n give the same eigenfunctions, and so we may assume n > 0. Also we can seta = 1. Thus the eigenfunctions are

    sin(x); sin(2x); sin(3x); : : :

    as claimed.

    Problem 2.14: Show that the eigenvalues of a symmetric operator (or matrix) are real, and that eigenfunction(or eigenvectors) corresponding to dierent eigenvalues are orthogonal. (You can nd these proofs in any linear

    algebra text.)

    Problem 2.15: Show that the functions 1; cos(x); cos(2x); cos(3x); : : : are the eigenfunctions ofd2=dx2 with Neumann boundary conditions.

    The infinite bases

    f1; cos(2x); cos(4x); cos(6x); : : : sin(2x); sin(4x); sin(6x); : : :gand

    f: : : ; e4ix; e2ix; e0ix; e2ix; e4ix; : : :gare both orthogonal bases for d2=dx2 with periodic boundary conditions. In this case each eigenvalue hasmultiplicity 2.

    The complex basis functions f: : : ; e4ix; e2ix; e0ix; e2ix; e4ix; : : :g are special, because not only are theyeigenfunctions for the second derivative d2=dx2, but also for the first derivative d=dx.

  • 22 Math 257 and 316

    Smoothness and decrease of Fourier coecients

    Consider a function f(x), periodic with period 1 with Fourier series

    f(x) =1X

    n=1cne

    2inx

    All the information about the function f must somehow be encoded in the Fourier coefficients, since knowingthe cis is equivalent to knowing the function f . One property of the function which is easy to read off from theFourier coefficients is the degree of smoothness. Rough or discontinuous functions will have Fourier coefficientscn that become small very slowly as jnj becomes large. On the other hand, smoothly varying functions will havecn which tend to zero very quickly as jnj becomes large.Lets see how this works in some examples. Lets consider the three functions f , g and h given by

    f(x) =

    1 if 0 x 1=21 if 1=2 < x 1 g(x) =

    x if 0 x 1=21 x if 1=2 < x 1 h(x) = e

    cos(2x) cos(sin(2x))

    1

    0.5

    0.5

    1

    0.5 1 1.5 2

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.5 1 1.5 2

    0.5

    1

    1.5

    2

    2.5

    0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2x

    Notice that f is not continuous, g is continuous but not differentiable, and h is very smooth, and can bedifferentiated any number of times. Now lets consider the Fourier coefficients of these functions. They are giveby

    f g h

    cn =

    0 if n is even2=(in) if n is odd cn =

    8 x1 if x y

    and then extended periodically with period 1 in both directions. Here is a picture of f and its periodic extension.The shaded area is where f is equal to 1 and the white area where f is 0.

    x

    y

    1 2 3

    1

    2

    x

    y

    1 2 3

    1

    2

    We have

    cn;m =Z 1

    0

    Z 1y

    e2i(nx+my)dxdy

    If n = m = 0 then

    c0;0 =Z 1

    0

    Z 1y

    dxdy = 1=2

    If n = 0 and m 6= 0 then (changing the order of integration)

    c0;m =Z 1

    0

    Z x0

    e2imydydx

    =Z 1

    0

    e2imy

    2imxy=0

    dx

    =1

    2imZ 1

    0

    (e2imx 1)dx

    =1

    2im

  • Math 257 and 316 25

    If n 6= 0 and m = 0 thencn;0 =

    Z 10

    Z 1y

    e2nxdxdy

    =Z 1

    0

    e2inx

    2in1x=y

    dy

    =1

    2inZ 1

    0

    (1 e2iny)dy

    =1

    2inIf n+m = 0 (i.e., m = n) but n 6= 0 then

    cn;n =Z 1

    0

    Z 1y

    e2inye2inxdxdy

    =Z 1

    0

    e2nye2inx

    2in1x=y

    =1

    2inZ 1

    0

    e2ny(1 e2iny)dy

    =1

    2inZ 1

    0

    (e2ny 1)dy

    =1

    2in

    Otherwise (i.e., n 6= 0, m 6= 0, n+m 6= 0)

    cn;m =Z 1

    0

    Z 1y

    e2imye2inxdxdy

    =Z 1

    0

    e2imye2inx

    2in1x=y

    =1

    2inZ 1

    0

    e2imy e2i(m+n)y

    = 0

    It is interesting to relate the directions in n;m space where the Fourier coefficients are large to the directionswhere f has discontinuities. In this example, most of the cm;ns are zero. But in the places that they are non-zero,they are quite large. Here is a picture of f together with a picture of where the cn;ms are non-zero.

    x

    y

    1 2 3

    1

    2

    n

    m

    Notice how each cliff-like discontinuity in f produces a line of large cn;ms at right angles to the cliff. And noticealso that you have to consider discontinuities in the periodic extension of f (i.e., you have to take into accountthe horizontal and vertical cliffs, and not just the diagonal one.)

  • 26 Math 257 and 316

    We can consider double Fourier sine series and cosine series as well (and even mixtures, doing one expansion inone direction and one expansion in the other). For the double sine series, we obtain

    f(x; y) =1X

    n=1

    1Xm=1

    bn;m sin(nx) sin(my)

    with

    bn;m = 4Z 1

    0

    Z 10

    sin(nx) sin(my)f(x; y)dxdy

    and the analogous formula holds for the cosine series.

    For the double sine series, the functions n;m(x; y) = sin(nx) sin(my) can be considered to be eigenfunctionsof (minus) the Laplace operator with Dirichlet (zero) boundary conditions on the boundary of the square. This isbecause when x is 0 or 1 or y is 0 or 1 (i.e., on the boundary of the square), n;m(x; y) = 0 and

    n;m(x; y) = (@2=@x2 + @2=@y2) sin(nx) sin(my)= 2(n2 +m2) sin(nx) sin(my)

    Problem 2.16: Show that the function (x; y) = e2i(nx+my) is an eigenfunction of (minus) the Laplaceoperator in two dimensions (i.e., = @2=@x2@2=@y2) satisfying periodic boundary conditions in bothdirections (i.e., (x+ 1; y) = (x; y) and (x; y + 1) = (x; y). What is the eigenvalue?

    Problem 2.17: Expand the function dened on the unit square 0 x 1, 0 y 1 by

    f(x; y) =

    0 if y > x1 if x y

    in a double sine series

    Problem 2.18: Expand the same function in a double cosine series

    Problem 2.19: Expand the function dened on the unit square 0 x 1, 0 y 1 by

    f(x; y) =n

    1 if x < 1=2 and y < 1=20 otherwise

    in a double complex Fourier series.

    The discrete Fourier transform

    Suppose that we dont know the function f everywhere on the interval, but just at N equally spaced discretepoints 0; 1=N; 2=N; : : : ; (N 1)=N . Define fj = f(j=N) Then we can write down an approximation for cn byusing the Riemann sum in place of the integral. Thus we define the cks for the discrete Fourier transform to be

    ck =1N

    N1Xj=0

    ei2kj=N fj

  • Math 257 and 316 27

    The first thing to notice about this is that although the formula makes sense for all k, the cks start repeatingthemselves after a while. In fact ck+N = ck for all k. This follows from the fact that ei2j = 1 which impliesthat ei2(k+N)j=N = ei2kj=N ei2j = ei2kj=N , so the formulas for ck and ck+N are the same. So we mightas well just compute c0; : : : ; cN1.

    Next, notice that the transformation that sends the vector [f0; : : : ; fN1] to the vector [c0; : : : ; cN1] is a lineartransformation, given by multiplication by the matrix F = [Fk;j ] with Fk;j = 1N e

    i2kj=N . If we definew = ei2=N then the matrix has the form

    F =1N

    266664

    1 1 1 11 w w2 wN11 w2 w4 w2(N1)...

    ......

    ...1 wN1 w2(N1) w(N1)(N1)

    377775

    To compute the inverse of F we use the following fact about roots of unity. A complex number z is a N th root ofunity if zN = 1 of zN 1 = 0. There are N such numbers, given by 1; ei2=N ; ei22=N ; : : : ; ei2(N1)=N , or1; w; w2; : : : ; wN1. The following factorization

    zN 1 = (z 1)(1 + z + z2 + + zN1)

    (which you can check by just multiplying out the right side) implies that for any N th root of unity z that isdifferent from 1, we have

    (1 + z + z2 + + zN1) = 0: (2:11)To see this simply plug z into the factorization. Then the left side is zN 1 = 0, but (z 1) isnt zero, so we maydivide by (z 1).Using (2.11) we can now see that the inverse to F is given by

    F1 =

    266664

    1 1 1 11 w w2 wN11 w2 w4 w2(N1)...

    ......

    ...1 wN1 w2(N1) w(N1)(N1)

    377775

    where w is the complex conjugate of w given by w = ei2=N = 1=w. So we see that the matrix for the inversetransform is the same, except that the factor of 1=N is missing, and i is replaced withi.

    The fast Fourier transform (FFT)

    If you count how many multiplications need to be done when multiplying a vector of length N with and N byN matrix, the answer is N2. So it would be reasonable to assume that it takes N 2 multiplications to computethe discrete Fourier transform. In fact, if N is a power of 2, it is possible to do the computation in using onlyN log(N) multiplications. This is a huge improvement, and any practical applications of the Fourier transformon computers will make use of the FFT. I wont have time to discuss the fast Fourier transform in this course, butI have prepared some notes for Math 307 that are make available on my web page.

  • 28 Math 257 and 316

    An application: which picture is in focus?

    We can consider a a black and white image to be a function f(x; y) of two variables. The value f(x; y) gives theintensity at the point (x; y). For a colour picture there are three functions, one for each of red, green and blue. Ofcourse, for a digital image, these functions are only defined for a discrete set of points, namely the pixels.

    We can define the discrete two dimensional Fourier transform analogously to the one-dimensional case consideredabove. The Fourier coefficients cn;m then depend on two numbers, n and m.

    There is a relation between the size of jcn;mj for large n and m and the sharpness of the image. If the image issharp, then the function f will not be very smooth, but have rapid changes in intensities. Thus the coefficientsfor large n and m. will be large. This fact can be used to focus a camera. The only slightly tricky point for thediscrete Fourier transform is to decide which ns and ms count as large. One might think that N 1 is a largeindex, but cN1 = c1, (were back in the one dimensional case here) and 1 is close to zero, i.e., pretty small.So the largest ns and ms are the ones near N=2. To reflect this fact, its better to plot the jcn;mjs for n and mranging from N=2 to N=2 1.Here are three photos. The discrete Fourier transform of the 64 64 outlined window (the outline might be a bithard to see) is shown in the top left corner. For the Fourier transforms, the darkness indicates the size of jcn;mj.Here we can see that the picture most in focus (on the right) has the most spread out region of Fourier coefficients.

    But what are those dark horizontal and vertical lines in the Fourier transform? This can be explained by the factthat when we take the Fourier transform of a 64 64 subregion, we are in fact repeating the region periodicallyover the whole plane.

    This will introduce artificial horizontal and vertical discontinuities at the edges. The result will be large Fouriercoefficients in the directions normal to these discontinuities. To test this, lets place the window on a place wherethe top of the picture is the same as the bottom. Then, when we tile the plane, the discontinuities will come onlyfrom the sides, and should result in large Fourier coefficients only in the normal (horizontal) direction. Similarly,

  • Math 257 and 316 29

    if the window is moved to where the picture is the same on the left and the right side, the Fourier coefficients arelarge only in the vertical direction.

    From the point of view of the original picture, these horizontal and vertical discontinuities are artificial. We canimprove the situation by taking the (double) cosine transform. This is because, just as in the one dimensionalcase, the cosine transform can be thought of as the Fourier transform of the picture after reflecting it to make aneven function. The even function will not have any discontinuities that are not present in the original picture.

    Image compression

    The (discrete) Fourier transform can also be used for image compression. Recall that the Fourier coefficientscN=2;N=2; : : : ; cN=21;N=21 contain all the information about the picture. So if we store all the coefficients, wewill be able to reconstruct the picture perfectly using the Fourier formula

    fj;k =N=21X

    n=N=2

    N=21Xm=N=2

    cn;me2i(jn+km)=N

    In practice, even for an image in focus, the cn;ms for large n and m will be quite small. So instead of storing allthe cn;ms, we store just 75% or 50% of them. Then, when reconstructing the picture, we simply set the cn;mswhose value we dont know equal to zero.

  • 30 Math 257 and 316

    This idea is behind some of the image compression schemes in use. There are a few more wrinkles, though. Firstof all, the cosine transform is used, for the reason explained above. Secondly, instead of taking the transform ofthe whole picture, the picture is first tiled into small windows, and the transform of each window is computed.

  • Math 257 and 316 31

    The heat equation

    We will now consider the heat equation. The approach we will take to solving follows closely the ideas used insolving the vector equation

    v0(t) = Av(t)with initial condition v(0) = v0, whereA is an nnmatrix. The idea is to expand v(t) in a basis of eigenvectorsof A. The coefficients in the expansion will depend on t. Plugging the expansion into the equation yields anordinary differential equation for each expansion coefficient. This equation has a solution that depends on anarbitrary constant. These arbitrary constants are then adjusted so that the initial condition is fulfilled.

    In the case of heat equation the operatorA is replaced by together with a boundary condition. The expansionsin eigenfunctions will be a Fourier expansion. The new wrinkle is the presence of boundary conditions.

    One space dimension with zero boundary conditions

    We begin with the simplest situation: one space dimension and zero boundary conditions. The experimentalsetup is a long thin rod, insulated except at the ends. The ends of the rod are both kept at a constant temperatureof 0. At time t = 0 we are given the initial temperature distribution of the rod. The goal is to find the temperatureat all later times.

    Let x denote the distance along the rod, which we assume varies between 0 and a. Let u(x; t) for 0 x a andt 0 denote the temperature of the rod at position x and time t. Then u(x; t) will satisfy the heat equation in onedimension

    @u(x; t)@t

    = 2@2u(x; t)@x2

    ;

    the boundary conditionu(0; t) = u(a; t) = 0 for all t > 0

    and the initial conditionu(x; 0) = u0(x)

    where u0(x) is the given initial temperature distribution. The number 2 is determined by the material of whichthe rod is made.

    For every fixed t, we now expand this unknown function u(x; t) in a series of eigenfunctions of @2@x2 . Sincewe want u(x; t) to satisfy zero boundary conditions, we choose eigenfunctions that also satisfy zero (Dirichlet)boundary conditions. These are the sine functions fsin(nx=a)g for n = 1; 2; 3; : : :. Thus the expansion will bea sine series. The (unknown) coefficients will be functions of t. Thus

    u(x; t) =1X

    n=1

    n(t) sin(nx=a)

    To determine u we must determine the coefficients n(t).

    We now plug the expansion into the heat equation. Since

    @u(x; t)@t

    =1X

    n=1

    0n(t) sin(nx=a)

  • 32 Math 257 and 316

    and (here we use the crucial fact that the sine functions are eigenfunctions)

    @2u(x; t)@x2

    u(x; t) =1X

    n=1

    (n=a)2n(t) sin(nx=a)

    the equation will be satisfied if0n(t) = 2(n=a)2n(t)

    This ODE has solutionn(t) = bne

    2(n=a)2t;

    where bn is an arbitrary constant. The function

    1Xn=1

    bne2(n=a)2t sin(nx=a)

    will satisfy the heat equation and the boundary conditions for any choice of the bns. However, we still need tosatisfy the initial condition. The initial condition will hold if

    u(x; 0) =1X

    n=1

    bn sin(nx=a) = u0(x)

    In other words, the bn are the coefficients of u0(x) in a Fourier sine series. We know how to find these (we did itfor a = 1 before). The formula is

    bn =2a

    Z a0

    sin(nx=a)u0(x)dx

    We have now determined u(x; t) completely.

    Example

    Suppose we join a rod of length 1 and constant temperature 100 with a rod of length 1 and constant temperature0. Thereafter, the two ends of the joined rod are kept at 0. Both rods are made of the same metal with 2 = 1.Lets find the temperature function u(x; t).

    Since the ends at x = 0 and x = 2 are kept at 0, u will have an expansion

    u(x; t) =1X

    n=1

    bne2(n=2)2t sin(nx=2):

    The initial condition is

    u0(x) =

    100 if 0 x 10 if 1 x 2

    Thus

    bn =22

    Z 20

    sin(nx=2)u0(x)dx

    = 100Z 10

    sin(nx=2)

    =200n

    (cos(nx=2) 1)

  • Math 257 and 316 33

    Smoothness of solutions to the heat equation

    Recall that the smoothness of a function is encoded in the rate of decrease of the size of the Fourier coefficients asn gets large. For solutions to the heat equation, the Fourier coefficients have the form bne

    2(n=a)2t. Now thecoefficients bn will typically have some decay, corresponding to the smoothness of the initial condition. But assoon as t > 0 there is an extra factor e

    2(n=a)2t that decays extremely rapidly as n gets large. This means thatany roughness in the initial temperature distribution will be immediately smoothed out once heat begins to flow.

    (Later, when we study the wave equation, we will see that the situation is quite different there. In that case theFourier coefficients of the moving wave decay at about the same rate as the coeficients of the initial condition. Sofor the wave equation there is no smoothing effect. In fact, a "corner" in the solution, say a wave crest, will travelwith time. Studying this motion has been one of the most intensely studied questions in PDE in this century. Itgoes under the name of "propagation of singularities" or, in the case of light waves, "the theory of geometricaloptics.")

    Steady state solutions and non-homogeneous boundary conditions

    Mathematically, zero boundary conditions are natural because they are homogeneous. This means that if youform a linear combination of functions with the boundary conditions, the resulting function still satisfies theboundary conditions. However, from the physical point of view it is absurd that there should be anything specialabout holding the ends of the rod at 0, since the zero point on the temperature scale is completely arbitrary.

    We will now see how to solve the heat flow problem in a thin rod when the ends are held a any fixed temperatures.We begin with the notion of a steady state solution (x). This is a solution of the heat equation that doesntdepend on time. Thus

    0 =@

    @t= 2

    @2

    @x2;

    or,00(x) = 0

    This equation is easy to solve (because we are in one space dimension) and we obtain

    (x) = ax+ b

    for constants a and b.

    Now notice that if u(x; t) solves the heat equation, then so does u(x; t) (x). This is because the heat equationis a linear equation. However u(x; t)(x) satisfies different boundary conditions. Thus we may use to adjustthe boundary conditions.

    Suppose we wish to solve@u(x; t)@t

    = 2@2u(x; t)@x2

    ;

    but now with the non-homogeneous boundary condition

    u(0; t) = A; u(a; t) = B for all t > 0

    and, as before, the initial conditionu(x; 0) = u0(x)

    First we find an equilibrium solution satisfying the same non-homogeneous boundary conditions.

    (x) = A+B Aa

    x

  • 34 Math 257 and 316

    Let v(x; t) be the differencev(x; t) = u(x; t) (x):

    Then v(x; t) still satisfies the heat equation. But the boundary conditions satisfied by v(x; t) are

    v(0; t) = u(0; t) (0) = AA = 0

    andv(a; t) = u(a; t) (a) = B B = 0

    In other words, v satisfies Dirichlet boundary conditions. The initial conditions satisfied by v are

    v(x; 0) = u(x; 0) (0) = u0(x) (x)

    We can now find v(x; t) using the sine series and then set u(x; t) = v(x; t) + (x).

    Problem 3.1: Suppose a rod of length 1 with 2 = 1 is held with one end in a heat bath at 0 and theother end in a heat bath at 10 for a long time, until a steady state is reached. Then, after t = 0, both endsare kept at 0. Find the temperature function.

    Problem 3.2: You are a detective working on the case of the missing gold bars. These thin bars are 100 cmlong and were carefully wrapped, except for the ends, in an insulating blanket. When you nd a bar in the

    snow (at 0) you quickly take out your thermometer and measure the temperature at the centre of the bar tobe 0:3. Assuming the bar fell out of the getaway car (at 20), how long has it been lying there? (In thisstory, 2 for gold is 1:5cm2=sec)

    Problem 3.3: Suppose a rod of length 1 with 2 = 1 is held with one end in a heat bath at 0 and the otherend in a heat bath at 10 for a long time, until a steady state is reached. Then, after t = 0, the heat bathsare switched. Find the temperature function.

    Insulated ends

    If u(x; t) is the temperature function for an insulated rod, then @u(x; t)=@x represents the heat flux through across section at position x at time t. If we insulate the ends of the rod, then the heat flux is zero at the ends. Thus,for an insulated rod of length a, we have @u(0; t)=@x = @u(a; t)=@x = 0. These are the boundary condition foran insulated rod.

    So to find the temperature function u(x; t) for an insulated rod, insulated also at each end, with initial temperaturedistribution u0(x), we must solve

    @u(x; t)@t

    = 2@2u(x; t)@x2

    ;

    with the boundary condition@u(0; t)@x

    =@u(a; t)@x

    = 0 for all t > 0

    and the initial conditionu(x; 0) = u0(x)

  • Math 257 and 316 35

    Clearly the right thing to do in this case is to expand u(x; t) in a cosine series, since these are the eigenfunctionsof @2=@x2 satisfying the boundary conditions. Thus we write

    u(x; t) = 0(t)=2 +1X

    n=1

    n(t) cos(nx=a)

    Then u(x; t) will automatically satisfy the correct boundary conditions. When we plug this into the heat equation,we obtain, as before, an ODE for each n(t):

    00(t)=2 = 0

    and0n(t) = 2(n=a)2n(t)

    Thus0(t) = a0

    andn(t) = ane

    2(n=a)2t;

    where the ans are arbitrary constants. To determine the ans we use the initial condition

    u(x; 0) = a0=2 +1X

    n=1

    an cos(nx=a) = u0

    and find the the ans are the coefficients of u0 in a cosine expansion. Thus

    an =2a

    Z a0

    cos(nx=a)u0(x)dx

    and the solution is completely determined.

    Problem 3.4: Show that after a long time, the temperature in the rod is uniform, equal to the average of theinitial temperature distribution.

    Problem 3.5: Find the temperature function of an insulated rod of length 1, insulated at both ends, if theinitial temperature distribution is u0(x) = x.

    Non-homogeneous boundary conditions involving the derivative

    Suppose we replace the homogeneous boundary condition in the last section with

    @u(0; t)@x

    = A;@u(a; t)@x

    = B for all t > 0

    Physically this means that heat is being pumped in or out (depending on the sign of A and B) at the endpoints.

    We can try to mimic what we did before, and subtract off a steady state solution satisfying these boundaryconditions. But steady state solutions are of the form (x) = mx + b so 0(x) = m. Unless A = B it is notpossible that 0(0) = A and 0(a) = B.

    Physically, this makes sense. If we are pumping in a certain amount of heat from the right, and are pumping out adifferent amount, then there will be no steady state solution. Heat will either build up or be depleted indefinitely.

  • 36 Math 257 and 316

    So instead of subtracting off a steady state solution, we will subtract off a particular solution that depends onboth x and t. Let

    (x; t) = bx2 + cx+ dt:

    Then@(x; t)@t

    = d

    and

    2@2(x; t)@x2

    = 22b

    So if we set d = 22b then (x; t) solves the heat equation. Now @(x; t)=@x = 2bx+ c and we may adjust b andc so that satisfies the desired non-homogeneous boundary conditions. Letting c = A and b = (B A)=2a wefind = @(0; t)=@x = A and @(a; t)=@x = B. The function (x; t) is completely determined by these choices,namely

    (x; t) = (B A)x2=2a+Ax + 2(B A)t=a:

    Now we form the new function v(x; t) = u(x; t)(x; t). The function v(x; t) will solve the heat equation, beingthe difference of two solutions. The boundary conditions satisfied by v(x; t) is

    @v(0; t)@x

    =@u(0; t)@x

    @(0; t)@x

    = AA = 0; @v(a; t)@x

    =@u(a; t)@x

    @(a; t)@x

    = B B = 0 for all t > 0

    and the initial condition satisfied by v(x; t) is

    v(x; 0) = u(x; 0) (x; 0) = u0(x) (B A)x2=2a+Ax

    Therefore we can solve for v(x; t) as a cosine series, and the solution will be given by u(x; t) = v(x; t) + (x; t).

    Problem 3.6: Solve the heat equation

    @u(x; t)@t

    =@2u(x; t)@x2

    ;

    for a rod of length 1, with the non-homogeneous boundary condition

    @u(0; t)@x

    = 2;@u(1; t)@x

    = 1 for all t > 0

    and initial condition

    u(x; 0) = 0

    Non-homogeneous term f(x) in the equation

    We have seen that in order to deal with non-homogeneous boundary conditions, we must subtract off a particularsolution of the heat equation satisfying those boundary conditions. The same principle can be applied when thereare non-homogeneous terms in the equation itself.To start, we will examine a case where the non-homogeneousterm doesnt depend on t. Consider the equation

    @u(x; t)@t

    = 2@2u(x; t)@x2

    + f(x);

  • Math 257 and 316 37

    with the non-homogeneous boundary condition

    u(0; t) = A; u(a; t) = B for all t > 0

    and the initial conditionu(x; 0) = u0(x)

    Lets try to find a (steady state) particular solution (x) that satisfies the equation and the non-homogeneousboundary conditions. In other words, we want

    0 = 200(x) + f(x)

    with(0) = A;(a) = B for all t > 0

    The equation for can be solved by simply integrating twice. This yields

    (x) = 2Z x

    0

    Z s0

    f(r)drds + bx+ c

    = 2Z x

    0

    (x r)f(r)dr + bx+ c

    where b and c are arbitrary constants. These constants can be adjusted to satisfy the boundary conditions. Wewant

    (0) = c = A

    and

    (a) = 2Z a

    0

    (a r)f(r)dr + ba+ c = B

    so we set c = A and b = (B A+ 2 R a0 (a r)f(r)dr)=a.Now, since f(x) = 200(x) we find that v(x; t) = u(x; t) (x) solves the heat equation without the non-homogeneous term:

    @v(x; t)@t

    =@u(x; t)@t

    = 2@2u(x; t)@x2

    + f(x)

    = 2@2u(x; t)@x2

    2 @2(x)@x2

    = 2@2v(x; t)@x2

    Also, v(x; t) satisfies the boundary condition

    v(0; t) = u(0; t) (0) = AA = 0; v(a; t) = u(a; t) (b) = B B = 0 for all t > 0

    and the initial conditionv(x; 0) = u0(x) (x)

    Thus we can find v(x; t) in the form of a sine series, and then obtain u(x; t) = v(x; t) + (x).

    Problem 3.7: Solve@u(x; t)@t

    =@2u(x; t)@x2

    + x;

  • 38 Math 257 and 316

    with the non-homogeneous boundary condition

    u(0; t) = 0; u(1; t) = 1 for all t > 0

    and the initial condition

    u(x; 0) = 0

    Non-homogeneous term f(x; t) in the equation

    What can we do when the non-homogeneous term does depend on t as well? Instead of removing the inhomo-geneity in the equation and the boundary condition all at once we do them one at a time.

    Lets consider the equation@u(x; t)@t

    = 2@2u(x; t)@x2

    + f(x; t);

    with the non-homogeneous boundary condition

    u(0; t) = A; u(a; t) = B for all t > 0

    and the initial conditionu(x; 0) = u0(x)

    First we will find a particular solution (x; t) to the equation. Lets try to find such a solution as a sine series.Then this particular solution will satisfy zero boundary conditions so adding or subtracting it will have no effecton the boundary conditions.

    First we expand f(x; t) in a sine series. We have

    f(x; t) =1X

    n=1

    fn(t) sin(nx=a)

    where

    fn(t) =2a

    Z a0

    sin(nx=a)f(x; t)dx

    Next we write

    (x; t) =1X

    n=1

    n(t) sin(nx=a):

    If we plug into the equation we obtain

    1Xn=1

    0n(t) sin(nx=a) =1X

    n=1

    (n=a)2n(t) sin(nx=a) +1X

    n=1

    fn(t) sin(nx=a)

    so the equation will be satisfied if0n(t) = (n=a)2n(t) + fn(t)

    for every n. This holds if

    n(t) = e(n=a)2t

    Z t0

    e(n=a)2fn()d + gne(n=a)

    2t

  • Math 257 and 316 39

    for any constant gn. Any choices of gn will give us a particular solution. Since there is no apparent reason toprefer one over the other, we will simply choose to set gn = 0 for every n. Then

    (x; t) =1X

    n=1

    e(n=a)2t

    Z t0

    e(n=a)2fn()d sin(nx=a)

    is a particular solution of the equation with the non-homogeneous term.

    Now set v(x; t) = u(x; t) (x; t). Then v(x; t) satisfies the heat equation

    @v(x; t)@t

    = 2@2v(x; t)@x2

    ;

    with the non-homogeneous boundary condition as u

    v(0; t) = A; v(a; t) = B for all t > 0

    and the initial conditionv(x; 0) = u0(x) (x; 0)

    But this is a problem that we have already seen how to solve. We must make another subtraction, and subtracta steady state solution (x) from v(x; t). Then w(x; t) = v(x; t) (x) will solve the heat equation withhomogeneous boundary conditions. We can find w(x; t) as a sine series, and finally obtain u(x; t) = w(x; t) + (x) + (x; t).

    Problem 3.8: Solve@u(x; t)@t

    =@2u(x; t)@x2

    + t;

    with the non-homogeneous boundary condition

    u(0; t) = 0; u(1; t) = 1 for all t > 0

    and the initial condition

    u(x; 0) = 0

    Problem 3.9: How could you solve

    @u(x; t)@t

    = 2@2u(x; t)@x2

    + f(x; t);

    with the boundary condition

    @u(0; t)@x

    = A;@u(a; t)@x

    = B for all t > 0

    and the initial condition

    u(x; 0) = u0(x)

  • 40 Math 257 and 316

    The heat equation in two space dimensions

    We will now study a heat flow problem in two space dimensions. If a thin plate is insulated on the top and thebottom, then, to a good approximation, the temperature function is constant across the plate from top to bottom,and only depends on two variables, say x and y. These variables range within a domain determined by theshape of the plate.

    insulation

    x

    y

    The temperature function u(x; y; t) is now a function of three variablestwo space variables and time. It satisfiesthe heat equation

    @u

    @t= 2u = 2

    @2u

    @x2+@2u

    @x2

    together with boundary conditions and an initial condition.

    As we did in the case of one space dimension, we first consider homogeneous boundary conditionsDirichletand Neumann. In two space dimensions, the boundary of , denoted @, is a curve in the plane. The temperaturefunction u(x; y; t) satisfies Dirichlet boundary conditions if

    u(x; y; t) = 0 for (x; y) 2 @

    This means that the temperature is kept at a constant 0 all around the boundary.

    Neumann boundary conditions are satisfied if the the directional derivative of u in the direction normal (i.e., atright angles) to the boundary is zero. In other words

    @u(x; y; t)@

    = 0 for (x; y) 2 @

    where @u(x;y;t)@ denotes the normal derivative. If Neumann boundary condition hold, then there is no heat fluxacross the boundary, i.e., the boundary of the plate is insulated.

    The initial condition is given byu(x; y; 0) = u0(x; y) for (x; y) 2

    where u0(x; y) is the given initial temperature distribution.

  • Math 257 and 316 41

    Solving the 2D problem with homogeneous boundary conditions: general case

    Lets start with Dirichlet boundary conditions. The approach we take is analogous to the one space dimensionalcase: we expand the solution in a basis of eigenfunctions.

    So to start with, we find all the eigenvalues and eigenfunctions of with Dirichlet boundary conditions. In otherwords we need to find all possible solutions and (x; y) to the equation

    (x; y) = (x; y)

    satisfying(x; y) = 0 for (x; y) 2 @

    In the situations where we can actually calculate these, the solutions are indexed by two integers, so we willdenote them by n;m and n;m(x; y).

    There is a theorem that states that all the eigenvaluesn;m are real (in fact non-negative) and that the eigenfunctionsn;m(x; y) form an orthogonal basis. The orthogonality condition is

    hn;m; n0;m0i =Z Z

    n;m(x; y)n0;m0(x; y) = 0 unless n = n0 and m = m0

    Saying the functions form a basis means that we can expand any function (x; y) in a series

    (x; y) =X

    n

    Xm

    bn;mn;m(x; y)

    There are, as in one dimension, technical questions about when the left side converges and is equal to the rightside. I will just sweep these under the rug. Certainly, the sum on the right always satisfies Dirichlet boundaryconditions, since each n;m does. The coefficients are found by using the orthogonality relations

    hn0;m0 ; i =X

    n

    Xm

    bn;mhn0;m0 ; n;mi = bn0;m0hn0;m0 ; n0;m0i

    so thatbn;m = hn;m; i=hn;m; n;mi

    Now we expand our unknown solution as

    u(x; y; t) =X

    n

    Xm

    m;n(t)n;m(x; y)

    for unknown coefficientsn;m(t). This expression automatically satisfies the right boundary conditions. Pluggingthis into the equation, and using the fact that the functions n;m are eigenfunctions we find

    Xn

    Xm

    0m;n(t)n;m(x; y) = 2X

    n

    Xm

    m;n(t)n;m(x; y) = 2X

    n

    Xm

    m;n(t)(n;m)n;m(x; y)

    This means that to satisfy the equation, we must have

    0m;n(t) = 2n;mm;n(t)

    or,n;m(t) = bn;me

    2n;mt

  • 42 Math 257 and 316

    for some constants bn;m. These constants are determined by the initial condition

    u(x; y; 0) =X

    n

    Xm

    bm;nn;m(x; y) = u0(x; y)

    so thatbn;m = hn;m; u0i=hn;m; n;mi

    =Z Z

    n;m(x; y)u0(x; y)dxdy=Z Z

    2n;m(x; y)dxdy

    The final form of the solution is then

    u(x; y; t) =X

    n

    Xm

    bm;ne2n;mtn;m(x; y)

    The case of Neumann boundary conditions is completely analogous, except that the eigenfunctions are nowrequired to satisfied Neumann boundary conditions. We end up with a new set of eigenvalues n;m andeigenfunctions n;m(x; y) and expand the solution in terms of these.

    Unfortunately, unless the domain is something very special like a rectangle or a circle, it is impossible to calculatethe eigenvalues n;m and eigenfunctions n;m(x; y) explicitly. However, many mathematicians have worked onunderstanding the relationship between the shape of and the eigenvalues.

    For example, if has a narrow neck like this

    then the first non-zero eigenvalue will be very small. Why? Well, if the n;ms are all large then all the termse

    2n;mt in the solution of the heat equation will tend to zero very quickly, and the equilibrium heat distributionwill be achieved in a very short time. However, thats not possible if the heat has to diffuse through a narrowneck.

    Another interesting problem, which was only solved in the last ten years is the following: Do the Dirichleteigenvalues n;m determine the domain, or is it possible for two different domains to have exactly the sameDirichlet eigenvalues. Surprisingly, the answer is: it is possible!

    Homogeneous boundary conditions for a rectangle

    If the domain is a rectangle then we can find the Dirichlet and Neumann eigenvalues and eigenfunctionsexplicitly. We have already encountered them when doing double Fourier expansions. Suppose the rectanglecontains all points (x; y) with 0 x a and 0 y b.For Dirichlet boundary conditions,

    n;m(x; y) = sin(nx=a) sin(ny=b)

    for n = 1; 2; 3; : : : and m = 1; 2; 3; : : :.

  • Math 257 and 316 43

    Lets check that the Dirichlet boundary conditions are satisfied by each of these functions. The boundary consistsof four line segments, f(x; 0) : 0 x ag,f(a; y) : 0 y bg,f(x; b) : 0 x ag and f(0; y) : 0 y bg. Itis easy to verify that n;m(x; y) = 0 along each of these segments.

    Next, lets verify that these functions are eigenfunctions of the Laplace operator. We calculate

    n;m(x; y) =@2

    @x2+

    @2

    @x2

    n;m(x; y)

    =n

    a

    2+nb

    2n;m(x; y)

    Thus n;m(x; y) is an eigenfunction with eigenvalue

    n;m =na

    2+nb

    2(3:1)

    What we wont be able to show here is that this is a complete listing of all the eigenfunctions and eigenvalues.But, in fact, it is a complete list. So by the formula in the previous section, the solution to heat equation withDirichlet boundary conditions and initial condition u0 is

    u(x; y; t) =1X

    n=1

    1Xm=1

    bm;ne2n;mt sin(nx=a) sin(ny=b)

    where

    bn;m =4ab

    Z a0

    Z b0

    sin(nx=a) sin(ny=b)u0(x; y)dxdy

    Similarly, for Neumann boundary conditions, the eigenfunctions are

    0;0 =14

    n;0 =12

    cos(nx=a)

    0;m =12

    cos(my=b)

    n;m(x; y) = cos(nx=a) cos(ny=b)

    for n = 1; 2; 3; : : : and m = 1; 2; 3; : : :. and the eigenvalues n;m are given by the same formula () above.

    Thus the solution to heat equation with insulated sides and initial condition u0 is

    u(x; y; t) =a0;04

    +1X

    n=1

    an;02e

    2n;0t cos(nx=a)

    +1X

    m=1

    a0;m2

    e20;mt cos(my=b)

    +1X

    n=1

    1Xm=1

    am;ne2n;mt cos(nx=a) cos(ny=b)

    where

    an;m =4ab

    Z a0

    Z b0

    cos(nx=a) cos(ny=b)u0(x; y)dxdy

  • 44 Math 257 and 316

    Example

    Lets solve the heat equation@u

    @t= u

    on the square 0 x 1 and 0 y 1 with Dirichlet boundary conditions and initial conditions

    u(x; y; 0) =

    0 if y > x1 if x y

    The solution is given by

    u(x; y; t) =1X

    n=1

    1Xm=1

    bm;nen;mt sin(nx) sin(ny)

    where the bn;ms are the coefficients of u(x; y; 0) when expanded in a double sine series. This is a calculation thatwas done in a homework problem. The answer is

    bn;m = 4(1)nnm2

    ((1)m 1) + 4n

    m(1(1)n+m)

    (m2n2) if n 6= m0 if n = m

    Here are some plots of the function u(x; y; t) as t increases. Notice how, with Dirichlet boundary conditions, theheat just drains away.

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.2

    0.4

    0.6

    0.8

    1

    t=0.001

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.2

    0.4

    0.6

    0.8

    1

    t=0.01

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.2

    0.4

    0.6

    0.8

    1

    t=0.02

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.2

    0.4

    0.6

    0.8

    1

    t=0.03

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.2

    0.4

    0.6

    0.8

    1

    t=0.04

    Problem 3.10: Solve the heat equation@u

    @t= u

  • Math 257 and 316 45

    on the square 0 x 1 and 0 y 1 with Neumann boundary conditions and initial conditions

    u(x; y; 0) =

    0 if y > x1 if x y

    Problem 3.11: Describe how to solve the heat flow problem for a plate that is insulated on the top andbottom, and on two opposite sides, while the other two opposite sides are kept at zero temperature. Assume

    the initial temperature distribution is u0(x; y).

    2D heat equations: non-homogeneous boundary conditions

    How can we compute the temperature flow in a two dimensional region when the temperatures around theboundary @ are held at fixed values other than zero?

    For example we might be interested in the following experimental setup:

    100 degrees0 degrees

    An insulating wall is placed in a beaker. One side is filled with ice water and the other side with boiling water.The metal plate (with top and bottom insulated) is inserted as shown. Then, the part of the boundary in the icewater will be kept at a constant temperature of 0 while the part in the boiling water will be kept at 100.

    To solve this problem, we must solve the heat equation

    @u

    @t= 2u = 2

    @2u

    @x2+@2u

    @x2

    with boundary conditionu(x; y; t) = f(x; y) for (x; y) 2 @

    and initial conditionu(x; y; 0) = u0(x; y)

    Here the function f(x; y) is defined for values of (x; y) along the boundary curve @ surrounding . The valuesof f(x; y) are the fixed temperatures. In the example above, f(x; y) = 0 for (x; y) in the part of the boundarylying in the ice water, while f(x; y) = 100 for (x; y) in the part of the boundary lying in the boiling water.

    We adopt the same strategy that we used in one space dimension. We first look for a steady state solution thatsatisfies the equation and boundary condition. Thus the steady state solution is a function (x; y) defined for(x; y) 2 that satisfies the equation

    =@

    @x2+@

    @y2= 0

  • 46 Math 257 and 316

    and the boundary condition(x; y) = f(x; y) for (x; y) 2 @

    This is Laplaces equation, which we will study next. At the moment it is not at all clear how to solve thisequation. There is one special case where it is easy to solvewhen f(x; y) = C is constant. Then the constantfunction (x; y) = C is the solution. This makes sense: if we hold the whole boundary at a steady C degrees,then eventually the whole plate should end up at that temperature.

    Suppose now that we have obtained the solution (x; y) to Laplaces equation with boundary condtion. Wedefine v(x; y; t) = u(x; y; t)(x; y). Then v(x; y; t) will satisfy the heat equation with homogeneous boundarycondition

    v(x; y; t) = 0 for (x; y) 2 @and initial condition

    v(x; y; 0) = u0(x; y) (x; y)

    Using the method of the previous sections, we can solve for v(x; y; t) in the form of an eigenfunction expansion.Then we let

    u(x; y; t) = v(x; y; t) + (x; y)

    to obtain the final solution.

    At this point you can go back to the introductory lecture and understand in detail how the solution of the heatequation presented there was obtained.

    Problem 3.12: Go back to the introductory lecture and understand in detail how the solution of the heatequation presented there was obtained.

    Problem 3.13: Consider a rectangular metal plate, insulated on the top and bottom, of size 10 cm 20 cm.Initially, the plate is at a constant temperature of 0. Then, it is placed in a tub of water at 50. Find thetemperature at all later times. Assume 2 = 1.

  • Math 257 and 316 47

    Laplaces equation

    We have already seen that solutions to Laplaces equation describe heat distributions at equilibrium. Here aresome other examples where solutions to Laplaces equation describe equilibrium configurations.

    Suppose we take rubber membrane and attach it to a stiff wire loop. What will be the shape of the membrane?

    In this example, let (x; y) denote the height of the membrane above the xy plane. Let denote the set of pointslying under the membrane on the xy plane. Then (x; y) is the solution of Laplaces equation

    (x; y) =@2

    @x2+@2

    @y2= 0

    for (x; y) 2 , with a boundary condition determined by the shape of the wire. If f(x; y) for (x; y) 2 @ denotesthe height of wire above the xy plane, then we require

    (x; y) = f(x; y) for (x; y) 2 @In this example, the shape of the membrane is the equilibrium configuration of a vibrating drum head.

    Another example where Laplaces equation plays an important role is electrostatics. Suppose we make a cylinderout of two half round pieces of metal fastened together with a thin insulating layer, and attach each side toopposite ends of a battery. If there is no charged matter inside the cylinder, what will be the electric field inside?

    +

    -

    In this example, the electrostatic potential is really a function of three space variables. The equation for theelectrostatic potential is

    =@2

    @x2+@2

    @y2+@2

    @z2= (x; y; z)

    where (x; y; z) is the charge density. In our example the charge density is zero. Also, if the cylinder is infinitelylong, we may assume that only depends on two variables and is constant along the cylinder. Then (x; y)satisfies Laplaces equation in two variables. The boundary condition is the requirement that the potential beconstant on each metal half. The electric field (which is proportional to the force felt by a charged particle) is thengiven by the gradient E = r.

  • 48 Math 257 and 316

    Laplaces equation in a rectangle

    Suppose is a rectangle 0 x a and 0 b b We wish to solve@2

    @x2+@2

    @y2= 0

    for 0 x a and 0 b b with(x; 0) = f1(x) for 0 x a(a; y) = f2(y) for 0 y b(x; b) = f3(x) for 0 x a(0; y) = f4(y) for 0 y b

    To solve this problem, we break it into four easier ones, where the boundary condition is zero on three of the fourboundary pieces. In other words, we let 1 be the solution of Laplaces equation 1 = 0 with

    (x; 0) = f1(x) for 0 x a(a; y) = 0 for 0 y b(x; b) = 0 for 0 x a(0; y) = 0 for 0 y b

    (4:1)

    and similarly for 2, 3 and4. Then when we add this solutions up, the result = 1 + 2 + 3 + 4 willsatisfy Laplaces equation, as well as the correct boundary condition on all four sides.

    How can we solve the easier problemLaplaces equation with boundary condition (4.1)? We expand the solution(x; y) into a sine series in x. Thus

    (x; y) =1X

    n=1

    n(y) sin(nx=a)

    Then will automatically vanish at x = 0 and x = a, so two of the four boundary conditions are met. Thecoefficients in this expansion are undetermined functions of y.

    If we substitute this expansion into Laplaces equation, we get

    =1X

    n=1

    00n(y) sin(nx=a) (n=a)2n(y) sin(nx=a)

    so the equation holds if for every n00n(y) = (n=a)

    2n(y)

    or, ifn(y) = aneny=a + bneny=a

    Now we try to satisfy the other two boundary conditions. When y = b then we want n to be zero

    n(b) = anenb=a + bnenb=a

    setbn = e2nb=aan

    Then n(b) will be zero for each n, and the third boundary condition is satisfies. It remains to satisfy

    (x; 0) =1X

    n=1

    (an + bn) sin(nx=a)

    =1X

    n=1

    an(1 e2nb=a) sin(nx=a)

    = f1(x)

  • Math 257 and 316 49

    Thus an(1 e2nb=a) are the coefficients in the sine expansion of f1(x). In other words

    an(1 e2nb=a) = 2a

    Z a0

    sin(nx=a)f1(x)dx

    This determines the ans and so the solution to the problem with boundary conditions () is complete.

    Example

    Lets solve Laplaces equation on the unit square 0 x 1 and 0 y 1 with boundary condition

    (x; 0) =x if 0 x 1=21 x if 1=2 x 1

    (1; y) = 0 for 0 y 1(x; 1) = 0 for 0 x 1(0; y) = 0 for 0 y 1

    We have

    an =2

    1 e2n"Z 1=2

    0

    x sin(nx)dx +Z 1

    1=2

    (1 x) sin(nx)dx#

    =2

    1 e2n2 sin(n=2)

    n22

    =4 sin(n=2)

    (1 e2n)n22and

    bn = e2nb=aan = 4 sin(n=2)(1 e2n)n22With these values of an and bn

    (x; y) =1X

    n=1

    (aneny + bneny) sin(nx)

    Here is a picture of the solution

    0

    0.2

    0.4

    0.6

    0.8

    1

    x

    0

    0.2

    0.4

    0.6

    0.8

    1

    y

    0

    0.1

    0.2

    0.3

    0.4

    Problem 4.1: Solve Laplaces equation on the unit square 0 x 1 and 0 y 1 with boundarycondition

    (x; 0) = x for 0 x 1(1; y) = 1 y for 0 y 1(x; 1) = 0 for 0 x 1(0; y) = 0 for 0 y 1

  • 50 Math 257 and 316

    Polar co-ordinates

    One of the most powerful ways of simplifying (and also of complicating!) a PDE is to make a change ofco-ordinates (or independent variables).

    Probably the most common co-ordinates, after the usual cartesian co-ordinates we have used until now, are polarco-ordinates.

    To every point (x; y) in the plane we associate two numbers r and . The number r is the distance of (x; y) fromthe origin, and is the angle that the line through the origin and (x; y) makes with the x axis.

    r

    y

    x

    Given r and we can solve for x and y. This defines x and y as functions of r and .

    x = x(r; ) = r cos()y = y(r; ) = r sin()

    Notice that if we change by a multiple of 2, the corresponding x and y values dont change, since we havesimply gone around the circle some number of times and ended up at the same spot.

    Conversly, given x and y, we can solve for r and . Actually, we cant quite solve for , because there are infinitelymany values, all differing by a multiple of 2, that correspond to the same x and y. However, if we insist that,for example, < then is uniquely determined and we have

    r = r(x; y) =px2 + y2

    = (x; y) = atan(x; y) =

    8 x

    The function G(x; r) is called the Greens function for this equation.

    We therefore have two different methods of solving the same equationthe eigenfunction expansion (Fourierseries) method and the Greens function method. Of course they must produce the same answer. In fact, if westart with the series and substitute in the formulas for the fn we get

    u(x) =1X

    n=1

    1n22

    fn sin(nx)

    =1X

    n=1

    1n22

    2Z 1

    0

    sin(nr)f(r)dr sin(nx)

    =Z 1

    0

    1Xn=1

    2n22

    sin(nx) sin(nr)f(r)dr

    and one can verify that

    G(x; r) =1X

    n=1

    2n22

    sin(nx) sin(nr) (4:2)

    Example

    Consider the equationu00(x) = ex

    for 0 < x < 1 subject to u(0) = u(1) = 0. If we want to solve this using eigenfunctions, we must first expandf(x) = ex in a sine series. We obtain

    fn = 2Z 1

    0

    sin(nx)exdx =n(1 e(1)n)

    1 + n22

    so that

    u(x) =1X

    n=1

    n(1 e(1)n)(1 + n22)(n22)

    sin(nx)

    On the other hand, if we want to use the Greens function we may write

    u(x) =Z x

    0

    r(1 x)erdr +Z r

    x

    x(r 1)erdr = ex(2x2 + 4x 1) + 1 x ex

    Problem 4.3: Verify the identity (4.2) by expanding G(x; r) for xed x in a sine series in the r variable.

  • 58 Math 257 and 316

    Problem 4.4: Solve the equationu00(x) = x

    with Dirichlet boundary conditions at x = 0 and x = 1 using both methods.

    Now we consider two space dimensions. Now we are given some domain and we wish to solve

    u(x; y) = f(x; y)

    for (x; y) 2 with boundary conditionsu(x; y) = 0

    for (x; y) 2 @.In principle, this can be solved with an eigenfunction expansion, just as in before. If we know the eigenfunctionsn;m(x; y) and eigenvalues n;m of with Dirichlet boundary conditions, we can expand

    f(x; y) =X

    n

    Xm

    fn;mn;m(x; y)

    where

    fn;m = hn;m; fi=hn;m; n;mi =Z

    n;m(x; y)f(x; y)dxdy=Z

    2n;m(x; y)dxdy

    Then if we writeu(x; y) =

    Xn

    Xm

    bn;mn;m(x; y)

    for unknown coefficients bn;m, the boundary conditions will hold, and the equation reads

    u =X

    n

    Xm

    bn;m(n;m)(x; y) =X

    n

    Xm

    bn;mn;mn;m(x; y) =X

    n

    Xm

    fn;mn;m(x; y)

    Thus the unknown coefficients are given by

    bn;m =1

    n;mfn;m

    and so

    u(x; y) =X

    n

    Xm

    1n;m

    fn;mn;m(x; y)

    Of course, to actually use this method in practice, we must know the eigenfunctions and eigenvalues. At thispoint we know them explicitly only for rectangles in two dimensions (and not for disks). So even though we cansolve the homogeneous Laplaces equation on a disk, we cant yet solve the inhomogeneous equation.

    Lets solveu(x; y) = 1

    for 0 < x < 1 and 0 < y < 1 subject to

    u(x; 0) = u(x; 1) = u(0; y) = u(1; y) = 0:

    The eigenfunctions are n;m(x; y) = sin(nx) sin(ny) and the eigenvalues are n;m = 2(n2 +m2). We firstexpand

    1 =1X

    n=1

    1Xm=1

    4((1)n 1)((1)m 1)

    2nmsin(nx) sin(ny)

  • Math 257 and 316 59

    Thus we obtain

    u(x; y) =1X

    n=1

    1Xm=1

    4((1)n 1)((1)m 1)

    4nm(n2 +m2)sin(nx) sin(ny)

    What about the Greens function method in two dimensions? There is a Greens function that we may computein terms of the eigenfunctions as

    G(x; y; s; t) =Xn;m

    n;m(x; y)n;m(s; t)n;mhn;m; n;mi

    This function can be used to write the solution u as

    u(x; y) =Z

    G(x; y; s; t)f(s; t)dsdt

    There are also ways (in addition to the eigenfunction formula above) to compute the Greens function in varioussituations. Unfortunately we wont have time in this course to explore this.

    Problem 4.5: Find the solution u(x; y) to

    u(x; y) = xy

    for 0 < x < 1 and 0 < y < 1 that satises Dirichlet boundary conditions.

    Problem 4.6: Find the solution tou(x; y) = 1

    that satises the non-homogeneous boundary conditions

    u(x; 0) = x for 0 x 1u(1; y) = 1 for 0 y 1u(x; 1) = 1 for 0 x 1u(0; y) = 1 for 0 y 1

    Hint: let u1(x; y) be the solution of u = 1 with Dirichlet boundary conditions. Then consider v(x; y) =u(x; y) u1(x; y). The function v will satisfy Lapl


Recommended