kill(all)$

heat : find temperature distribution u(x,t),'infinite bar',give ic : f(x) ,-∞ to ∞,version 1.0
peter.vlasschaert@gmail.com, 23/07/2019

kill(all)$

load : packages
============

load(lrats)$

pde : separation variables heat equation.(problem :given :ic and bc),version 1.0
peter.vlasschaert@gmail.com,22/07/2019

see: website
=> pde : separation variables for principal of the heat equation.(not general solution),version 1.0
?  Why : -β^2 for separation constant.
?  General principal

given : problem. (unsteady probem : du/dt ≠0)
============

pde :  D*diff(u,x,2) = diff(u,x,t), u = u(x,t)
==============================
domain : -∞ < x < ∞, infinite bar( = rod)
ic :  u(x,0) = f(x)            'initial condition'
==============================
f(x) ,general not periodic function
==============================

assume(D>0);

p1:D*diff(u(x,t),x,2) = diff(u(x,t),t);

p2:u(x,t)  = X(x)*T(t);

p3:'diff(X(x),x,2)/X(x)='diff(T(t),t,1)/(D*T(t));

two : odes

assume(β>0);

p3a:(lhs(p3) =- β^2)*X(x);
p3b:(rhs(p3) = -β^2)*D*T(t);

solve : two odes with desolve.
=======================

X(x) : ?
======

p4a:desolve(p3a,X(x));

p4a1:lhs(p4a) =C1*sin(x*β)+C2*cos(x*β);

T(t) : ?
======

p4b:desolve(p3b,T(t));

p4b1:lratsubst(T(0)=C3,p4b);

result: U(x,t;β)  => 'u(x,t)'

p5:U(x,t,β) =rhs(p4a1)*rhs(p4b1);

p5a:expand(p5);

1e)  introduce two new constants (function of β)
====================================

p5b:[C1*C3=C4(β),C2*C3 = C5(β)];

p5c:lratsubst(p5b,p5a);

p5c1:args(rhs(p5c));

p5c2:p5c1[1];

2e)  u(x,t)  not summation ,general : integration.
====================================

assume(t≥0);

assume(t>0);

p5d:u(x,t) =integrate(rhs(p5c),β,0,∞);

3e) We will impliment ic : condition (@t=0)  => u(x,t) => u(x,0) =f(x)
==================================================

p5f:lratsubst([t=0,u(x,t)=u(x,0)],p5d);

p5g:lratsubst([u(x,0) =f(x)],p5f);

p5g1:args(rhs(p5g));

p5g2:p5g1[1];

4e) How to find C4(β) and C5(β)
=========================
fourier coef = > orthogonality relation 
see website :
pde : separation variables heat equation.(problem :given :ic and bc),version 1.0
=> C4,C5  here not C4(β),C5(β)

p6a:C4(β) = 1/π*integrate(f(y)*sin(β*y),y,-∞,∞);
p6b:C5(β) = 1/π*integrate(f(y)*cos(β*y),y,-∞,∞);

elements of the rhs : integrals
=======================

c4(β)
====

p6a1:args(rhs(p6a));

p6a2:args(p6a1[1]);

p6a3:p6a2[1];

c5(β)
====

p6b1:args(rhs(p6b));

p6b2:args(p6b1[1]);

p6b3:p6b2[1];

rem :integration argument must be different from:β,x
choose :y

p6:[p6a,p6b];

5e)input C4(β),C5(β) into p5f  and also p5g
==================================

p7a:lratsubst(p6,p5f);
p7b:lratsubst(p6,p5g);

the reason use :fourier integral theorema:
see website:
heat : principal : Fourier's integral theorema , version 1.0

p8:'integrate(integrate(f(y)*cos((y-t)*ω),y,-inf,inf),ω,0,inf)/%pi;

p8a:factor(lratsubst([t=x,ω=β],p8));

assuming that we can interchange the order of integration

6e)  find integrand for the use : fourier integral theorema.
==========================================
use :p5g2,p6a3,p6b3 (problem : pde)

p9a:pa=p5g2;
p9b:pb=p6a3;
p9c:pc=p6b3;

p10a:[C4(β)=rhs(p9b),C5(β)=rhs(p9c)];
p10b:lratsubst(p10a,rhs(p9a));

rem : f(y)*cos((y-x)*β)
=> fourier integral theorema ?

p11:args(p8a);

p11a:args(p11[1]);

p11b:p11a[1];

p11c:args(p11b);

p11d:p11c[1];

rem :expand integrand from : fourier integral theorema

p12:expand(p11d);

p12a:y*β =d1;
p12b:x*β=d2;

p12a1:d1=y*β;
p12b1:d2=x*β;

p12c:trigexpand(lratsubst([p12a,p12b],p12));

p12d:expand(p12c);

p12e:lratsubst([p12a1,p12b1],p12d);

check : relation between 'problem and theorema'
=====================================
use: p10b,p12e

p13:is(p10b=p12e);

7e) result we can use  u(x,0) representation of 'integral theorema'
==================================================
use : p8a

f(x) ?
====

p14:u(x,0) =p8a;

u(x,t) ?
=====
use:p5c2,p11d

p15:u(x,t) ='integrate(integrate(p5c2*p11d,y,-inf,inf),β,0,inf)/%pi;

p15a:p5c2*p11d;

p15b:lratsubst([β=0],p15a);

p15c:p15a/p15b;

8e)  we suppose: change integration order is allowed

p16:lhs(p15)='integrate(p15b *integrate(p15c,β,0,inf),y,-inf,inf)/%pi;

p16a:ev(p16,nouns);

modification by substition : q=(x-y)/(2*sqrt(D*t))

p16b:changevar(%, (x-y)/(2*sqrt(D*t))=q,q,y);

rem : changevar ,simple example.' how to use'

example: changevar 'how to use'
=========================

q1:expr : 'integrate(2*x*(x^2+2)^3,x);
q2:changevar(expr,x^2+2=w,w,x);
q3:ev(%, nouns);

q4:lratsubst([w=x^2+2],q3);

q4a:factor(q4);

check: ? true or false
=>  is 'command : maxima'
=====================

q5:integrate(2*x*(x^2+2)^3,x);

q6:is(q4a=q5);