Re: [Help Needed] Function to solve polynomial
- To: mathgroup at smc.vnet.net
- Subject: [mg71264] Re: [Help Needed] Function to solve polynomial
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Sun, 12 Nov 2006 06:48:04 -0500 (EST)
On 11/11/06 at 3:38 AM, ms-z- at hotmail.com (a1b2c3d4) wrote: >I am trying to write a function that will help me solve the >polynomial f(x)=(x-4)(x+2)(x-1)(x+5)(x-7) (NSolve and Solve >functions not preferred) Why are NSolve and Solve not preferred? >I can only think of this function: solution := {Plot[{(x -4)(x + >2)(x - 1)(x + 5)(x - 7)}, {x, -10, 10}, AxesLabel -> TraditionalForm >/@ {x, y}]} What is it you are looking for? A graph of a function provided by Plot isn't what I would normally consider a solution to the function. >Does anyone have better knowledge than me in writing an automated >program to solve this polynomial? Say For, While or Do Loop? Are you simply looking for a list of the roots? If so, a polynomial written in the form above can be very simply converted to a list of roots as follows: In[2]:= f = (x - 4)*(x + 2)*(x - 1)*(x + 5)*(x - 7); -List @@ f /. x -> 0 Out[3]= {7, 4, 1, -2, -5} -- To reply via email subtract one hundred and four