Xcas has a command that returns a list of expressions, but without multiplicity?
1:
factors( x^4-1 ) returns
[x-1,1,x+1,1,x^2+1,1]
2:
factor( x^4-1 ) returns
(x-1)*(x+1)*(x^2+1)
3:
split( x^4-1, x) returns
Error =(
x^4-1 ->
[x-1,x+1, x^2+1]
Factoring as list
Modérateur : xcasadmin
-
- Messages : 574
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: Factoring as list
you can easily write a user program from the output of factors to do that.
-
- Messages : 574
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: Factoring as list
Code : Tout sélectionner
splits(pol):=
{
fs:=factors(pol);
sz:=size(fs);
return seq('fs[k-1]',k,1,sz,2);
}
1:
factors(x^4-1) returns
[x-1,1,x+1,1,x^2+1,1]
2:
splits(x^4-1) returns
[x-1,x+1,x^2+1]
3:
split(x^4-1,[x,y]) trick
[(x-1)*(x+1)*(x^2+1), 1]
An idea, I like that commands embedded in the system
add a Full keyword, to denote total separation, As does matlab
https://www.mathworks.com/help/symbolic/factor.html
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
4:
split(x^4-1,x,'full')
[x-1,x+1,x^2+1]