# [Maxima] How to compose multi-variate polynomials?

Jonathan LF King squash at math.ufl.edu
Sun May 7 13:06:41 CDT 2006

```Dear Barton Willis

From: Barton Willis <willisb at unk.edu>
Date: Sun, 7 May 2006 06:10:04 -0500

> Q2: How can I define a poly f, so that f is
> viewed as a 1-variable function, but the variable comes from,
> say, 3-dim'al space and the output is a point in
> 3-dim'al space? So, for instance, I can write
>
>  f(f(f([1,2,3])))  ?
>
> (...except that the input-point [1,2,3] might be
> some other kind of Maxima object other than a list.)

Maybe you want to do something like:

(%i1) f(x) := block([x1 : part(x,1), x2 : part(x,2)], [-x2, -x1]);
(%o1) f(x):=block([x1:part(x,1),x2:part(x,2)],[-x2,-x1])
(%i2) f([1,4]);
(%o2) [-4,-1]
(%i3) f(f([1,4]));
(%o3) [1,4]
(%i4) f(f(f([1,4])));
(%o4) [-4,-1]

I will look up the "part" operator.

The function 'part' can be applied to (I think) any
non-atomic object, so maybe something like this would
work if the input to f was not a list. Does this help,
or did I misunderstand?

Thank you.  At the moment, the students are away  are summer
break.  They are a lot more computer-savvy than I am...
--Jonathan

--
Prof. Jonathan LF King   Mathematics dept, Univ. of Florida
<squash at math.ufl.edu>,   <http://www.math.ufl.edu/~squash/>

```