Re: Factoring
- 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: <dv6847$nq4$1@smc.vnet.net>
- 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.