Subject: How to compose multi-variate polynomials?
From: Stavros Macrakis
Date: Mon, 8 May 2006 08:57:35 -0400
On 5/7/06, Jonathan LF King <squash at math.ufl.edu> wrote:
> Among the operations we'll want to do on polys is to factor
> them: To see if f is a power of a simpler poly g. For
> this, it it may be best to leave f as an *expression*, e.g
>
> f_xvec : 3*x1*x7^4 + ...
Yes, for mathematical operations, Maxima works with expressions, not defined
functions.
We'll also need to *compose* polys
There are several ways to do this.
You could use the 'subst' function, which can take a first argument which is
a substitution list, e.g.
subst([x=1,y=2],x^2-y^2) => -3
and construct the substitution list using makelist or perhaps map:
makelist(x[i]=...,i,0,5)
You could also iteratively substitute all the variables:
(result: poly, for i: 0 thru 5 do result:subst(...,x[i],result))
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?
I understand the domain... you want f([3,4,5]) to mean
subst([x[1]=3,...],<body of f>), but what is the range? Again, the best
approach is probably not to define various f[i] functions, but to have a
composition function pcomp(p,vec) => vec.
By the way, do you know about the inverse function of polynomial composition
in Maxima, polydecomp?:
polydecomp( x^2+2*b*x+b^2-a , x ) => [x^2-a,x+b]
describe(polydecomp) also has a brief introduction to polynomial
composition.
-s