You are on page 1of 7

9.

3 Separation of variables for nonhomogeneous equations


Section 5.4 and Section 6.5, An Introduction to Partial Differential Equa-
tions, Pinchover and Rubinstein
The method of separation of variables can be used to solve nonhomogeneous
equations. We only consider the case of the heat equation since the book
treat the case of the wave equation. Consider the initial boundary problem

ut kuxx = f (x, t),
0 < x < L, t > 0
u(0, t) = u(L, t) = 0, t0 (9.15)


u(x, 0) = (x), 0 < x < L.

We look for solutions u in the form u(x, t) = T (t)X(x). As before we look


at the eigenvalue problem
%
X !! + X = 0
(9.16)
X(0) = X(L) = 0.

The eigenvalues and the corresponding eigenfunctions are


& n '2 n
= , Xn (x) = sin x.
L L
Now we set ( n
u(x, t) = Tn (t) sin x.
L
n1

Formally computing ut and uxx and substituting to (9.15), we get


() & n '2 * & nx '
!
f (x, t) = ut kuxx = Tn (t) + k Tn (t) sin .
L L
n1

Hence expanding f and into the Fourier series


( & nx '
f (x, t) = fn (t) sin
L
n1
( & nx '
(x) = n sin
L
n1

where
+ L & nx ' + L & nx '
2 2
fn (t) = f (x, t) sin dx and n = (x) sin dx
L 0 L L 0 L

86
we get
() & n '2 * & nx ' ( & nx '
Tn! (t) +k Tn (t) sin = fn (t) sin
L L L
n1 n1

The uniqueness of the Fourier expansion leads to the family of ODEs


& n '2
Tn! (t) + k Tn (t) = fn (t). (9.17)
L
In addition,
( n ( & nx '
u(x, 0) = Tn (0) sin x= n sin = (x)
L L
n1 n1

so that
Tn (0) = n , n 1. (9.18)
Solving (9.17)(9.18), we find
2
+ t n 2
k ( n
L )
Tn (t) = n e t
+ ek( L ) (ts)
fn (s) ds
0

and
( 2 & nx ' ( & nx ' + t n 2
L )
k ( n
u(x, t) = n e t
sin + sin ek( L ) (ts) fn (s) ds.
L L 0
n1 n1

9.4 Nonhomogeneous boundary conditions


Section 6.5, An Introduction to Partial Differential Equations, Pinchover
and Rubinstein
We consider a general, one-dimensional, nonhomogeneous, parabolic initial
boundary value problem with nonhomogeneous boundary conditions. The
hyperbolic problem is treated in the same way. Let u be a solution of the
problem
r(x)m(t)ut [(p(x)u)x + q(x)u] = F (x, t) a < x < b, t > 0.
Ba (u) := u(a, t) + ux (a, t) = a(t) t 0.
(9.19)
Bb (u) := u(b, t) + ux (b, t) = b(t) t 0.
u(x, 0) = f (x) a x b.
We assume that u has the following from

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

87
where w is a smooth functions satisfying only the boundary conditions,

Ba (w) = a(t) and Bb (w) = b(t).

Then v(x, t) = u(x, t) w(x, t) is a solution of the following problem

r(x)m(t)vt [(p(x)v)x + q(x)v] = F,(x, t) a < x < b, t > 0.


Ba (u) := u(a, t) + ux (a, t) = 0 t 0.
Bb (u) := u(b, t) + ux (b, t) = 0 t 0.
u(x, 0) = f,(x) axb

where

F,(x, t) = F (x, t) r(x)m(t)wt + [(p(x)wx )x + q(x)w]


f,(x) = f (x) w(x, 0).

Consequently, v is a solution of the, nonhomogeneous, parabolic initial


boundary value problem with homogeneous boundary conditions to which
one can applies the methods from the previous section. In general a function
w has the form

w(x, t) = (A1 + B1 x + C1 x2 )a(t) + (A2 + B2 x + C2 x2 )b(t).

The following list gives the form of the function w for given boundary con-
ditions.
(1) (Dirichlet boundary conditions), u(0, t) = a(t), u(L, t) = b(t),
x
w(x, t) = a(t) + [b(t) a(t)].
L

(2) (Neumann boundary conditions), ux (0, t) = a(t) ux (L, t) = b(t),

x2
w(x, t) = xa(t) + [b(t) a(t)].
2L

(3) (Mixed boundary conditions), u(0, t) = a(t) ux (L, t) = b(t),

w(x, t) = a(t) + xb(t).

(4) (Mixed boundary conditions), ux (0, t) = a(t) u(L, t) = b(t),

w(x, t) = (x L)a(t) + b(t).

88
Example 9.13. Consider the problem

ut uxx = et sin 3x 0 < x < , t > 0,


u(0, t) = 0, u(, t) = 1 t 0,
u(x, 0) = (x) 0 x .

We look for the solution u of the form u(x, t) = v(x, t) + w(x, t). Since we
are dealing with Dirichlet boundary conditions we take for w the function
x
w(x, t) = .

Then the function v has to be the solution of the following problem

vt vxx = et sin 3x 0 < x < , t > 0,


v(0, t) = 0, v(, t) = 0 t 0,
x
v(x, 0) = (x) 0 x .

The eigenvalues and the corresponding eigenfunctions for the associated
Sturm-Liouville problem

X !! + X = 0 0 < x < ,
X(0) = X() = 0

are given by

n = n 2 and Xn (x) = sin nx, n 1.

Hence the formal solution v of the above problem is given by the formal
Fourier series (
v(x, t) = Tn (t) sin nx.
n1

Differentiating v (formally) with respect to t and twice with respect to x,


and substituting into the equation we get
(
vt vxx = [Tn! (t) + n2 Tn (t)] sin nx = et sin 3x
n1

which implies that


%
0 n $= 3, n 1
Tn! (t) + n2 Tn (t) = (9.20)
et n = 3.

89
Moreover, at t = 0,
x (
(x) = v(x, 0) = Tn (0) sin nx

n1

so that +
2
Tn (0) = [(x) x/] sin nx dx.
0
If n $= 3, then
2
Tn (t) = Tn (0)en t .
If n = 3, then we look for the solution Tn (t) of the form Tn (t) = A(t)e9t.
Then

T3! (t) + 9T3 (t) = A! (t)e9t 9A(t)e9t + 9A(t)e9t = A! (t)e9t = et

so that A! (t) = e8t and


+ t
1
A(t) = A(0) + e8s ds = A(0) + [e8t 1].
0 8
Hence
1
T3 (t) = A(0)e9t + [e8t 1]e9t .
8
Moreover, T3 (0) = A(0). Hence
( 1 ( 2
v(x, t) = Tn (t) sin nx = [e8t 1]e9t + Tn (0)en t sin nx
8
n1 n1

and
x 1 8t ( 2
u(x, t) = + [e 1]e9t + Tn (0)en t sin nx
8
n1
x 1 ( 2
= + [et e9t ] + Tn (0)en t sin nx.
8
n1

Example 9.14. Consider

utt 4uxx = (1 x) cos t 0 < x < , t > 0,


ux (0, t) = cos t 1, ux (, t) = cos t t 0,
x2
u(x, 0) = 0 x ,
2
ut (x, 0) = cos 3x 0 x .

90
We look for the solution u of the form u(x, t) = v(x, t) + w(x, t). Since we
are dealing with Neumann boundary conditions we take for w the function
x2 x2
w(x, t) = x(cos t 1) + [cos t (cos t 1)] = x(cos t 1) + .
2 2
Since
1
wtt = x cos t and wxx =

and
x2
w(x, 0) = and wt (x, 0) = 0
2
the function v must be the solution of the problem
4
vtt 4vxx = cos t + 0 < x < , t > 0,

vx (0, t) = 0, vx (, t) = 0 t 0,
v(x, 0) = 0 0 x ,
vt (x, 0) = cos 3x 0 x .
The formal solution v of this problem has the form
(
v(x, t) = Tn (t)Xn (x)

where Xn (t) are eigenfunctions of the Sturm-Liouville problem

X !! (x) + X(x) = 0 0 < x < , ,


! !
X (0) = X () = 0
The eigenvalues and the corresponding eigenfunctions are

n = n 2 , Xn (x) = cos nx, n 0.

So, (
v(x, t) = Tn (t) cos nx.
n0

Differentiating v with respect to t and x and substituting into the equation


we get
( 4
vtt 4vxx = [Tn!! (t) + 4n2 Tn (t)] cos nx = cos t + .

n0

This gives %
4
cos t + n=0
Tn!! + 4n2 Tn (t) = (9.21)
0 n 1.

91
In addition, if t = 0, then
(
0 = v(x, 0) = Tn (0) cos nx
n0

showing that Tn (0) = 0 for all n 0, and differentiating v with respect to t


at t = 0, we get (
cos 3x = vt (x, 0) = Tn! (0) cos nx
n0

showing that %
1, n=3
Tn! (0) =
0, n $= 3, n 0
The general solution of (9.21) for n 1 is equal to

Tn (t) = An cos 2nt + Bn sin 2nt.

Since Tn (0), An = 0 so that Tn (t) = Bn sin 2nt and Tn! (t) = 2nBn cos 2nt.
Then Tn! (0) = 0 for n 3 showing that

Tn 0, for all n 1 and n $= 3.

If n = 3, then T3! (0) = 6B3 = 1 so that B3 = 1/6. Hence


1
T3 (t) = sin 6t.
6
Finally, if n = 0, then
+ t + t
4t
T0! (t) = T0! (0) + [cos t + 4/] ds = [cos t + 4/] ds = sin t + ,
0 0
and
+ t + t - .t 2t2 2t2
T0 (t) = T0 (0)+ T0! (s) ds = [sin s+4s/] ds = cos s 0 + = (1cos t)+ .
0 0
Summing up, the solution v has the form
2t2 1
u(x, t) = (1 cos t) + + sin 6t cos 3x
6
and
x2 2t2 1
u(x, t) = v(x, t) + w(x, t) = + (1 cos t) + + sin 6t cos 3x.
2 6

92

You might also like