Actually, I think I don't need this any more. I thought it would be easy to just remove this functionality, but in fact, it can't be removed so easily, because many heuristics rely on it (e.g., trigintegrate works on monomials). So instead, I will just call risch_integrate() before the heuristics, and inside the Add.make_args loop as well.
Even so, the differences between gcd, terms_gcd, gcd_terms (yes, there are both), gcd_list, as_primitive_content, as_independent, collect, factor, etc. (what others are there?) are very confusing. It would be great if we had a document in the docs listing all these similar functions and explaining all the differences, and when each should be used. Aaron Meurer On Sat, Nov 10, 2012 at 10:50 PM, Aaron Meurer <[email protected]> wrote: > What's the best way to pull out a common coefficient not depending on a > given variable from an expression? I know there are a lot of functions > that do things like this, but I never know which one to use. I want > something like (all with respect to x): > > 3*x -> (3, x) > 3*x + x**3 -> (1, 3*x + x**3) > y*x + y*x**2 -> (y, x + x**2) > > My motivation is to pull out a common constant for integrate(). Currently > it splits the integral using Add.make_args and then pulls out the constant > for each term using as_independent, but I want to remove the splitting of > Add args. > > Aaron Meurer > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
