Post Reply 
What's the difference in all the polynomial solve/root/zero functions?
09-07-2015, 09:28 PM
Post: #7
RE: What's the difference in all the polynomial solve/root/zero functions?
There are some subtle differences.

Take, for example, the polynomial (x-2)^2*(x+1) with roots {2,2,-1}.

solve((x-2)^2*(x+1)=0,x) returns {-1,2} in a list as integers
zeros((x-2)^2*(x+1),x) returns [2,-1] in a vector as integers

and proot((x-2)^2*(x+1),x) returns all three roots [-1. 2. 2.] in a vector as reals.

proot also takes a vector with the coefficients as an argument, which can be nice, e.g.,
proot([1 -3 0 4]) returns the same solution as above.

I say it is good to have choices! And for fun, try solving this polynomial (in expanded form) with fsolve between, say, -5 and 5,

fsolve(x^3-3*x^2+4,x,-5..5) returns [-1. 0. 2.] !!
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: What's the difference in all the polynomial solve/root/zero functions? - Helge Gabert - 09-07-2015 09:28 PM



User(s) browsing this thread: 1 Guest(s)