kill(all)$

solve pde (part 3), use laplace transform. 'version 1.0'
peter.vlasschaert@gmail.com,11/12/2018

load 'packages'
-----------------------

load(orthopoly)$
load(lrats)$
load(facexp)$
load(odes)$

load("C:/math/laplaceInv.mac");

assume(s>0);

pde :  diff(u,t,2) = diff(u,x,2) + x*sin(t)  , - inf < x < inf , t >0
==============================================
            ic:  u(x,0)= sin(x) , diff(u(x,0),t) = cos(x)
==============================================

eq:'diff(u,t,2) = 'diff(u,x,2) + x*sin(t) ;
ic   : [u(x,0) = sin(x),at(diff(u(x,t),t),t=0) =cos(x)];

not use: u => u(x,t)

eq1:subst([u=u(x,t)],eq);

1e) Laplace Transform
----------------------------------

p1:laplace(eq1,t,s);

p2:laplace(u(x,t),t,s)=w;

2e) subst ic: condition 'p1'
---------------------------------------

p1a:[ic[1],ic[2],p2];

p1b:subst(p1a,p1);

3e) solve with ode2 
---------------------------------------

p1c:ode2(p1b,w,x);

p1d:subst([%k1=0,%k2=0],p1c);

rem : no inverse laplace transform can be find.

we find particular solution : with packages.' load(odes)'  from 'p1b'
---------------------------------------------------------------------------------------------------

p2:partsol(p1b,w,x);

rem : packages 'load(odes)' when :  no inverse laplace from ode2

find inverse laplace transform 'p2'
--------------------------------------------------

p2a:u(x,t)=laplaceInv(p2,s,t);

p2b:lhs(p2a) =trigsimp(cos(t)*sin(x)+sin(t)*cos(x)-sin(t)*x+t*x);

p2c:lhs(p2b) =trigrat(rhs(p2b));

check : the solution  'p2c' into 'eq1'
-----------------------------------------------------

p2d:subst([p2c],eq1);

p2e:ev(p2d,nouns);

p2f:is(p2e);

first        time : solve ODE's   => ode2
second time : solve  ODE's  => partsol, 'load(odes)'