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


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

Re: How can I force mathematica to collect a symbol from a polynomial

From Peter Pein <petsie@dordos.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How can I force mathematica to collect a symbol from a polynomial
Date 2013-04-10 04:48 +0000
Message-ID <kk2qvg$bin$1@smc.vnet.net> (permalink)
References <kk0i2o$2te$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Am 09.04.2013 10:04, schrieb syzhaoyu@gmail.com:
> Let's say I have a polynomial:
>            a+b+c
> Is there any way I can force mathematica to produce the following result:
>            a*(1+b/a+c/a)
>
> I think such transformation of polynomials should be very common; however, I have been trying all day and still can not get mathematica to do so automatically.
>

Try this:

FactorOut[pol_, var_] := var*HoldForm@Expand[pol/var] // ReleaseHold

FactorOut[a + b + c, a]
--> a (1 + b/a + c/a)

Collect[Expand[(a + b)^4 (x + y)^3 - (a - b)^4 (x - y)^3],  x | y,
         FactorOut[#, a^Exponent[#, a]] &]

--> a^3 (8 b + (8 b^3)/a^2) x^3 +
     a^4 (6 + (36 b^2)/a^2 + (6 b^4)/a^4) x^2 y +
     a^3 (24 b + (24 b^3)/a^2) x y^2 +
     a^4 (2 + (12 b^2)/a^2 + (2 b^4)/a^4) y^3

etc.

Peter

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


Thread

How can I force mathematica to collect a symbol from a polynomial syzhaoyu@gmail.com - 2013-04-09 08:04 +0000
  Re: How can I force mathematica to collect a symbol from a polynomial Peter Pein <petsie@dordos.net> - 2013-04-10 04:48 +0000
  Re: How can I force mathematica to collect a symbol from a polynomial debguy <johnandsara2@cox.net> - 2013-04-10 17:52 +0000

csiph-web