roots := proc(eqn) local p, r; begin p := poly(eqn, x $ INDOETS); r := solve(p, x); if nops(r) < degree(p) then print("Some roots could not be found."); end_if; return(r); end_proc: roots(x^5 - 3*x^4 + x^2 - 1 = 0);