- To: mathgroup at smc.vnet.net
- Subject: [mg65107] Re: Factoring
- From: "J Siehler" <jsiehler at gmail.com>
- Date: Wed, 15 Mar 2006 06:28:18 -0500 (EST)
- References: <email@example.com>
- Sender: owner-wri-mathgroup at wolfram.com
Matt wrote: > 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*Î¸] This will do the job for your specific case: x = 4*I*r^2*Sin[2*Î¸] + I*r^5*Sin[5*Î¸] Simplify[x, Count[#, _Complex, Infinity] &] Pulling out a common subexpression in general seems tricky since the desired subexpression may occur in different guises in different summands. For example, look at the FullForm of 'x' in the preceding; there isn't really an 'I' in the first summand.