MathGroup Archive 2006

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

Search the Archive

Re: Re: Function to solve polynomial


Did I miss something?  What's wrong with the following?

   p[x_] = Expand[(x - 4)(x + 2)(x - 1)(x + 5)(x - 7)]
-280 + 194*x + 125*x^2 - 35*x^3 - 5*x^4 + x^5

   Solve[p[x] == 0, x]
{{x -> -5}, {x -> -2}, {x -> 1}, {x -> 4}, {x -> 7}}

All output was converted to InputForm.

dimitris wrote:

> 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)
>>
>> 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}]}
>>
>> Does anyone have better knowledge than me in writing an automated program to solve this polynomial? Say For, While or Do Loop?
>>
>> Your help will be greatly appreciated.
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: List difference using patterns and substitutions.
  • Next by Date: FindInstance returning incorrect results
  • Previous by thread: Re: Function to solve polynomial
  • Next by thread: my favorite MathML output from Mathematica so far: