MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: [Help Needed] Function to solve polynomial

  • To: mathgroup at
  • Subject: [mg71264] Re: [Help Needed] Function to solve polynomial
  • From: Bill Rowe <readnewsciv at>
  • Date: Sun, 12 Nov 2006 06:48:04 -0500 (EST)

On 11/11/06 at 3:38 AM, ms-z- at (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:

f = (x - 4)*(x + 2)*(x - 1)*(x + 5)*(x - 7);
-List @@ f /. x -> 0

{7, 4, 1, -2, -5}
To reply via email subtract one hundred and four

  • Prev by Date: Developer`UseFrontEnd + FrontEndExecute + GetBoundingBoxSizePacket
  • Next by Date: Question about Reduce
  • Previous by thread: [Help Needed] Function to solve polynomial
  • Next by thread: change of variables