Nasser
Nasser

Reputation: 13141

Why Maple generates unknown constant in the solution of PDE when all initial and boundary conditions are specified

I do not understand why Maple 2017.3, generates a solution to this wave PDE with unknown constant in it called _C6. As all boundary conditions and initial conditions are given.

Actually the solution is wrong on another account, it gives divide by zero when n=2. But my question is on the presence of this constant.

This is the solution for wave PDE u_tt = 4* u_xx. String. With both ends fixed. Initial position is u(x,0)= sin(x)^2 and zero initial velocity i.e. u_t(x,0) = 0

Maple:

restart;
pde:=diff(u(x,t),t$2)= 4*diff(u(x,t),x$2);
bc:=u(0,t)=0,u(Pi,t)=0;
ic:=u(x,0)=sin(x)^2,D[2](u)(x,0)=0;
sol:=pdsolve([pde,bc,ic],u(x,t));

Maple 2017.3 on windows gives

Mathematica graphics

There should not be _C constants in the solution. For reference, here is Mathematica solution

ClearAll[u,t,x,n];
pde=D[u[x,t],{t,2}]==4D[u[x,t],{x,2}];
ic={Derivative[0,1][u][x,0]==0,u[x,0]==Sin[x]^2}
bc={u[0,t]==0,u[Pi,t]==0};
sol=DSolve[{pde,bc,ic},u[x,t],{x,t}];
sol=sol/.K[1]->n  (*n looks better than K[1] for index*)

Mathematica graphics

Notice there is no constant in the solution (but Mathematica solution has the same problem for n=2 as Maple's. Divide by zero. So its solution is also wrong.

But my question here is not on the n=2 issue, but on the constant _C6 that Maple generates, and why is it there?

Maple 2017.3 on windows.

Update

Just to confirm that latest physics package (thanks to the answer ) did fix this issue

Mathematica graphics

Upvotes: 1

Views: 159

Answers (1)

acer
acer

Reputation: 7246

If I download and install the latest revision for Maple 2017 of the Physics,DEs,MathFuncs Library then I get the following using Maple 2017.2 for 64bit Linux.

restart;

Physics:-Version();
  "/usr/local/maple/maple2017.2/lib/Physics2017.mla", 2018, March 9, 23:54 hours

pde:=diff(u(x,t),t$2)= 4*diff(u(x,t),x$2):
bc:=u(0,t)=0,u(Pi,t)=0:
ic:=u(x,0)=sin(x)^2,D[2](u)(x,0)=0:

sol:=pdsolve([pde,bc,ic],u(x,t)):

lprint(sol);
   u(x, t) = Sum(4*((-1)^n-1)*sin(x*n)*cos(2*t*n)/(Pi*n*(n^2-4)), n = 1 .. infinity)

Upvotes: 1

Related Questions