Download MuPAD from SciFace

MuPAD Pro Computing Essentials - Examples 

Example 10.3 - Multiple Roots 

Here is a procedure that produce a list of all the roots without scrapping multiple roots.

solveList := proc(equation, x)
   local rts, i, j, count, rt;
begin
   rts := [];
   a := [op(solve(equation,x,Multiple))];
   for i from 1 to nops(a) do
      count := a[i][2];
      rt := a[i][1];
      for j from 1 to count do
         rts:=rts.[rt]
      end;
   end;
   return(rts)
end:

solveList(x^5+2*x^4-10*x^3-8*x^2+33*x-18,x)
 
[1,1,2,-3,-3]
 
TOP