Re: [sympy] How to factor out a constant?

2021-12-14 Thread Oscar Benjamin
On Tue, 14 Dec 2021 at 13:53, Paul Royik wrote: > > In any expression, how to factor a constant (that doesn't depend on certain > symbols)? > > For example (-2xy+2).factor_function(x,y) should give 2, (1-xy). > > as_coeff_mul doesn't work. Maybe factor_terms is what you want: In [50]: factor_te

[sympy] How to factor out a constant?

2021-12-14 Thread Paul Royik
In any expression, how to factor a constant (that doesn't depend on certain symbols)? For example (-2xy+2).factor_function(x,y) should give 2, (1-xy). as_coeff_mul doesn't work. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from thi

Re: How to factor out

2008-02-06 Thread Ondrej Certik
On Jan 19, 2008 9:37 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > On Sat, Jan 19, 2008 at 09:01:05PM +0100, Friedrich Hagedorn wrote: > > > > On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > > > > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: >

Re: How to factor out

2008-01-19 Thread Friedrich Hagedorn
On Sat, Jan 19, 2008 at 11:35:00PM +0300, Kirill Smelkov wrote: > > On Sat, Jan 19, 2008 at 09:01:05PM +0100, Friedrich Hagedorn wrote: > > > > On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > > > > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > >

Re: How to factor out

2008-01-19 Thread Friedrich Hagedorn
On Sat, Jan 19, 2008 at 09:01:05PM +0100, Friedrich Hagedorn wrote: > > On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > > > > > how can do like this: > > > > > > x + x**2 == x*(

Re: How to factor out

2008-01-19 Thread Kirill Smelkov
On Sat, Jan 19, 2008 at 09:01:05PM +0100, Friedrich Hagedorn wrote: > > On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > > > > > Hello, > > > > > > how can do like this: > > > > > > x + x**2 == x*(

Re: How to factor out

2008-01-19 Thread Friedrich Hagedorn
On Thu, Jan 17, 2008 at 03:15:49PM +0100, Ondrej Certik wrote: > > On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > how can do like this: > > > > x + x**2 == x*(1 + x) > > > > ? > > In [1]: factor(x+x**2) > Out[1]: x*(1 + x) Fine. Now I want do

Re: How to factor out

2008-01-17 Thread Ondrej Certik
On Jan 17, 2008 2:50 PM, Friedrich Hagedorn <[EMAIL PROTECTED]> wrote: > > Hello, > > how can do like this: > > x + x**2 == x*(1 + x) > > ? In [1]: factor(x+x**2) Out[1]: x*(1 + x) Ondrej --~--~-~--~~~---~--~~ You received this message because you are subscrib

How to factor out

2008-01-17 Thread Friedrich Hagedorn
Hello, how can do like this: x + x**2 == x*(1 + x) ? Thanks, Friedrich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscri