factorout

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 556
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

factorout

Message par compsystems » mer. mai 30, 2018 12:20 pm

HI BP, a command similar to factorout of the classpad in Xcas?

Image

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re:

Message par parisse » jeu. mai 31, 2018 6:07 am

No built-in, but it's easy to write your own, something like:
factorout(f,v):=v*ratnormal(f/v)

compsystems
Messages : 556
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: factorout

Message par compsystems » mer. juin 20, 2018 4:48 pm

it does not work

factorout(3*a+5*a²+6*a*d+b*d+b²+3*b,a) = a*(5*a^2+6*a*d+3*a+b^2+b*d+3*b)/a => a*( 5*a + 6*d + (b^2/a) +(b*d)/a + (3*d)/a + 3
factorout( 5*z + z*y + 2*z² + 3*z*x + 6,z) = z*(3*x*z+y*z+2*z^2+5*z+6)/z => z * (3*x + y + 2*z +6/z +5 )

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: factorout

Message par parisse » mer. juin 20, 2018 6:17 pm

Yes, it means that v is not a factor of the original expression, since f/v does not simplify, hence one should not try to factor it out.

compsystems
Messages : 556
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: factorout

Message par compsystems » mer. juin 20, 2018 6:35 pm

B. xcas has some command to distribute a denominator to each part of the numerator?

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: factorout

Message par parisse » jeu. juin 21, 2018 5:10 am

expand or fdistrib

compsystems
Messages : 556
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: factorout

Message par compsystems » jeu. juin 21, 2018 12:49 pm

so now factorout with expand cmd works well (I think it's important to pre-include it as an inverse distributive function)

factorout(f,v):=v*expand(f/v);

factorout(3*a+5*a²+6*a*d+b*d+b²+3*b,a) => a*(b^2/a+b*d/a+5*a+6*d+3*b/a+3)

factorout( 5*z + z*y + 2*z² + 3*z*x + 6,z) => z*(3*x+y+2*z+5+6/z)

factorout(x + 5*x² + 7*x*y,x) => x*(5*x+7*y+1)

Image

Répondre