Rational root theorem to factor

Issue #85 resolved
Former user created an issue

There is a way to use the rational root theorem in symja to factor a polynomial?

Comments (5)

  1. Axel Kramer repo owner

    There are the Factor and Solve functions, but they don't use exactly the "rational root theorem" as described here: Wikipedia: Rational root theorem

    >>> Solve(3*x^3-5*x^2+5*x-2==0,x) 
    {{x->2/3},{x->-I*1/2*3^(1/2)+1/2},{x->I*1/2*3^(1/2)+1/2}}
    
    >>> Factor(3*x^3-5*x^2+5*x-2)
    (3*x-2)*(x^2-x+1)
    

    See: http://symjaweb.appspot.com/?ci=ta:Input:t:Solve(3x%5E3-5x%5E2%2B5*x-2%3D%3D0%2Cx)

    See: http://symjaweb.appspot.com/?ci=ta:Input:t:Factor(3x%5E3-5x%5E2%2B5*x-2)

  2. Axel Kramer repo owner

    For gaussian integers you can use:

    Factor(1+x^2, Extension->I) 
    

    or:

    Factor(1+x^2, GaussianIntegers->True)
    

    You can also try:

    Roots(3*x^3-5*x^2+5*x-2)
    

    or

    NRoots(3*x^3-5*x^2+5*x-2)
    
  3. Alfio Caprino

    Where can I find documentation about Extension->I and GaussianIntegers->True? I mean..there is some documentation about functions additional parameters and settings?

  4. Log in to comment