# Laplace transform; #laplace(y_, x_,s_) := if(isfree(y,x),y/s); laplace(a_=b_,x_,s_):=laplace(a,x,s)=laplace(b,x,s); laplace(x(n_,x_), x_,s_) := s^n*x(s)-sum(s^(n-k-1)*x(k,0),k,0,ceil(n)-1); laplace(x(x_), x_,s_) := x(s); laplace(y(n_,x_), x_,s_) := s^n*y(s)-sum(s^(n-k-1)*y(k,0),k,0,ceil(n)-1); laplace(y(x_), x_,s_) := y(s); laplace(e^x_*y(x_), x_,s_) := y(s-1); laplace(e^(a_*x_)*y(x_), x_,s_) := y(s-a); laplace(sinh(a_*x_), x_,s_) := if(isfree(a,x),a/(s^2-a^2)); laplace(cosh(a_*x_), x_,s_) := if(isfree(a,x),s/(s^2-a^2)); laplace(sinh(x_), x_,s_) := 1/(-1+s^2); laplace(cosh(x_), x_,s_) := s/(-1+s^2); laplace(sin(a_*x_), x_,s_) := if(isfree(a,x),a/(s^2+a^2)); laplace(cos(a_*x_), x_,s_) := if(isfree(a,x),s/(s^2+a^2)); laplace(sin(x_), x_,s_) := 1/(1+s^2); laplace(cos(x_), x_,s_) := s/(1+s^2); laplace(log(x_), x_,s_) := -(log(s)+gamma)/s; laplace(sqrt(x_), x_,s_) := sqrt(pi)/2/s^(3/2); laplace(1/sqrt(x_), x_,s_) := sqrt(pi/s); laplace(x_^n_, x_,s_) := if(n> -1, n!/s^(n+1)); laplace(e^(a_*x_), x_,s_) := if(isfree(a,x),1/(s-a)); laplace(e^(a_*x_)*x_, x_,s_) := if(isfree(a,x),1/(s-a)^2); laplace(e^(a_*x_)*x_^n_, x_,s_) := if(n> -1 and isfree(a,x),n!/(s-a)^(1+n)); laplace(e^x_, x_,s_) := 1/(s-1); laplace(e^x_*x_, x_,s_) := 1/(s-1)^2; laplace(e^x_*x_^n_, x_,s_) := if(n> -1,n!/(s-1)^(1+n)); laplace(x_,x_,s_) := 1/s^2; laplace(y_,x_):=laplace(y,x,s); laplace(y_):=laplace(y,x,s);