Solution by Separation of Variables

The classical method of solution for such BVPs is the method of separation of variables . Assume a solution of the separated form

u(x,t) = X(x)*T(t)

a product of one function just containing x and one function just containing t . Recall the initial example

u(x,t) = sin(x)*cos(3*t)

from above.

Now, generalize this to the product u(x,t) = X(x)*T(t) , that is, to

> U := X(x)*T(t);

U := X(x)*T(t)

>

to which we next apply the fixed endpoint conditions, obtaining

X(0)*T(t) = 0

and

X(L)*T(t) = 0

that is,

> subs(x=0,U) = 0;
subs(x=L,U) = 0;

X(0)*T(t) = 0

X(L)*T(t) = 0

>

Ruling out the choice T(t) = 0 because that implies u(x,t) = 0 (identically), we conclude X(0) = X(L) = 0.

Under the assumption of a separated solution, the initial conditions become

u(x,0) = X(x)*T(0) = f(x)

ans

u[t](x,0) = X(x) T'(0) = g(x)

Unless either f(x) or g(x) is zero, no conclusion can be drawn from these two equations. Assuming for simplicity that the initial velocity is zero, so that g(x) = 0 , we conclude

u[t](x,0) = X(x) T'(0) = 0 => T'(0) = 0

The initial condition u(x,0) = f(x) can be satisfied with the aid of a Fourier series. Before we can see that, we must apply the separation assumption to the PDE itself, namely

> q := diff(u(x,t),t,t) = c^2*diff(u(x,t),x,x);

