Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5288

Re: algebraic simplification

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: algebraic simplification
Date 2011-09-29 06:15 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j612e7$m6b$1@smc.vnet.net> (permalink)
References <j5uftg$7on$1@smc.vnet.net>

Show all headers | View raw


On Wed, 28 Sep 2011 07:47:12 +0100, Bruno Panetta <bpanetta@gmail.com>  
wrote:

> I have an expression like the following
>
> a*x^4 + a*x^3 + b*x^2 + b*x + c*y^3 + c
>
> (only much more complicated). I want to simplify it so that it becomes
> something like
>
> a * (x^4 + x^3) + b * (x^2 + x) + c * (y^3 + 1)
>
> How can I do it in Mathematica?
>

poly = a*x^4 + a*x^3 + b*x^2 + b*x + c*y^3 + c

coeffs = Union@
          Flatten@
          CoefficientList[poly, {x, y}] /. 0 -> Sequence[]

Collect[poly, coeffs]

gives

b (x + x^2) + a (x^3 + x^4) + c (1 + y^3)

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

algebraic simplification Bruno Panetta <bpanetta@gmail.com> - 2011-09-28 06:47 +0000
  Re: algebraic simplification "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-09-29 06:06 +0000
  Re: algebraic simplification Peter Pein <petsie@dordos.net> - 2011-09-29 06:08 +0000
  Re: algebraic simplification "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-09-29 06:15 +0000

csiph-web