math 241: solving the heat equationdeturck/m241/solving_the_heat_eqn.pdf · math 241: solving the...
TRANSCRIPT
-
Math 241: Solving the heat equation
D. DeTurck
University of Pennsylvania
September 20, 2012
D. DeTurck Math 241 002 2012C: Solving the heat equation 1 / 21
-
1D heat equation with Dirichlet boundary conditions
We derived the one-dimensional heat equation
ut = kuxx
and found that its reasonable to expect to be able to solve foru(x , t) (with x [a, b] and t > 0) provided we impose initialconditions:
u(x , 0) = f (x)
for x [a, b] and boundary conditions such as
u(a, t) = p(t) , u(b, t) = q(t)
for t > 0.We showed that this problem has at most one solution, now itstime to show that a solution exists.
D. DeTurck Math 241 002 2012C: Solving the heat equation 2 / 21
-
Linearity
Well begin with a few easy observations about the heat equationut = kuxx , ignoring the initial and boundary conditions for themoment:
Since the heat equation is linear (and homogeneous), a linearcombination of two (or more) solutions is again a solution. Soif u1, u2,. . . are solutions of ut = kuxx , then so is
c1u1 + c2u2 +
for any choice of constants c1, c2, . . .. (Likewise, if u(x , t) isa solution of the heat equation that depends (in a reasonableway) on a parameter , then for any (reasonable) functionf () the function
U(x , t) =
21
f ()u(x , t) d
is also a solution.
D. DeTurck Math 241 002 2012C: Solving the heat equation 3 / 21
-
Linearity
Well begin with a few easy observations about the heat equationut = kuxx , ignoring the initial and boundary conditions for themoment:
Since the heat equation is linear (and homogeneous), a linearcombination of two (or more) solutions is again a solution. Soif u1, u2,. . . are solutions of ut = kuxx , then so is
c1u1 + c2u2 +
for any choice of constants c1, c2, . . .. (Likewise, if u(x , t) isa solution of the heat equation that depends (in a reasonableway) on a parameter , then for any (reasonable) functionf () the function
U(x , t) =
21
f ()u(x , t) d
is also a solution.D. DeTurck Math 241 002 2012C: Solving the heat equation 3 / 21
-
Linearity and initial/boundary conditions
We can take advantage of linearity to address theinitial/boundary conditions one at a time.
For instance, we will spend a lot of time on initial-valueproblems with homogeneous boundary conditions:
ut = kuxx , u(x , 0) = f (x), u(a, t) = u(b, t) = 0.
Then well consider problems with zero initial conditions butnon-zero boundary values.
We can add these two kinds of solutions together to getsolutions of general problems, where both the initial andboundary values are non-zero.
D. DeTurck Math 241 002 2012C: Solving the heat equation 4 / 21
-
Linearity and initial/boundary conditions
We can take advantage of linearity to address theinitial/boundary conditions one at a time.
For instance, we will spend a lot of time on initial-valueproblems with homogeneous boundary conditions:
ut = kuxx , u(x , 0) = f (x), u(a, t) = u(b, t) = 0.
Then well consider problems with zero initial conditions butnon-zero boundary values.
We can add these two kinds of solutions together to getsolutions of general problems, where both the initial andboundary values are non-zero.
D. DeTurck Math 241 002 2012C: Solving the heat equation 4 / 21
-
Linearity and initial/boundary conditions
We can take advantage of linearity to address theinitial/boundary conditions one at a time.
For instance, we will spend a lot of time on initial-valueproblems with homogeneous boundary conditions:
ut = kuxx , u(x , 0) = f (x), u(a, t) = u(b, t) = 0.
Then well consider problems with zero initial conditions butnon-zero boundary values.
We can add these two kinds of solutions together to getsolutions of general problems, where both the initial andboundary values are non-zero.
D. DeTurck Math 241 002 2012C: Solving the heat equation 4 / 21
-
Linearity and initial/boundary conditions
We can take advantage of linearity to address theinitial/boundary conditions one at a time.
For instance, we will spend a lot of time on initial-valueproblems with homogeneous boundary conditions:
ut = kuxx , u(x , 0) = f (x), u(a, t) = u(b, t) = 0.
Then well consider problems with zero initial conditions butnon-zero boundary values.
We can add these two kinds of solutions together to getsolutions of general problems, where both the initial andboundary values are non-zero.
D. DeTurck Math 241 002 2012C: Solving the heat equation 4 / 21
-
Symmetry
Some more observations:
If u(x , t) is a solution, then so is u(a x , b + t) for anyconstants a and b.Note the with the x but only + with t you cantreverse time with the heat equation. This shows that theheat equation respects (or reflects) the second law ofthermodynamics (you cant unstir the cream from yourcoffee).
If u(x , t) is a solution then so is u(a2t, at) for any constant a.Well use this observation later to solve the heat equation in asurprising way, but for now well just store it in our memorybank.
D. DeTurck Math 241 002 2012C: Solving the heat equation 5 / 21
-
Symmetry
Some more observations:
If u(x , t) is a solution, then so is u(a x , b + t) for anyconstants a and b.Note the with the x but only + with t you cantreverse time with the heat equation. This shows that theheat equation respects (or reflects) the second law ofthermodynamics (you cant unstir the cream from yourcoffee).
If u(x , t) is a solution then so is u(a2t, at) for any constant a.Well use this observation later to solve the heat equation in asurprising way, but for now well just store it in our memorybank.
D. DeTurck Math 241 002 2012C: Solving the heat equation 5 / 21
-
Polynomial solutions
Now its time to at least find some examples of solutions tout = kuxx .
One thing we can try is polynomial solutions. Certainly anylinear function of x is a solution.
Next, taking our cue from the initial-value problem, supposeu(x , 0) = p0(x) for some polynomial p0(x), and try toconstruct a solution of the form
u(x , t) = p0(x) + tp1(x) + t2p2(x) +
We have
ut = p1(x) + 2tp2(x) + 3t2p3(x) +
anduxx = p
0 (x) + tp
1 (x) + t
2p2 (x) +
D. DeTurck Math 241 002 2012C: Solving the heat equation 6 / 21
-
Polynomial solutions
Now its time to at least find some examples of solutions tout = kuxx .
One thing we can try is polynomial solutions. Certainly anylinear function of x is a solution.
Next, taking our cue from the initial-value problem, supposeu(x , 0) = p0(x) for some polynomial p0(x), and try toconstruct a solution of the form
u(x , t) = p0(x) + tp1(x) + t2p2(x) +
We have
ut = p1(x) + 2tp2(x) + 3t2p3(x) +
anduxx = p
0 (x) + tp
1 (x) + t
2p2 (x) +
D. DeTurck Math 241 002 2012C: Solving the heat equation 6 / 21
-
Polynomial solutions
Now its time to at least find some examples of solutions tout = kuxx .
One thing we can try is polynomial solutions. Certainly anylinear function of x is a solution.
Next, taking our cue from the initial-value problem, supposeu(x , 0) = p0(x) for some polynomial p0(x), and try toconstruct a solution of the form
u(x , t) = p0(x) + tp1(x) + t2p2(x) +
We have
ut = p1(x) + 2tp2(x) + 3t2p3(x) +
anduxx = p
0 (x) + tp
1 (x) + t
2p2 (x) +
D. DeTurck Math 241 002 2012C: Solving the heat equation 6 / 21
-
Polynomial solutions
So the heat equation tells us:
p1 = kp0 , p2 =
k
2p1 =
k2
2p0 ,
p3 =k
3p2 =
k3
3!p(6)0 , . . . , pn =
kn
n!p(2n)0
This process will stop if p0 is a polynomial, and well get apolynomial solution of the heat equation whose x-degree istwice its t-degree:
u(x , t) = p0(x) +kt
1!p0 +
k2t2
2!p0 + +
kntn
n!p(2n)0 + .
D. DeTurck Math 241 002 2012C: Solving the heat equation 7 / 21
-
But. . .
The trouble with polynomial solutions, or even with extending theidea of polynomials to power series in two variables (ick!), is that itwould be very difficult if not impossible to figure out how tochoose the coefficients of the polynomial p0 so that the boundaryvalues, even simple ones, would be matched at both ends.
There are also tricky convergence questions, etc for power series,and we dont want to get overwhelmed with these.
D. DeTurck Math 241 002 2012C: Solving the heat equation 8 / 21
-
Separation of variables
A more fruitful strategy is to look for separated solutions ofthe heat equation, in other words, solutions of the formu(x , t) = X (x)T (t).
If we substitute X (x)T (t) for u in the heat equationut = kuxx we get:
XdT
dt= k
d2X
dx2T .
Divide both sides by kXT and get
1
kT
dT
dt=
1
X
d2X
dx2.
D. DeTurck Math 241 002 2012C: Solving the heat equation 9 / 21
-
Separation of variables
A more fruitful strategy is to look for separated solutions ofthe heat equation, in other words, solutions of the formu(x , t) = X (x)T (t).
If we substitute X (x)T (t) for u in the heat equationut = kuxx we get:
XdT
dt= k
d2X
dx2T .
Divide both sides by kXT and get
1
kT
dT
dt=
1
X
d2X
dx2.
D. DeTurck Math 241 002 2012C: Solving the heat equation 9 / 21
-
Separation of variables
A more fruitful strategy is to look for separated solutions ofthe heat equation, in other words, solutions of the formu(x , t) = X (x)T (t).
If we substitute X (x)T (t) for u in the heat equationut = kuxx we get:
XdT
dt= k
d2X
dx2T .
Divide both sides by kXT and get
1
kT
dT
dt=
1
X
d2X
dx2.
D. DeTurck Math 241 002 2012C: Solving the heat equation 9 / 21
-
Separation of Variables
So if u(x , t) = X (x)T (t) thenT
kT=
X
X.
In this last equation, everything on the left side is a functionof t, and everything on the right side is a function of x . Thismeans that both sides are constant, say equal to whichgives ODEs for X and T :
X X = 0 T kT = 0
The power of this method comes in the application ofboundary conditions, which we turn to next.
D. DeTurck Math 241 002 2012C: Solving the heat equation 10 / 21
-
Separation of Variables
So if u(x , t) = X (x)T (t) thenT
kT=
X
X.
In this last equation, everything on the left side is a functionof t, and everything on the right side is a function of x . Thismeans that both sides are constant, say equal to whichgives ODEs for X and T :
X X = 0 T kT = 0
The power of this method comes in the application ofboundary conditions, which we turn to next.
D. DeTurck Math 241 002 2012C: Solving the heat equation 10 / 21
-
Separation of Variables
So if u(x , t) = X (x)T (t) thenT
kT=
X
X.
In this last equation, everything on the left side is a functionof t, and everything on the right side is a function of x . Thismeans that both sides are constant, say equal to whichgives ODEs for X and T :
X X = 0 T kT = 0
The power of this method comes in the application ofboundary conditions, which we turn to next.
D. DeTurck Math 241 002 2012C: Solving the heat equation 10 / 21
-
Boundary conditions
ODEs for X and T :
X X = 0 T kT = 0
As an example, lets suppose the x-interval goes from 0 to L,and we have homogeneous Dirichlet conditions:u(0, t) = u(L, t) = 0 for all t.
This implies that cant be positive or zero (since solutionsto X X = 0 with 0 cant be zero twice without beingidentically zero)
So let = 2. The general solution of X + 2X = 0 is
X = c1 cosx + c2 sinx
The easiest way to satisfy the boundary conditions on u is toinsist that X (0) = X (L) = 0. What does this imply?
D. DeTurck Math 241 002 2012C: Solving the heat equation 11 / 21
-
Boundary conditions
ODEs for X and T :
X X = 0 T kT = 0
As an example, lets suppose the x-interval goes from 0 to L,and we have homogeneous Dirichlet conditions:u(0, t) = u(L, t) = 0 for all t.
This implies that cant be positive or zero (since solutionsto X X = 0 with 0 cant be zero twice without beingidentically zero)
So let = 2. The general solution of X + 2X = 0 is
X = c1 cosx + c2 sinx
The easiest way to satisfy the boundary conditions on u is toinsist that X (0) = X (L) = 0. What does this imply?
D. DeTurck Math 241 002 2012C: Solving the heat equation 11 / 21
-
Boundary conditions
ODEs for X and T :
X X = 0 T kT = 0
As an example, lets suppose the x-interval goes from 0 to L,and we have homogeneous Dirichlet conditions:u(0, t) = u(L, t) = 0 for all t.
This implies that cant be positive or zero (since solutionsto X X = 0 with 0 cant be zero twice without beingidentically zero)
So let = 2. The general solution of X + 2X = 0 is
X = c1 cosx + c2 sinx
The easiest way to satisfy the boundary conditions on u is toinsist that X (0) = X (L) = 0. What does this imply?
D. DeTurck Math 241 002 2012C: Solving the heat equation 11 / 21
-
Boundary conditions
ODEs for X and T :
X X = 0 T kT = 0
As an example, lets suppose the x-interval goes from 0 to L,and we have homogeneous Dirichlet conditions:u(0, t) = u(L, t) = 0 for all t.
This implies that cant be positive or zero (since solutionsto X X = 0 with 0 cant be zero twice without beingidentically zero)
So let = 2. The general solution of X + 2X = 0 is
X = c1 cosx + c2 sinx
The easiest way to satisfy the boundary conditions on u is toinsist that X (0) = X (L) = 0. What does this imply?
D. DeTurck Math 241 002 2012C: Solving the heat equation 11 / 21
-
Restrictions on
We have X = c1 cosx + c2 sinx , X (0) = 0, X (L) = 0.
First, note that X (0) = c1. The condition X (0) = 0 thenforces c1 = 0.
Now we need to reconcile three things: X = c2 sinx ,X (L) = 0 and we dont want X to be identically zero (i.e., wewant c2 6= 0).
This gives a condition on : sinL = 0, or L = n for someinteger n.
Since sin(x) = sin x , we need only consider positiveintegers n. Thus
=n
L, n = 1, 2, 3, . . .
andX = c2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 12 / 21
-
Restrictions on
We have X = c1 cosx + c2 sinx , X (0) = 0, X (L) = 0. First, note that X (0) = c1. The condition X (0) = 0 then
forces c1 = 0.
Now we need to reconcile three things: X = c2 sinx ,X (L) = 0 and we dont want X to be identically zero (i.e., wewant c2 6= 0).
This gives a condition on : sinL = 0, or L = n for someinteger n.
Since sin(x) = sin x , we need only consider positiveintegers n. Thus
=n
L, n = 1, 2, 3, . . .
andX = c2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 12 / 21
-
Restrictions on
We have X = c1 cosx + c2 sinx , X (0) = 0, X (L) = 0. First, note that X (0) = c1. The condition X (0) = 0 then
forces c1 = 0.
Now we need to reconcile three things: X = c2 sinx ,X (L) = 0 and we dont want X to be identically zero (i.e., wewant c2 6= 0).
This gives a condition on : sinL = 0, or L = n for someinteger n.
Since sin(x) = sin x , we need only consider positiveintegers n. Thus
=n
L, n = 1, 2, 3, . . .
andX = c2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 12 / 21
-
Restrictions on
We have X = c1 cosx + c2 sinx , X (0) = 0, X (L) = 0. First, note that X (0) = c1. The condition X (0) = 0 then
forces c1 = 0.
Now we need to reconcile three things: X = c2 sinx ,X (L) = 0 and we dont want X to be identically zero (i.e., wewant c2 6= 0).
This gives a condition on : sinL = 0, or L = n for someinteger n.
Since sin(x) = sin x , we need only consider positiveintegers n. Thus
=n
L, n = 1, 2, 3, . . .
andX = c2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 12 / 21
-
Restrictions on
We have X = c1 cosx + c2 sinx , X (0) = 0, X (L) = 0. First, note that X (0) = c1. The condition X (0) = 0 then
forces c1 = 0.
Now we need to reconcile three things: X = c2 sinx ,X (L) = 0 and we dont want X to be identically zero (i.e., wewant c2 6= 0).
This gives a condition on : sinL = 0, or L = n for someinteger n.
Since sin(x) = sin x , we need only consider positiveintegers n. Thus
=n
L, n = 1, 2, 3, . . .
andX = c2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 12 / 21
-
Implications for and T
Now, recall that = 2, and the T equation wasT kT = 0.
And we know that = n/L for n = 1, 2, 3, . . ., so we have tosolve
T +n2k2
L2T = 0, n = 1, 2, 3 . . . .
The general solution of these are
T = cen2k2t/L2 , n = 1, 2, 3, . . . .
Putting this together with our X solutions, we get solutionsu(x , t) of the form:
u(x , t) = bnen2k2t/L2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 13 / 21
-
Implications for and T
Now, recall that = 2, and the T equation wasT kT = 0.
And we know that = n/L for n = 1, 2, 3, . . ., so we have tosolve
T +n2k2
L2T = 0, n = 1, 2, 3 . . . .
The general solution of these are
T = cen2k2t/L2 , n = 1, 2, 3, . . . .
Putting this together with our X solutions, we get solutionsu(x , t) of the form:
u(x , t) = bnen2k2t/L2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 13 / 21
-
Implications for and T
Now, recall that = 2, and the T equation wasT kT = 0.
And we know that = n/L for n = 1, 2, 3, . . ., so we have tosolve
T +n2k2
L2T = 0, n = 1, 2, 3 . . . .
The general solution of these are
T = cen2k2t/L2 , n = 1, 2, 3, . . . .
Putting this together with our X solutions, we get solutionsu(x , t) of the form:
u(x , t) = bnen2k2t/L2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 13 / 21
-
Implications for and T
Now, recall that = 2, and the T equation wasT kT = 0.
And we know that = n/L for n = 1, 2, 3, . . ., so we have tosolve
T +n2k2
L2T = 0, n = 1, 2, 3 . . . .
The general solution of these are
T = cen2k2t/L2 , n = 1, 2, 3, . . . .
Putting this together with our X solutions, we get solutionsu(x , t) of the form:
u(x , t) = bnen2k2t/L2 sin
nx
L, n = 1, 2, 3, . . .
D. DeTurck Math 241 002 2012C: Solving the heat equation 13 / 21
-
Superposition, again
We can put these solutions together to get solutions of theform
u(x , t) = b1ek2t/L2 sin
x
L+ b2e
42t/L2 sin2x
L+
+ bNeN2k2t/L2 sin
Nx
L.
This function u(x , t) automatically satisfies the boundaryconditions u(0, t) = u(L, t) = 0, since all of the pieces do.
And it would be great for satisfying initial conditions given intrigonometric form for example
u(x , 0) = 3 sinx
L 2 sin 3x
L+ sin
6x
L.
D. DeTurck Math 241 002 2012C: Solving the heat equation 14 / 21
-
Superposition, again
We can put these solutions together to get solutions of theform
u(x , t) = b1ek2t/L2 sin
x
L+ b2e
42t/L2 sin2x
L+
+ bNeN2k2t/L2 sin
Nx
L.
This function u(x , t) automatically satisfies the boundaryconditions u(0, t) = u(L, t) = 0, since all of the pieces do.
And it would be great for satisfying initial conditions given intrigonometric form for example
u(x , 0) = 3 sinx
L 2 sin 3x
L+ sin
6x
L.
D. DeTurck Math 241 002 2012C: Solving the heat equation 14 / 21
-
Taking things to the limit
But what if the initial condition isnt trigonometric? Could weconsider adding together an infinite number of pieces? As in
u(x , t) =n=1
bnen2k2t/L2 sin
nx
L
Then the initial values would be
f (x) =n=1
bn sinnx
L.
So the question is, which functions f (x) (for x in the interval[0, L]) can be expressed as an infinite series of sines?
The (somewhat surprising) answer is, ALL OF THEM! Lets see how this might work in practice (and well take up
the question of proving this claim later).
D. DeTurck Math 241 002 2012C: Solving the heat equation 15 / 21
-
Taking things to the limit
But what if the initial condition isnt trigonometric? Could weconsider adding together an infinite number of pieces? As in
u(x , t) =n=1
bnen2k2t/L2 sin
nx
L
Then the initial values would be
f (x) =n=1
bn sinnx
L.
So the question is, which functions f (x) (for x in the interval[0, L]) can be expressed as an infinite series of sines?
The (somewhat surprising) answer is, ALL OF THEM! Lets see how this might work in practice (and well take up
the question of proving this claim later).
D. DeTurck Math 241 002 2012C: Solving the heat equation 15 / 21
-
Taking things to the limit
But what if the initial condition isnt trigonometric? Could weconsider adding together an infinite number of pieces? As in
u(x , t) =n=1
bnen2k2t/L2 sin
nx
L
Then the initial values would be
f (x) =n=1
bn sinnx
L.
So the question is, which functions f (x) (for x in the interval[0, L]) can be expressed as an infinite series of sines?
The (somewhat surprising) answer is, ALL OF THEM! Lets see how this might work in practice (and well take up
the question of proving this claim later).
D. DeTurck Math 241 002 2012C: Solving the heat equation 15 / 21
-
Taking things to the limit
But what if the initial condition isnt trigonometric? Could weconsider adding together an infinite number of pieces? As in
u(x , t) =n=1
bnen2k2t/L2 sin
nx
L
Then the initial values would be
f (x) =n=1
bn sinnx
L.
So the question is, which functions f (x) (for x in the interval[0, L]) can be expressed as an infinite series of sines?
The (somewhat surprising) answer is, ALL OF THEM! Lets see how this might work in practice (and well take up
the question of proving this claim later).
D. DeTurck Math 241 002 2012C: Solving the heat equation 15 / 21
-
The Fourier ansatz
Just for something concrete, lets suppose we want to solvethe problem
ut =1
5uxx , u(0, t) = u(3, t) = 0, u(x , 0) = 3x x2
for t > 0 and 0 x 3.
Well assume that we can express u as
u(x , t) =n=1
bnen22t/45 sin
nx
3
(this is the ansatz) and see if we can figure out what theconstants bn should be we know that the boundaryconditions are automatically satisfied, and perhaps we canchoose the bns so that
3x x2 =n=1
bn sinnx
3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 16 / 21
-
The Fourier ansatz
Just for something concrete, lets suppose we want to solvethe problem
ut =1
5uxx , u(0, t) = u(3, t) = 0, u(x , 0) = 3x x2
for t > 0 and 0 x 3. Well assume that we can express u as
u(x , t) =n=1
bnen22t/45 sin
nx
3
(this is the ansatz) and see if we can figure out what theconstants bn should be we know that the boundaryconditions are automatically satisfied, and perhaps we canchoose the bns so that
3x x2 =n=1
bn sinnx
3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 16 / 21
-
Integrals rather than derivatives
Were trying to find bns so that
3x x2 =n=1
bn sinnx
3.
By contrast with Taylor series, where you find the coefficientsby integration rather than differentiation.
Well use two basic facts: If n 6= m then
30
sinnx
3sin
mx
3dx = 0.
If n = m then 30
sinnx
3sin
mx
3dx =
30
sin2nx
3dx =
3
2.
D. DeTurck Math 241 002 2012C: Solving the heat equation 17 / 21
-
Integrals rather than derivatives
Were trying to find bns so that
3x x2 =n=1
bn sinnx
3.
By contrast with Taylor series, where you find the coefficientsby integration rather than differentiation.
Well use two basic facts: If n 6= m then
30
sinnx
3sin
mx
3dx = 0.
If n = m then 30
sinnx
3sin
mx
3dx =
30
sin2nx
3dx =
3
2.
D. DeTurck Math 241 002 2012C: Solving the heat equation 17 / 21
-
Finding the coefficients
Were still trying to find bns so that
3x x2 =n=1
bn sinnx
3.
Motivated by the facts on the previous slide, we multiply bothsides by sin mx3 and integrate both sides from 0 to 3:
30
(3x x2) sin mx3
dx =
30
( n=1
bn sinnx
3
)sin
mx
3dx
=n=1
bn
30
sinnx
3sin
mx
3dx
=3bm
2
D. DeTurck Math 241 002 2012C: Solving the heat equation 18 / 21
-
Integration by parts
Its an exercise in integration by parts to show that 30
(3x x2) sin mx3
dx =54
m33(1 (1)m)
Therefore,
bm =36
m33(1 (1)m) =
0 m even
72
m33m odd
So we arrive at a candidate for the solution:
u(x , t) =n=0
72
(2n + 1)33e(2n+1)
22t/45 sin(2n + 1)x
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 19 / 21
-
Integration by parts
Its an exercise in integration by parts to show that 30
(3x x2) sin mx3
dx =54
m33(1 (1)m)
Therefore,
bm =36
m33(1 (1)m) =
0 m even
72
m33m odd
So we arrive at a candidate for the solution:
u(x , t) =n=0
72
(2n + 1)33e(2n+1)
22t/45 sin(2n + 1)x
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 19 / 21
-
Integration by parts
Its an exercise in integration by parts to show that 30
(3x x2) sin mx3
dx =54
m33(1 (1)m)
Therefore,
bm =36
m33(1 (1)m) =
0 m even
72
m33m odd
So we arrive at a candidate for the solution:
u(x , t) =n=0
72
(2n + 1)33e(2n+1)
22t/45 sin(2n + 1)x
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 19 / 21
-
Validating the solution
The series
u(x , t) =n=0
72
(2n + 1)33e(2n+1)
22t/45 sin(2n + 1)x
3
converges for t 0, and certainly satisfies the boundaryconditions. What about the initial conditionu(x , 0) = 3x x2?
Well,
u(x , 0) =n=0
72
(2n + 1)23sin
(2n + 1)x
3
.
D. DeTurck Math 241 002 2012C: Solving the heat equation 20 / 21
-
Validating the solution
The series
u(x , t) =n=0
72
(2n + 1)33e(2n+1)
22t/45 sin(2n + 1)x
3
converges for t 0, and certainly satisfies the boundaryconditions. What about the initial conditionu(x , 0) = 3x x2?
Well,
u(x , 0) =n=0
72
(2n + 1)23sin
(2n + 1)x
3
.
D. DeTurck Math 241 002 2012C: Solving the heat equation 20 / 21
-
Graphical evidence
Red graph: 3x x3, Blue graph: sumOne term:
Three terms:
D. DeTurck Math 241 002 2012C: Solving the heat equation 21 / 21
-
Plotting the solution
Here is a plot of the sum of of the first three terms of the solution:
D. DeTurck Math 241 002 2012C: Solving the heat equation 22 / 21
-
Another example
Now, lets look at a problem with insulated ends:
ut =1
5uxx , ux(0, t) = ux(3, t) = 0, u(x , 0) = 3x x2
for t > 0 and 0 x 3.
This time, with the boundary conditions in mind, well assumethat we can express u as
u(x , t) =n=0
anen22t/45 cos
nx
3
(and see if we can figure out what the constants an should be the boundary conditions are automatically satisfied, and wewill choose the ans so that
3x x2 =n=0
an cosnx
3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 23 / 21
-
Another example
Now, lets look at a problem with insulated ends:
ut =1
5uxx , ux(0, t) = ux(3, t) = 0, u(x , 0) = 3x x2
for t > 0 and 0 x 3. This time, with the boundary conditions in mind, well assume
that we can express u as
u(x , t) =n=0
anen22t/45 cos
nx
3
(and see if we can figure out what the constants an should be the boundary conditions are automatically satisfied, and wewill choose the ans so that
3x x2 =n=0
an cosnx
3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 23 / 21
-
Useful integrals
Were trying to find ans so that
3x x2 =n=0
an cosnx
3.
Again, well use two basic facts: If n 6= m then
30
cosnx
3cos
mx
3dx = 0.
If n = m > 0 then 30
cosnx
3cos
mx
3dx =
30
cos2nx
3dx =
3
2
whereas if n = m = 0 we get 30 1
2 dx = 3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 24 / 21
-
Useful integrals
Were trying to find ans so that
3x x2 =n=0
an cosnx
3.
Again, well use two basic facts: If n 6= m then
30
cosnx
3cos
mx
3dx = 0.
If n = m > 0 then 30
cosnx
3cos
mx
3dx =
30
cos2nx
3dx =
3
2
whereas if n = m = 0 we get 30 1
2 dx = 3.
D. DeTurck Math 241 002 2012C: Solving the heat equation 24 / 21
-
Finding the coefficients
Were still trying to find ans so that
3x x2 =n=0
bn cosnx
3.
Motivated by the facts on the previous slide, we multiply bothsides by cos mx3 and integrate both sides from 0 to 3. Form > 0 we get:
30
(3x x2) cos mx3
dx =
30
( n=0
an cosnx
3
)sin
mx
3dx
=n=0
an
30
cosnx
3cos
mx
3dx
=3am
2
and we get 3a0 for m = 0.
D. DeTurck Math 241 002 2012C: Solving the heat equation 25 / 21
-
Integration by parts
Its an exercise in integration by parts to show that
30
(3x x2) cos mx3
dx =
0 m odd92 m = 0 27
m22m > 0. even
So we arrive at a candidate for the solution:
u(x , t) =3
2n=1
36
(2n)22e(2n)
22t/45 cos2nx
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 26 / 21
-
Integration by parts
Its an exercise in integration by parts to show that
30
(3x x2) cos mx3
dx =
0 m odd92 m = 0 27
m22m > 0. even
So we arrive at a candidate for the solution:
u(x , t) =3
2n=1
36
(2n)22e(2n)
22t/45 cos2nx
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 26 / 21
-
Validating the solution
The series
u(x , t) =3
2n=1
36
(2n)22e(2n)
22t/45 cos2nx
3
converges for t 0, and certainly satisfies the boundaryconditions. What about the initial conditionu(x , 0) = 3x x2?
Well,
u(x , 0) =3
2n=1
36
(2n)22cos
2nx
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 27 / 21
-
Validating the solution
The series
u(x , t) =3
2n=1
36
(2n)22e(2n)
22t/45 cos2nx
3
converges for t 0, and certainly satisfies the boundaryconditions. What about the initial conditionu(x , 0) = 3x x2?
Well,
u(x , 0) =3
2n=1
36
(2n)22cos
2nx
3
D. DeTurck Math 241 002 2012C: Solving the heat equation 27 / 21
-
Graphical evidence
Red graph: 3x x3, Blue graph: sumOne term, two terms:
Four terms, thirteen terms:
D. DeTurck Math 241 002 2012C: Solving the heat equation 28 / 21
-
Plotting the solution
Here is a plot of the sum of of the first three terms of the solution:
D. DeTurck Math 241 002 2012C: Solving the heat equation 29 / 21
-
Other boundary conditions
Questions for discussion:
How would you handle boundary conditions ux(0, t) = 0,u(3, t) = 0?
What about u(0, t) = 0, ux(3, t) = 0? What about something like u(0, t) = 0, ux(3, t) + u(3, t) = 0?
D. DeTurck Math 241 002 2012C: Solving the heat equation 30 / 21