q := diff(u(x,t),`$`(t,2)) = c^2*diff(u(x,t),`$`(x,...

>

giving

X(x)*`T''`(t) = c^2*`X''`(x)*T(t)

that is,

> q1 := eval(subs(u(x,t)=U,q));

q1 := X(x)*diff(T(t),`$`(t,2)) = c^2*diff(X(x),`$`(...

>

We have just deliberately committed a notational no-no. The derivatives on the left are with respect to t , while the derivatives on the right are with respect to x . Yet, we have used the same symbol for each differentiation, a mathematical imprecision and ambiguity that is too convenient to avoid.

Next, divide by c^2*u(x,t) , with u(x,t) in the form

u(x,t) = X(x)*T(t)

This general strategy, which seems to work with linear second-order PDEs, gives

`T''`(t)/(c^2)/T(t) = `X''`(x)/X(x)

that is,

> q2 := q1/(c^2*U);

q2 := diff(T(t),`$`(t,2))/(c^2*T(t)) = diff(X(x),`$...

>

the separated form of the PDE wherein each side of the equation is a function of only one of the variables. Since on the left there is a function purely of t , and on the right, a function purely of x , and these two functions must be equal for all values of x and t , each must be equal to the same constant.

This argument is generally not transparent to the novice. Consider the following. Student A is asked to state a "favorite function of t ." Student B is asked to state a "favorite function of x ." Typically, the functions now written on the board are something like t^2 and sin(x) . Student C is asked to select a "favorite value of t ," and student D is asked for a "favorite value of x ." The functions t^2 and sin(x) are now computed at values such as t = 1 and x = Pi . The students then realize that because 1^2 <> sin(Pi) = 0, the only way for a function of t to equal, consistently, a function of x is for the two functions to be the same constant function.

This constant is typically taken as lambda and is called the Bernoulli separation constant . Hence, we have the two ordinary differential equations

`X''`(x)/X(x) = lambda

and

`T''`(t)/(c^2)/T(t) = lambda

which, together with the relevant data, form the two problems

`X''`(x)-lambda*X(x) = 0

X(0) = X(L) = 0

and

`T''`(t)-c^2*lambda*T(t) = 0

`T'`(0) = 0

The first problem is a Sturm-Liouville eigenvalue problem, while the second is a modified initial value problem.

Obtaining the two separated ordinary differential equations in Maple is not a simple task. For example, we begin with

> q3 := rhs(q2) = lambda;
q4 := lhs(q2) = lambda;

q3 := diff(X(x),`$`(x,2))/X(x) = lambda

q4 := diff(T(t),`$`(t,2))/(c^2*T(t)) = lambda

>

Then, re-arranging, we get

> q5 := lhs(X(x)*q3) - rhs(X(x)*q3) = 0;
q6 := lhs(c^2*T(t)*q4) - rhs(c^2*T(t)*q4) = 0;

q5 := diff(X(x),`$`(x,2))-X(x)*lambda = 0

q6 := diff(T(t),`$`(t,2))-c^2*T(t)*lambda = 0

>

In effect, we did all the work. Maple really only played the role of bookkeeper, because it does not have any built-in code for performing manipulations of this type.

The solution of this Sturm-Liouville eigenvalue problem, obtained in Section 16.1, is

X[n](x) = B[n]*sin(n*Pi*x/L)

with eigenvalues

lambda[n] = -n^2*Pi^2/(L^2), n = 1, 2, `...`

Again, Maple presently does not have the tools with which to construct these solutions, so we enter them as

> Xn := B[n]*sin(n*Pi*x/L);

Xn := B[n]*sin(n*Pi*x/L)

>

with eigenvalues given by

> lambda[n] := -(n*Pi/L)^2;

lambda[n] := -n^2*Pi^2/(L^2)

>

for n = 1, 2 , ....

For each value of n , the function T( t ) is the solution of

`T''`(t)+c^2 n^2*Pi^2/(L^2) T(t) = 0

`T'`(0) = 0

so we write

T[n](t) = C[n]*cos(c*n*Pi*t/L)

a solution we obtain in Maple by writing the differential equation as

> q7 := subs(lambda=lambda[n],q6);

q7 := diff(T(t),`$`(t,2))+c^2*T(t)*n^2*Pi^2/(L^2) =...

>

then solving with

> q8 := dsolve({q7,D(T)(0)=0},T(t));

q8 := T(t) = _C1*cos(Pi*n*c*t/L)

>

Emphasizing the dependence on n , we write

> Tn := subs(_C2=C[n],rhs(q8));

Tn := _C1*cos(Pi*n*c*t/L)

>

( Caution : If Maple uses _C1 instead of _C2 for the constant of integration, please adjust the worksheet accordingly.)

A single eigenfunction, u[n](x,t) is therefore the product

u[n](x,t) = B[n]*sin(n*Pi*x/L)*C[n]*cos(c*n*Pi*t/L)...

that is,

> Un := Xn*Tn;

Un := B[n]*sin(n*Pi*x/L)*_C1*cos(Pi*n*c*t/L)

>

which contains two constants where only one is needed. Hence, replace the product B[n]*C[n] with the single constant b[n] via

> un := algsubs(B[n]*C[n]=b[n],Un);

un := B[n]*sin(n*Pi*x/L)*_C1*cos(Pi*n*c*t/L)

>

The set of eigensolutions {u[n]} can be thought of as the analog of a fundamental set for a linear ODE. The general solution of a linear ODE is a linear combination of all the members of the fundamental set. Similarly, the most general solution of the linear PDE is a linear combination of all the members of its "fundamental set," namely, the set of eigensolutions {u[n](x,t)} .

Since there are an infinite number of eigensolutions, our general solution is the infinite sum

u(x,t) = Sum(u[n](x,t),n = 1 .. infinity) = Sum(b[n]*sin(n*Pi*x/L)*cos(c*n*Pi*t/L),n = 1 .. inf...

that is,

> U := Sum(un,n=1..infinity);

U := Sum(B[n]*sin(n*Pi*x/L)*_C1*cos(Pi*n*c*t/L),n =...

>

The final condition to be applied in this BVP is the initial shape requirement,

u(x,0) = Sum(b[n]*sin(n*Pi*x/L),n = 1 .. infinity) = f(x)

that is,

> simplify(subs(t=0,U)) = f(x);

Sum(B[n]*sin(n*Pi*x/L)*_C1,n = 1 .. infinity) = f(x...

>

The coefficients b[n] must therefore be the Fourier sine series coefficients for the function f(x) . There is no other choice for these constants if this final condition is to be satisfied. If f(x) is to be equal to a sum of sine terms, then the coefficients in that sum must be the Fourier sine series coefficients. Therefore, the b[n] 's are determined by the Fourier sine series formulas

b[n] = 2/L Int(f(x)*sin(n*Pi*x/L),x = 0 .. L)

and the solution u(x,t) is given by the infinite series

u(x,t) = Sum(b[n]*sin(n*Pi*x/L)*cos(c*n*Pi*t/L),n =...

This infinite sum, along with the defining integrals for the b[n] , constitutes the formal solution to the given BVP for the finite plucked string.

>