Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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


  • 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