Factoring

*To*: mathgroup at smc.vnet.net*Subject*: [mg65069] Factoring*From*: "Matt" <anonmous69 at netscape.net>*Date*: Tue, 14 Mar 2006 05:59:48 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hello Mathgroup, I'm sure that I've overlooked something obvious, but for the past two and a half hours, I've been trying to figure out how to use built-in Mathematica functions to just factor the imaginary number 'I' out of this: 4*I*r^2*Sin[2*Î¸] + I*r^5*Sin[5*Î¸] using Factor[] gives me I*r^2*(4*Sin[2*Î¸] + r^3*Sin[5*Î¸]) using FactorTerms[] gives me I*(4*r^2*Sin[2*Î¸] + r^5*Sin[5*Î¸]) which is what I want, but as soon as I add in a common numerical factor, it also factors that out as well, e.g. 4*I*r^2*Sin[2*Î¸] + 8*I*r^5*Sin[5*Î¸] I finally just decided to divide the whole thing by 'I', and do some reconstruction of my expression, but I have the distinct feeling I've totally missed something very simple. As an additional example, what if I just wanted to extract 2*x*I out of the following: 4*x*I*Sin[t] + 28*x^3*I*Cos[t] how would I do that? In general, I'm looking for a function that says "Given an expression 'expr' and another expression 'sub' that is common to all additive terms of 'expr', give a result that is the product of 'sub' and the result of factoring 'sub' out of 'expr'". Thanks, Matt

**Follow-Ups**:**Re: Factoring***From:*Murray Eisenberg <murray@math.umass.edu>

**Re: Factoring***From:*Andrzej Kozlowski <akoz@mimuw.edu.pl>