Page 1 sur 1

factorout

Publié : mer. mai 30, 2018 12:20 pm
par compsystems
HI BP, a command similar to factorout of the classpad in Xcas?

Image

Re:

Publié : jeu. mai 31, 2018 6:07 am
par parisse
No built-in, but it's easy to write your own, something like:
factorout(f,v):=v*ratnormal(f/v)

Re: factorout

Publié : mer. juin 20, 2018 4:48 pm
par compsystems
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 )

Re: factorout

Publié : mer. juin 20, 2018 6:17 pm
par parisse
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.

Re: factorout

Publié : mer. juin 20, 2018 6:35 pm
par compsystems
B. xcas has some command to distribute a denominator to each part of the numerator?

Re: factorout

Publié : jeu. juin 21, 2018 5:10 am
par parisse
expand or fdistrib

Re: factorout

Publié : jeu. juin 21, 2018 12:49 pm
par compsystems
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