Re: numerical roots of a polynomial
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1204] Re: numerical roots of a polynomial
- From: danl (Daniel Lichtblau)
- Date: Tue, 23 May 1995 02:57:37 -0400
- Organization: Wolfram Research, Inc.
In article <3pjkiu$7h0 at news0.cybernetics.net> Sigurd.Schelstraete at rug.ac.be (Sigurd Schelstraete) writes: > hello, > > does anyone know if there exists a package/function that allows one to find > (numerically) all n roots of a polynomial of degree n, whether they are > real or not? Since NSolve seems to be equivalent to N[Solve], it can not > be used for generic polynomials of fifth degree or higher. Also the > function FindRoot only allows one to find a single root near a given > starting value (which can be complex though). > > What I would like, is a function that returns the numerical values of all > n roots as a list of substitution rules, as does Solve or NSolve. > > I guess it could be done by successively dividing out a single root found > with FindRoot, but I'd rather first hear if anyone out there already has > a clear-cut solution to this problem. > > All answers are appreciated. > > Greetings, > > Sigurd Schelstraete > University of Gent > Belgium > > NSolve will indeed do this in versions 2.0 and later. For example, In[2]:= NSolve[x^5+x+3==0, x] Out[2]= {{x -> -1.133}, {x -> -0.475381 - 1.1297 I}, > {x -> -0.475381 + 1.1297 I}, {x -> 1.04188 - 0.82287 I}, > {x -> 1.04188 + 0.82287 I}} For higher precision, use NSolve[..., WorkingPrecision->...] Daniel Lichtblau, WRI