Problem 4

Find the solution, [Maple Math] , to the wave equation for a vibrating string which is initially flat but has a

specified initial velocity. More specifically, solve

[Maple Math] with [Maple Math] , [Maple Math] , [Maple Math] , and [Maple Math] ,

where [Maple Math] , [Maple Math] , and [Maple Math] .

First c lear the workspace and define [Maple Math] .

> restart: f := x -> x*(Pi-x);

[Maple Math]

First note that the specific conditions do not exactly match the verbal description. The derivative condition

at [Maple Math] implies that we have a sliding connection at that end so that the string always has a zero derivative.

If we keep this condition, then the problem is essentially identical to Problem 3. Let's consider the case

where [Maple Math] .

Start by assuming a separable solution of the form [Maple Math] . Then we can conclude that if there is a

solution of this form, then [Maple Math] and [Maple Math] must satisfy two ordinary differential equations of the form

[Maple Math] and [Maple Math] , where the separation constant, [Maple Math] , is the same for both equations.

We consider the possible values of [Maple Math] , and their role in the equation for [Maple Math] . Note that the boundary

conditions imply that [Maple Math] and [Maple Math] .

[Maple Math]

[Maple Math]

[Maple Math]

With these values of [Maple Math] we see that the general solution for the [Maple Math] equation that is given by

[Maple Math] .

Thus there are solutions to the heat equation of the form

[Maple Math]

.

We can instruct Maple to verify this as follows:

> u[k] := (x,t) -> (c[k]*cos(k*t)+d[k]*sin(k*t))*sin(k*x);

[Maple Math]

> D[2,2](u[k])(x,t) - D[1,1](u[k])(x,t);

[Maple Math]

> simplify(%);

[Maple Math]

We have two remaining conditions to satisfy, namely [Maple Math] , and [Maple Math] .

Since we have an infinite set of solutions, each with an unspecified coefficients, [Maple Math] , and [Maple Math] , can we find a linear

combination, which yields the solution?

That is, can we write [Maple Math] ?

First, set [Maple Math] and plug this into the series to get

[Maple Math] .

But this can only be true for all [Maple Math] if [Maple Math] . This leaves the condition

[Maple Math]

This is the answer to Problem 2 provided we set [Maple Math] .

> d[k] := (2/(k*Pi))*int(f(x)*sin(k*x),x=0..Pi);

[Maple Math]

> dcoef := unapply(d[k],k);

[Maple Math]

> d[1] := dcoef(1);d[2] := dcoef(2);d[3] := dcoef(3);d[4] := dcoef(4);d[5] := dcoef(5);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

An approximation to the solultion using 25 terms is thus

> u[25] := (x,t) -> sum(dcoef(k)*sin(k*t)*sin(k*x),k=1..25);

[Maple Math]

We can get a plot of this approximate solution. It shows the string starting out flat and then vibrating periodically

> plot3d(u[25],0..Pi,0..10,axes=BOXED,labels=['x','t','u']);

[Maple Plot]

We can also use Maple's plot package to view this solution as a movie.

> with(plots): animate(u[25](x,t), x=0..Pi, t=0..10);

[Maple Plot]

>