Seperation of Var M415
Seperation of Var M415
Seperation of Var M415
Separation of Variables
At this point we are ready to now resume our work on solving the three
main equations: the heat equation, Laplaces equation and the wave equation using the method of separation of variables.
4.1
t>0
(4.1)
u(0, t) = u(1, t) = 0.
(4.2)
(4.3)
(4.4)
implying that
T 0 = T,
X 00 = X,
(4.5)
where is a constant. From (4.2) and (4.3), the boundary conditions becomes
X(0) = X(1) = 0.
(4.6)
(4.7)
c1 sin k + c2 cos k = 0,
(4.8)
c1 sin k = 0 k = 0, , 2, . . . n,
(4.9)
which leads to
c2 = 0,
2 2 t
u(x, t) =
bn en t sin nx,
n=1
bn sin nx.
n=1
At this point, we recognize that we have a Fourier sine series and that the
coefficients bn are chosen such that
Z 1
bn = 2
(x x2 ) sin nx dx
0
1 2x
= 2
cos nx +
n2 2
4
=
(1 (1)n ).
3
n 3
2
x2 x
3 3
n
n
cos nx
0
4
3
1 (1)n n2 2 t
sin nx.
n3 e
n=1
(4.10)
t>0
(4.11)
subject to
u(x, 0) = x x2 ,
u x (0, t) = u x (1, t) = 0.
(4.12)
(4.13)
X 00 = X,
(4.14)
(4.15)
Integrating the X equation in (4.14) gives rise to again three cases depending on the sign of but as seen earlier, only the case where = k2 for
some constant k is relevant. Thus, we have
X(x) = c1 sin kx + c2 cos kx.
(4.16)
c1 k cos k c2 k sin k = 0,
(4.17)
which leads to
c1 = 0, sin k = 0 k = 0, , 2, . . . , n,
(4.18)
2 2 t
u(x, t) =
an en t cos nx,
n=0
an cos nx
n=0
a0
=
+ an cos nx.
2
n=1
We again recognize that we have a Fourier cosine series and that the coefficients an are chosen such that
Z
a0 = 2
Z
an = 2
1
0
1
1
x2 x3
1
= ,
(x x ) dx = 2
2
3 0 3
(x x2 ) cos nx dx
1 2x
= 2
sin nx
n2 2
2
= 3 3 (1 + (1)n ).
n
2
x2 x
3 3
n
n
sin nx
0
2
1
+ 3
3
(1)( n + 1) 1 n2 2 t
e
cos nx.
n3
n=1
(4.19)
0.3
0.3
t=0
t=0
0.2
0.2
t = .05
t = 0.1
t = .025
0.1
0.1
t = 0.2
0.0
0.0
0.0
0.5
1.0
0.0
0.5
1.0
Figure 1. The solution of the heat equation with the same initial condition with
fixed and no flux boundary conditions.
Example 2
Solve
ut = u xx , 0 < x < 2,
t>0
(4.20)
subject to
(
u(x, 0) =
x
2x
if 0 < x < 1,
if 1 < x < 2,
u(0, t) = u x (2, t) = 0.
(4.21)
(4.22)
gives rise to
T 0 = T,
X 00 = X,
(4.23)
(4.24)
(4.25)
c1 k cos 2k c2 k sin 2k = 0,
which leads to
3 5
(2n 1)
,
,
,...,
,
4 4 4
4
c2 = 0, cos 2k = 0 k =
(2n1)2 2
t
16
u(x, t) =
bn e
(2n1)2 2
t
16
n=1
sin
(2n 1)
x,
4
u(x, 0) =
bn sin
n=1
(2n 1)
x.
4
1
0
(2n 1)
x sin
x dx +
4
(2 x) sin
1
(2n 1)
x dx
4
32
(2n 1)
8x
2n 1
=
sin
x
cos
x
2
2
4
(2n 1)
4
(2n 1)
0
32
(2n 1)
8(x 2)
2n 1
sin
+
x
+
cos
x
4
(2n 1)
4
(2n 1)2 2
1
32
(2n 1)
sin
+ cos n .
=
4
(2n 1)2 2
Hence, the solution of the PDE is
(2n1)
sin
+
cos
n
(2n1)2
4
32
2n 1
16 2 t
x. (4.26)
u(x, t) = 2
e
sin
2
4
n=1
(2n 1)
Figure 2 shows the solution both in short time t = 0, 0.1, 0.2 and long time
t = 10, 20, 30.
0.8
t=0
t = 10
t=2
t = 20
0.4
t = 30
t=1
x
0.0
x
0
Figure 2. Short time and long time behavior of the solution (4.26).
Example 3
Solve
ut = u xx , 0 < x < 2,
t>0
(4.27)
subject to
u(x, 0) = 2x x2 u(0, t) = 0, u x (2, t) = u(2, t).
(4.28)
In this problem, we have a fixed left endpoint and a radiating right end
point. Assuming separable solutions
u(x, t) = X(x)T(t),
(4.29)
gives rise to
T 0 = T,
X 00 = X,
(4.30)
X 0 (2) = X(2).
(4.31)
(4.32)
(4.33)
It is very important that we recognize that the solutions of (4.33) are not
equally spaced as seen in earlier problems. In fact, there are an infinite
number of solutions of this equation. Figure 3 shows graphically the curves
y = k and y = tan 2k. The first three intersection points are the first three
solutions of (4.33).
y
4
0
0
k3
1
kn
1.144465
2.54349
4.048082
5.586353
7.138177
n
6
7
8
9
10
kn
8.696622
10.258761
11.823162
13.389044
14.955947
Therefore, we have
X(x) = c1 sin k n x.
(4.34)
T(t) = c3 ekn t
(4.35)
u(x, t) =
cn ekn t sin kn x,
(4.36)
n=1
u(0, t) = 2x x2 =
cn sin kn x,
(4.37)
n=1
2
0
(2x x ) sin k m x dx =
cn
n=1
2
0
For n 6= m, we have
Z 2
k m sin 2k n cos 2k m k n sin 2k m cos 2k n
sin k m x sin k n x dx =
k2n k2m
0
(4.38)
or
R2
cn =
(2x x2 ) sin k n x dx
R2
2
0 sin k n x dx,
cn
0.873214
0.341898
-.078839
0.071427
-.032299
n
6
7
8
9
10
cn
0.028777
-.016803
0.015310
-.010202
0.009458
(4.39)
10
y
1.0
t =
t =
t =
0.5
0.0
x
0
t>0
(4.40)
subject to
u(x, 0) = 4x x2 u(0, t) = 0, u(3, t) = 3.
(4.41)
X(3)T(t) = 3,
(4.42)
11
(4.43)
(4.44)
We notice that under the transformation (4.44), the original equation doesnt
change form, i.e.
ut = u xx
vt = v xx
t>0
(4.45)
subject to
v(x, 0) = 3x x2 v(0, t) = 0, v(3, t) = 3.
(4.46)
(4.47)
n
x,
3
and
T(t) = c3 e
n2 2
9 t
(4.48)
12
v(x, t) =
bn e
n2 2
9 t
sin
n=1
n
x.
3
bn
Z
2 3
n
=
(3x x2 ) sin
x dx
3 0
3
3
6(2x 3)
n
3(n2 2 x2 3n2 2 x 18)
n
=
sin
x+
cos
x
3
3
n2 2
n3 3
0
n
32(1 (1) )
=
.
n3 3
This gives
v(x, t) =
32
3
(1 (1)n ) n2 2 t
n
9
e
sin
x.
3
3
n
n=1
32
3
n
(1 (1)n ) n2 2 t
e 9 sin
x.
3
3
n
n=1
(4.49)
t =
t =
t =
0
0
Example 5
Solve
ut = u xx , 0 < x < 1,
t>0
(4.50)
subject to
u(x, 0) = 0 u x (0, t) = 1, u x (1, t) = 0.
(4.51)
13
(4.52)
(4.53)
ut = u xx , vt = v xx .
(4.54)
noting now
(4.55)
x2
2
problem
vt = v xx , 0 < x < 1, t > 0
(4.56)
subject to
1
v(x, 0) = x x2 , v x (0, t) = v x (1, t) = 0
(4.57)
2
A separation of variables v = XT leads to X 00 = k2 X and T 0 = k2 T
from which we obtain
X = c1 sin kx + c2 cos kx,
(4.58)
k = n,
(4.59)
(4.60)
14
and further
T(t) = c3 en
2 2 t
(4.61)
Finally we arrive at
v(x, t) =
2 2
a0
+ an en t cos nx.
2
n=1
1 2
a0
x x =
+ an cos nx.
2
2
n=1
2
=
1
Z
Z
1 2
1
2
x x , dx = x2 x3 = ,
2
3 0 3
1
2 1
(x x2 ) cos nx dx
=
1 0
2
(2x x2 )
2
2(x 1)
cos
nx
+
sin
nx
=
n
n2 2
n3 3
0
2
= 2 2.
n
1
2
2
3
1 n2 2 t
e
cos nx.
n2
n=1
1 n2 2 t
e
cos nx.
n2
n=1
(4.62)
Figure 6 shows plots at time t = 0.01, 0.5, 1.0 and 1.5. It is interesting to
note that at the left boundary u x = 1 and since the flux = ku x implies
that = k > 0 which gives that the flux is position and that heat is being
added at the left boundary. Hence the profile increase at the left while
insulated at the right boundary (no flux).
15
t = 1.5
1
t = 1.0
t = 0.5
t = 0.1
x
0.0
0.5
1.0
(4.63)
(4.64)
(4.65)
(4.66)
16
The new initial condition doesnt pose a problem but how do we solve the
heat equation with a term added to the equation.
0 < x < L,
u(L, t) = 0,
t > 0,
(4.69)
u(x, 0) = f (x).
u(x, t) =
Tn (t) sin
n=1
where
Tn (t) =
nx
,
2
16(1 (1)n ) n2 2 t
e 4
n3 3
(4.70)
(4.71)
n2 2
Tn (t),
4
leading to the solution (4.71). For the problem with a source term we look
for solutions of the same form i.e. (4.70). However, in order that this technique works, it is necessary to expand the source term also in terms of a
Fourier sine series, i.e.
Q(x) =
n=1
For
(
Q(x) =
nx
.
2
(4.72)
if 0 < x < 1,
if 1 < x < 2,
(4.73)
qn sin
x
2x
17
where
Z
qn =
=
=
+
=
nx
dx.
2
0
Z 1
Z 2
nx
nx
x sin
dx +
(2 x) sin
dx,
2
2
0
x
4
nx
nx 1
sin
2xn cos
2
2 0
n2 2
4
nx 2x4
nx 2
2 2 sin
,
+
cos
2
n
2 1
n
8
nx
sin
.
2
n2 2
Q(x) sin
(4.74)
n=1
nx 2
nx
nx
nx
Tn (t) sin
=
+ qn sin
,
2
2
2
2
n=1
n=1
n2 2
Tn (t) = qn ,
4
(4.75)
qn
n2 2
+ bn e(
n 2
2 ) t
u(x, t) =
n=1
4
nx
)2 t
( n
2
sin
.
q n + bn e
2
2
2
n
4
nx
2
2x x =
qn + bn sin
.
2
2
2
n
n=1
If we set
cn =
then we have
2
qn
n2 2
2x x =
+ bn ,
cn sin
n=1
nx
.
2
(4.76)
18
nx
2x x2 sin
dx.
2
0
16
n
1
cos
=
,
2
n3 3
cn =
(4.77)
qn ,
n2 2
2t
4
4
nx
( n
)
qn + cn 2 2 qn e 2
u(x, t) =
sin
,
2
2
2
n
n
n=1
(4.78)
where qn and cn are given in (4.74) and (4.77), respectively. Typical plots
are given in figure 7 at times t = 0, 1, 2 and 3.
1.0
y
t =
t =
t =
t =
0.5
0.0
x
0
(4.79)
(4.80)
19
where c1 , c2 , k1 and k2 are constants of integration. Imposing that the solution and its first derivative are continuous at x = 1 and that the solution is
zer0 at the endpoints gives
c1 c1 + 1 = 0, c1 + c2 k1 k2 +
c2 = 0, 2k1 + k2
2
= 0,
3
8
= 0,
3
(4.81)
(4.82)
u(1, t) = 0,
u(x, 0) = x x2 ,
(4.83)
where is some constant. We could try a separation of variables to obtain solutions for this problem, but for more complicated source terms like
Q(x, t)u, a separation of variables is unsuccessful. Therefore, we try a different technique. Here we will try and transform the PDE to one that has
no source term. In attempting to do so, we seek a transformation of the
form
u(x, t) = A(x, t)v
(4.84)
and ask Is is possible to find A such that the source term in (4.83) can be
removed? Substituting of (4.84) in (4.83) gives
Avt + At v = Av xx + 2A x v x + A xx v + Av,
20
Ax
A xx
At
vt = v xx + 2 v x +
+ v.
A
A
A
In order to target the standard heat equation, we choose
A x = 0,
A xx
At
+ = 0.
A
A
(4.85)
From the first we obtain that A = A(t) and from the second we obtain
A0 = A which has the solution A(t) = A0 et for some constant A0 . The
boundary conditions becomes
u(0, t) = 0 A0 et v(0, t) = 0 v(0, t) = 0,
v(1, t) = 0 A0 et v(1, t) = 0 v(1, t) = 0,
so the boundary conditions become unchanged. Next, we consider the
initial condition, so
u(x, 0) = x x2 A0 e0 v(x, 0) = 0 A0 v(x, 0) = x x2 ,
and as to leave the initial condition unchanged, we choose A0 = 1. Thus,
under the transformation
u = et v
(4.86)
v(1, t) = 0,
v(x, 0) = x x2 ,
(4.87)
4
3
1 (1)n n2 2 t
sin nx,
n3 e
n=1
n3
n=1
(4.88)
21
Figure 8 shows plots at times t = 0, 0.1 and 0.2 when = 5 and 12. It
is interesting to note that in the case where = 5, the diffusion is slower
in comparison with no source term (i.e = 0 see Figure 1) and there is no
diffusion at all when = 12.
t = 0.2
0.4
0.3
t= 0
t = 0.1
t= 0
0.2
t = 0.1
0.2
t = 0.2
0.1
0.0
x
0.0
0.5
1.0
0.0
x
0.0
0.5
1.0
Figure 8. The solution (4.88) of the heat equation with a source (4.83) with = 5
and = 12.
8 t 2 t
1 92 t
u = 3e
e
sin x + e
sin 3x + . . . .
(4.89)
27
Now clearly the exponential terms in () will decay to zero with the first
term decaying the slowest. Therefore, it is the balance between et and
2
t>0
(4.90)
22
It is now necessary to determine what happens to the boundary conditions. Using (4.86) we have
u x (0, t) = 0 A0 et v x (0, t) = 0 v x (0, t) = 0,
(4.91)
(4.92)
and so the insulted boundary conditions also remain insulated! Thus, the
problem (4.90) becomes
vt = v xx , 0 < x < 2, t > 0
v(x, 0) = 4x x2 ,
v x (0, t) = 0,
v x (2, t) = 0.
(4.93)
n2 2
n
1
a0 + an e 4 t cos
x,
2
2
n=1
(4.94)
where
a0
2
=
2
Z
Z
2
0
2
x4
= 4,
(4x x ) dx = 2x
4 0
3
2 2
n
(4x x3 ) cos
x dx
(4.95)
2 0
2
2
2(4x x3 )
48
n
4(4 3x2 )
96
n
=
+ 3 3 sin
x+
+ 4 4 cos
x
n
2
2
n
n2 2
n
0
6
4
16
96
48
n
96
n
= 2 2 4 4+
+ 3 3 sin
+
+ 4 4 cos
.
2
2
n n
2
2
n
n
n
n
an =
an e
n=1
n2 2
4 t
cos
n
x,
2
(4.96)
where an is given in (4.95). Figure 9 show plots at t = 0, 0.2, 0.4 and 0.6
when = 2 and 2. It is interesting to note that the sign of will determine whether the solution will grow or decay exponentially.
23
t= 0
8
t = 0.6
6
2
t = 0.4
t = 0.2
4
t = 0.2
t = 0.4
t = 0.6
2
t= 0
x
0
x
0
Figure 9. The solution (4.96) of the heat equation with a source (4.90) with no
flux boundary condition with = 2 and = 2.
u(1, t) = 0,
u(x, 0) = x x2 ,
(4.97)
(4.98)
and ask Is is possible to find A such that the convection term can be removed? Substituting of (4.98) in (4.97) gives
Avt + At v = Av xx + 2A x v x + A xx v + (Av x + A x v) ,
24
2A x + A
A xx At + A x
vx +
v.
A
A
(4.99)
A xx At + A x = 0.
(4.100)
From the first we obtain that A(x, t) = C(t)e 2 x and from the second
we obtain C 0 +
2
4 C
1 2
A(x, t) = A0 e 2 x 4
(4.101)
21 14 2 t
v(1, t) = 0 v(1, t) = 0,
(4.102)
(4.103)
u(x, 0) = x x2 v(x, 0) = (x x2 )e 2 x ,
(4.104)
1 2
u = e 2 x 4 t v,
(4.105)
v(1, t) = 0,
t > 0,
1
v(x, 0) = (x x2 )e 2 x .
(4.106)
v(x, t) =
bn en t sin nx,
n=1
(4.107)
25
(x x2 )e 2 x sin nx dx,
(4.108)
1 2
t
u(x, t) = e 2 x 4
bn en t sin nx,
(4.109)
n=1
(x x2 )e3x sin nx dx
= 4n
27 + n2 2 + 2n2 2 e3 cos n
.
(9 + n2 2 )3
(4.110)
For = 12
Z
bn = 2
(x x2 )e6x sin nx dx
= 2n
(4.111)
1 2
u(x, t) = 4e 2 x 4 t
(4.112)
2
2
2
2
3
27 + n + 2n e cos n n2 2 t
n
e
sin nx,
(9 + n2 2 )3
n=1
1 2
u(x, t) = 2e 2 x 4 t
(4.113)
2
2
2
2
6
7n + 108 + (5n + 324)e cos n n2 2 t
n
e
sin nx.
2 2 )3
(36
+
n
n=1
Figure 10 shows graphs at a variety of times for = 6 and = 12.
26
0.3
0.3
t= 0
t= 0
0.2
t = 0.025
0.2
t = 0.05
t = 0.05
0.1
0.1
t = 0.1
0.0
0.0
x
0.0
0.5
1.0
x
0.0
0.5
1.0
Figure 10. The solution (4.112) of the heat equation with convection with fixed
boundary conditions with = 6 and = 12.
Example 7
As a final example, we consider
ut = u xx + u x ,
0 < x < 2,
t>0
(4.114)
subject to
u(x, 0) = 4x x3 u x (0, t) = 0, u x (2, t) = 0.
(4.115)
1 2
u x = e 2 x 4 t v x
1 x 1 2 t
4
e 2
v,
2
(4.116)
and so
v(0, t) = 0,
2
u x (0, t) = 0 v x (0, t)
(4.117)
(4.118)
27
Thus, the insulated boundary condition become radiating boundary conditions. As for the initial condition
1
(4.119)
4.2
Laplaces equation
(4.120)
We will show that a separation of variables also works for this equation
As an example consider the boundary conditions
u(x, 0) = 0, u(x, 1) = x x2
(4.121a)
u(0, y) = 0, u(1, 0) = 0.
(4.121b)
(4.122)
(4.123)
(4.124)
and since each term is only a function of x or y, then each must be constant
giving
X 00
Y 00
= ,
= .
(4.125)
X
Y
From the first of (4.121a) and both of (4.121b) we deduce the boundary
conditions
X(0) = 0,
X(1) = 0, Y(0) = 0.
(4.126)
28
(4.127)
(4.128)
(4.129)
(4.130)
u=
(4.131)
n=1
u(x, 1) = x x =
an sin nx sinh n.
(4.132)
n=1
This looks like a Fourier sine series and if we let An = an sinh n, this
becomes
An sin nx = x x2.
(4.133)
n=1
2 2
x x2 sin nx dx
An =
1 0
16
= 3 3 (1 cos n),
(4.134)
n
29
4(1 (1)n )
.
n3 3 sinh n
(4.135)
1 (1)n
sinh ny
sin nx
.
3
sinh n
n
n=1
(4.136)
y
1.0
0.2
u = 0.2
u = 0.1
0.1
0.5
u = 0.05
0.0
u = 0.025
0.5
u = 0.001
0.0
x
0.0
0.5
1.0
1.0
1.0
Figure 11. The solution (4.120) with the boundary conditions (4.121)
(4.137)
subject to
u(x, 0) = 0, u(x, 1) = f (x),
u(0, y) = 0, u(1, y) = 0,
is
ny
nx sinh Ly
u = bn sin
,
L x sinh n
Ly
n=1
(4.139)
30
where
2
bn =
Lx
Lx
f (x) sin
nx
dx.
Lx
(4.140)
In the next three examples, we will construct solutions of Laplaces equation when we have nonzero boundary condition on each of the remaining
three sides of the region 0 < 1, 0 < y < 1.
Example 8
Solve
u xx + uyy = 0,
(4.141)
subject to
u(x, 0) = 0, u(x, 1) = 0,
(4.142a)
u(0, y) = 0, u(1, y) = y y2 .
(4.142b)
(4.143)
(4.144)
(4.145)
Y 00
=
Y
(4.146)
(4.147)
31
(4.148)
(4.149)
(4.150)
(4.151)
u=
(4.152)
n=1
(4.153)
n=1
An sin ny = y y2.
(4.154)
n=1
16
(1 cos n),
n3 3
(4.155)
32
and further that the solution to Laplaces equation with the boundary conditions given in (4.141) subject to (4.186) is
4
u= 3
1 (1)n sinh nx
sin ny.
n3
sinh n
n=1
(4.156)
Figure 12 show both a top view and a 3 D view of the solution. In comparing the solutions (4.136) and (4.156) shows that if we interchange x and
y they are the same. This should not be surprising because if we consider Laplace equations with the boundary conditions given in (4.121) and
(4.186), that if we interchange x and y, the problems are transformed to
each other.
In general, using separation of variables, the solution of
u xx + uyy = 0, 0 < x < L x ,
0 < y < Ly
(4.157)
subject to
u(x, 0) = 0, u(x, 1) = 0
u(0, y) = 0, u(1, y) = g(y).
is
sinh nx
Lx
u=
bn sinh n
Lx
n=1
where
2
bn =
Ly
sin
Ly
g(y) sin
ny
Ly
ny
dy
Ly
(4.159)
(4.160)
Example 9
Solve
u xx + uyy = 0
(4.161)
u(x, 0) = x x2 , u(x, 1) = 0
(4.162a)
u(0, y) = 0, u(1, y) = 0.
(4.162b)
subject to
33
(4.163)
X 00 Y + XY 00 = 0,
(4.164)
leads to
(4.165)
X 00
Y 00
= ,
=
(4.166)
X
Y
From the first of (4.162a) and both of (4.162b) we deduce the boundary
conditions
X(0) = 0,
X(1) = 0, Y(1) = 0,
(4.167)
noting that the last boundary condition is different than the boundary condition considered at the beginning of this section (i.e. Y(0) = 0). The remaining boundary condition in (4.162a) will be used later. In order to solve
the X equation in (4.166) subject to the boundary conditions (4.167), it is
necessary to set = k2 . The X equation (4.166) as the general solution
Y = c1 sin kx + c2 cos kx
(4.168)
(4.169)
(4.170)
c4 = c2
sinh n
.
cosh n
(4.171)
34
sinh n
cosh n
sinh n(1 y)
.
sinh n
(4.172)
(4.173)
= c3
so
u=
(4.174)
n=1
an sin nx sinh n.
(4.175)
n=1
At this point we recognize that this problem is now identically to the first
problem in this section where we obtained
an =
4(1 (1)n )
n3 3 sinh n
(4.176)
4
3
1 (1)n
sinh n(1 y)
n3 sin nx sinh n .
n=1
(4.177)
0 < y < Ly
subject to
u(x, 0) = f (x), u(x, 1) = 0
u(0, y) = 0, u(1, y) = 0.
(4.178)
n(1y)
nx sinh Ly
u = bn sin
Lx
sinh n
Ly
n=1
where
2
bn =
Lx
35
Lx
f (x) sin
nx
dx
Lx
(4.180)
(4.181)
Example 10
As the final example, we consider
u xx + uyy = 0
(4.182)
subject to
u(x, 0) = 0, u(x, 1) = 0
(4.183a)
u(0, y) = y y2 , u(1, y) = 0.
(4.183b)
4
3
(4.184)
0 < y < Ly
subject to
u(x, 0) = 0, u(x, 1) = 0
u(0, y) = g(y), u(1, y) = 0.
(4.185)
36
is
u=
bn
sinh n(1x)
Ly
sinh
n=1
where
2
bn =
Ly
Ly
0
n
Ly
g(y) sin
sin
ny
.
Ly
ny
dy
Ly
(4.187)
(4.188)