kill(all)$

maxima :orthogonality fourier series ,version 1.0
peter.vlasschaert@gmail,09/12/2020

given: heat equation ( = solution of heat equation)

heat equation : u_t =c^2*u_xx                       (1)
domain : 0<x<L 
BC: homogenous    : u(0,t) = 0 & u(L,t) = 0   (2)
IC : initial condition : u(x,0) = f(x)                  (3)

1e step:use :(1) & (2), seperation variables 
----------------------------------------------------------

p1:u[n](x,t)=sum(b[n]*exp(-(λ[n])^2*t)*sin((n*%pi)*x/L),n,0,inf);

p1a:λ[n]=c*(n*%pi)/L;

2e step: find b[n], key word ' orthogonality'
--------------------------------------------------------

→  IC (t=0) → u[n](x,0) = f(x),                (3)

p2:f(x)=subst([t=0],rhs(p1));

→ multiply : sin((%pi*m*x)/L) , m =integer

p2a:sin((%pi*m*x)/L);
p2b:intosum(p2a*p2);

→ integration over the domain (x:0→L)

assume(L>0);

declare(n,integer,m,integer)$

→ n=m

lhs:

p2c1:integrate(lhs(p2b),x,0,L);

rhs: sum  reduce → b[m], result removes :sum

p2c2:args(rhs(p2b))[1];

p2c2a:subst([n=m],p2c2);

p2c2b:integrate(p2c2a,x,0,L);

lhs = rhs

p3:reverse(p2c1=p2c2b);

p3a:solve(p3,b[m])[1];

p3b:subst([m=n],p3a);

final result :u[n](x,t)
===============
use :p1

p4:subst([p3b],p1);

p4a:subst([p1a],p4);

p4a1:args(args(args(rhs(p4a))[1])[2]);

assume(c>0,n>0);

limit : t → ∞  (physical probem , limit :0)
=========

p4b:ev(limit(p4a1,t,inf),nouns);

f(x) = sin(x)
==========
use : c=1,L=1

p5a:subst([c=1,L=1],p4a);

p5b:subst([f(x)=sin(x)],p5a);

p5b1:intosum(ev(p5b,nouns));

approximation : n=100 ( for n = inf, u(x,t) )

p6:u(x,t)='sum(-(2*((%pi*n-1)*sin(%pi*n+1)+(-%pi*n-1)*sin(%pi*n-1))
        *%e^(-%pi^2*n^2*t)*sin(%pi*n*x))/(2*%pi^2*n^2-2),n,0,100);