MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Split Polynom into Sum of Monomials

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34072] Split Polynom into Sum of Monomials
  • From: Detlef Mueller <dmueller at mathematik.uni-kassel.de>
  • Date: Wed, 1 May 2002 08:00:49 -0400 (EDT)
  • Organization: University of Kassel - Germany
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,

I have the following Problem:

Given a Set of Variables, i.e. 
L = {x,n},

I want transform a given expression, polynomial
in theese variables, say 
f = (a+b+n+x)*n 

into Monomials in the given Variables, here 

f = (a+b+n+x)*n -> (a+b) n + n^2 + x n

is desired.

The Problem is, that 
Expand[f, x_ /; MemberQ[L, x]] yields

a n + b n + n^2 + n x

which is "too expanded", while

Collect[f, x_ /; MemberQ[L, x]] yields

n\^2 + n(a + b + x)

But this is "not expanded enough", because 
collect works recursively. So I didn't find
an implemented Command doing the thing.

(The whole thing is a bit timecritical, large
 polynomials may appear, and the Command will
 be used frequently).

Any Ideas?

Greetings
  Detlef


  • Prev by Date: Re: Import .doc ?
  • Next by Date: Re: Import .doc ?
  • Previous by thread: Re: Import .doc ?
  • Next by thread: Re: Split Polynom into Sum of Monomials