kill(all)$

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

load(lrats)$

use : lratsubst , 'command'

heat : principal : Fourier's integral theorema , version 1.0
peter.vlasschaert@gmail.com, 22/07/2019

why : solve problems : 'temperature distribution u(x,t)'
===========
=> infinite rod 
===========
given : initial condition f(x ),  -∞<x <∞,heat equation ( = unsteady).

=>  T = period  , n = positiv integer

use : fourier series       (periodic functions          =  )       =>     f(x) = f(x+n*T)
use : fourier transform (non periodic functions   =  )       =>     frequency representation

a)  periodic functions
===============

example : sin(x), T= 2*π , n=2

p1:sin(x) =subst([T = 2*π],sin(x+2*T));

b) non periodic functions
===================

Def : Fourier transform: 'p2a'
--------------------------------

rem : remenber laplace transform:'p2'
L(f(t)) = integrate(%e^(-s*t)*f(t),t,0,inf)

p2:F(s) = integrate(f(t)*exp(-s*t),t,0,∞);;

p2a:F(ω) = integrate(f(t)*exp(-%i*ω*t),t,-∞,∞);;

rem : % i  = sqrt(-1), complex value
complex number :  z = a*%i+b = r*exp(%i*θ)

analog: with the Laplace transform
F(ω) =FT(f(t))

Def : inverse Fourier transform: 'p2b'
--------------------------------------------------

p2b:f(t) = 1/(2*π)* integrate(F(ω)*exp(%i*ω*t),ω,-∞,∞);;

show : Fourier's integral theorema , f(t) = 'real'
===================================

1e)  replace Fourier transform 'p2a',  t = x
================================

p3a:subst([t=x],p2a);

find parts : rhs
--------------------

p3a1: args(rhs(p3a));

a1) function

p3a2:p3a1[1];

b1) variable

p3a3:p3a1[2];

c1) lower and higher limits of integration

p3a4:p3a1[3];
p3a5:p3a1[4];

2e)  replace inverse Fourier transform 'p2b',  t = x, ' only rhs'
================================

p3b:lhs(p2b) = lratsubst([t=t],rhs(p2b));

find parts : rhs
--------------------

p3b1a: args(rhs(p3b));

p3b1a1:p3b1a[1];
p3b1a2:p3b1a[2];

p3ba:args(p3b1a1);

a2) function

p3b2:subst([F(ω) = 1],p3ba[1]);

b2) variable

p3b3:p3ba[2];

c2) lower and higher limits of integration

p3b4:p3ba[3];
p3b5:p3ba[4];

d2) lmultiplication factor before integral

p3b6:1/p3b1a2;

3e) step : Fourier transform 'p3a' into inverse Fourier transform 'p3b'
-===================================================

p3c:lratsubst([p3a],p3b);

p3c1:args(p3c);

p3c1a: p3c1[1];

p3c1b:p3c1[2];

4e) How to find integrand of double integral
==================================

p4a:p3a2*p3b2;

5e) get real part of the integrand
=========================

p4b:realpart(p4a);

p4b1:[imagpart(f(x))=0,realpart(f(x))=f(x)];

p4b2:subst(p4b1,p4b);

p4b2a:factor(p4b2);

6e) build double integral  x  :  -∞ to ∞
                                           ω :  -∞ to ∞
============================

p4c:p3b6*integrate(integrate(p4b2a,p3a3,-∞,∞),p3b3,-∞,∞);

7e) since cos((x\-t)*ω) is even with respect to  ω
=====================================

p4d:2*p3b6*'integrate(integrate(p4b2a,p3a3,-∞,∞),p3b3,0,∞);

rem : ω , integraion even function (cos(x))
================================

p5:p3b3;

cos(x) : even function
================

wxplot2d([cos(x)], [x,-3*π,+3*π],
 [plot_format, xmaxima])$

rem : even function : f(x) = f(-x);

p5a:cos(x)  = cos(-x);

reason :

p5b1:'integrate(cos(x),x,-3*π,3*π)  = 2*'integrate(cos(x),x,0,3*π);

p5b2:ev(p5b1,nouns);

sin(x) : odd function
================

wxplot2d([sin(x)], [x,-3*π,+3*π],
 [plot_format, xmaxima])$

rem :odd function : f(-x) =-- f(x)

p6a:sin(-x) = -sin(x);

p6b1:'integrate(sin(x),x,-3*π,3*π)  = 2*'integrate(sin(x),x,0,3*π);
p6b2:ev(p6b1,nouns);

not allowed here wrong result : p6b2

rules : even and odd : multiplication
===========================

rules   =>  f(t) = f1(t)*f2(t)

f1(t) and f2(t) both odd  => even
f1(t) and f2(t) both even => even
f1(t):odd and f2(t):even   => odd
f1(t):even and f2(t):odd   => odd

rem : f(t ) = odd 'example sin(x)'

assume(l>0);

p7:'integrate(sin(x),x,-l,l);
p7a:ev(p7,integrate);

p7b:p7 = p7a;

example : f(t) =cos(t)*sin(t)  => odd*even = odd (use above rules)
==================================================

p8:f(t) =cos(t)*sin(t);

check integration : ? 0

p8a:lratsubst([p8],'integrate(f(t),t,-l,l));

p8b: p8a = ev(p8a,integrate);