another question



> try   f[i](x):=f[i-1](x)+ .... {suitably translated}

I believe what Dick Fell had in mind was *setting* the various f[i]'s
explicitly.  What he presumably was unaware of is Maxima's semantics for
f[](), so here is a summary.

In Maxima, f[i]:=... defines a memoizing function.  Every time a
specific f[i] is calculated, it is saved for future use.  So, for
example, you can define a variant of the Fibonacci numbers without
worrying about exponential computation time:

   fib[i]:=if i=0 then a else if i=1 then b else fib[i-1]+fib[i-2]$
   fib[50];
   Evaluation took 00.20 seconds (00.20 elapsed)
   12586269025 b + 7778742049 a

This would of course be unthinkable using ordinary functions:

   fob(i):=if i=0 then a elseif i=1 then b else fob(i-1)+fob(i-2);
   fob(20);
   Evaluation took 5.13 seconds (5.13 elapsed)
   6765 b + 4181 a

The saved values of fib[i] are in fact directly assignable, so we can
rewrite fib more elegantly perhaps as:

   fib[0]:a$
   fib[1]:b$
   fib[i]:=fib[i-1]+fib[i-2]$

To see the memoized values, use listarray:

listarray(fib);

  [a, b, b + a, 2 b + a, 3 b + 2 a, 5 b + 3 a, 8 b + 5 a, 
   13 b + 8 a, 21 b + 13 a, 34 b + 21 a, 55 b + 34 a, 89 b + 55 a, 
   144 b + 89 a, 233 b + 144 a, 377 b + 233 a, 610 b + 377 a, 
   987 b + 610 a, 1597 b + 987 a, 2584 b + 1597 a, 4181 b + 2584 a, 
   ...
   7778742049 b + 4807526976 a, 12586269025 b + 7778742049 a]

Memoized arrays can also have functional values:

   fub[i](x):=...

This is actually a shorthand for

   fub[i]:=lambda([x],...)

as you can see by looking at listarray(fub)

But I don't have time to explain this in detail, and the semantics are a
bit of a mess....

       -s