Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say that I have a polynomial like this:

a + b + c

Is there any way that I can get Mathematica to transform it to:

a*(1 + b/a + c/a)

I found such a manipulation on polynomials very common when deducing equations by hand; however, I have been trying all day and still can not figure out how to make Mathematica do this automatically.

share|improve this question
Does tst = a + b + c; a Expand[tst/a] not do what you want? – J. M. Apr 8 '13 at 11:35
Oh my god it's so simple. I'm all hooked up on functions like Collect and stuff. Now I just feel stupid. Any way, thanks for this solution. – user2256793 Apr 8 '13 at 11:42
up vote 4 down vote accepted

You can try a pattern matching approach (for a bit more advanced users) e.g. :

(a + b + c) /. Plus[c___, x_, b___] :> a Expand[Plus[c, x/a, b]]
a (1 + b/a + c/a)

or simpler :

(a + b + c) /. Plus[x___] :>  a Expand[Plus[x/a]]
share|improve this answer
Thanks, this is actually a better idea. It can be used on the manipulation of complicated expressions. – user2256793 Apr 8 '13 at 12:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.