HI BP, a command similar to factorout of the classpad in Xcas?
factorout
Modérateur : xcasadmin
-
- Messages : 556
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re:
No built-in, but it's easy to write your own, something like:
factorout(f,v):=v*ratnormal(f/v)
factorout(f,v):=v*ratnormal(f/v)
-
- Messages : 556
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: factorout
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 )
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
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.
-
- Messages : 556
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: factorout
B. xcas has some command to distribute a denominator to each part of the numerator?
Re: factorout
expand or fdistrib
-
- Messages : 556
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: factorout
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)
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)