Re: Canonical Polynomial Form w. resp. to certain Variables
- To: mathgroup at smc.vnet.net
- Subject: [mg34096] Re: [mg34067] Canonical Polynomial Form w. resp. to certain Variables
- From: BobHanlon at aol.com
- Date: Thu, 2 May 2002 03:49:47 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 5/1/02 9:56:58 AM, dmueller at mathematik.uni-kassel.de
writes:
>I face the following Problem:
>
>Given a polynomial, say (a + b + n + x)*n,
>and a List of given Variables, say:
>OreVariables={x,n}.
>
>I want to have the same Polynomial in canonical
>form as a Sum of Monomials in the given
>Variables.
>
>The desired Result is
>(a+b) n + n x + n^2
>
>where the given Variables are expanded and the
>coefficients independent of this Variables are
>collected as coefficients of the Monomials.
>
>but
>
>Collect[(a + b + n + x)*n, x_ /; MemberQ[OreVariables, x]]
>yields
>n^2 + n(a + b + x)
>
>wich is "not expanded enough"
>
>and
>
>Expand[(a + b + n + x)*n, x_ /; MemberQ[OreVariables, x]]
>yields
>a n + b n + n^2 + n x
>
>wich is "to expanded".
>
>(To make Things worse, this is an Operation that will be used
>often (and on big Polynomials) and hence is a bit
>time-critical ...)
>
>( The Goal is, do isolate the canonical Summands of an Expression, i.e.
>
>Ex2Pol[(x+n+b)^3-(x-n+b)^3] ->
>Poly[Summand[2 n^2],Summand[6 n x^2], Summand[12 b n x],Summand[6 b^2
>n]])
>
>Any Ideas?
OreVariables={x,n};
multinom=(a+b+n+x)*n;
Collect[multinom, OreVariables]
n^2 + (a + b)*n + x*n
Bob Hanlon
Chantilly, VA USA