Search code examples
maple

how to convert this result using exponentials to hyperbolic trig functions?


The solution to Laplace PDE on rectangle is usually written using hyperbolic trig functions. I solve this PDE using Maple. Verified Maple solution is correct. But having hard time figuring how to make its result match the book result.

I tried sol:=convert(rhs(sol),trigh): then simplify(sol,trig); and it become little closer to the book solution, but is still can be more simplified.

Are there any tricks to do this?

Here is MWE

restart;
interface(showassumed=0):
pde:=diff(u(x,y),x$2)+diff(u(x,y),y$2)=0:
bc:=u(0,y)=0,u(a,y)=f(y),u(x,0)=0,u(x,b)=0:
sol:=pdsolve([pde,bc],u(x,y)) assuming(0<=x and x<=a and 0<=y and y<=b):
sol:=subs(infinity=20,sol);

Which gives

Mathematica graphics

The above is same as the following, which I am trying to convert the above to

textbookU:= Sum(2*sin(n*Pi*y/b)*(Int(sin(n*Pi*y/b)*f(y), 
     y = 0 .. b))*sinh(n*Pi*x/b)/(b*sinh(n*Pi*a/b)), n = 1 .. 20);

Mathematica graphics

The above are the same. I checked few points, and they give same answer. They must be the same, as the above textbook solution is correct, and I am assuming Maple solution is correct.

Now I tried to convert Maple sol to the above as follows

sol:=convert(rhs(sol),trigh):
simplify(sol,trig);

Mathematica graphics

May be someone knows a better way to obtain the textbook solution form, starting from the Maple solution above.

Using Maple 2017.3 on windows


Solution

  • After the convert you can first expand it, to then simplify it again:

    s := convert(sol, trigh):
    s := expand(s):
    simplify(s);
    

    which gives:

    result