Fourier Series using fourie.mac




On Mon, 27 Jul 2009, Rafa? Topolnicki wrote:

< Hi,
< 
< During testing Fourier Series Expansion in maxima I found a problem I 
< can't cope with.
< 
< (%i3)                            load(fourie)
< (%o3)         /usr/share/maxima/5.18.1/share/calculus/fourie.mac
< (%i4)                         f(x) := abs(sin(x))
< (%o4)                         f(x) := abs(sin(x))
< (%i5)                    flist : fourier(f(x), x, %pi)
<                                           2
< (%t5)                              a  = ---
<                                      0   %pi
< 
<                       cos(%pi n)   cos(%pi n)      1         1
<                    2 (---------- - ---------- + ------- - -------)
<                        2 n + 2      2 n - 2     2 n + 2   2 n - 2
< (%t6)        a  = -----------------------------------------------
<                n                         %pi
< 
 
The easiest thing to do would be to add a line

%t6 : a[n] = if n=1 then 'limit( subst(n=_n,rhs(%t6)),_n,n ) else
%rhs(%t6);

This should probably be caught by fourexpand.

Leo


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.