Newton's method in Axiom

I have just written about the freeware CAS Maxima; this time it’s about Axiom. Axiom differs from most CAS’s in being strongly typed, in that each expression belongs to a particular type, such as the integers, or polynomials, or finite fields. One of the difficulties for a beginner with Axiom is using types correctly.

As with Maxima, here is a very small example: Newton’s method interactively:

First define the function:

(1) -> f:=x^5+x^2-1

         5    2
   (1)  x  + x  - 1

             cheap nba jerseys           Type: Polynomial  wholesale jerseys  Integer

and its derivative

(2) -> d:=D(f,x)

   (2)  5x  + 2x

                     Type: Polynomial Integer

Now put them together as in a Newton’s method, where function turns an expression into a function (similar in some respects to Maple’s unapply):

(3) -> function(x-f/d,'nr,'x)

   (3)  nr
  2000’lerde       cheap mlb jerseys         Tapperis            Type: Symbol

And now, starting with cheap nfl jerseys 0.8, we can obtain iterations:

(4) -> nr(0.8)

Compiling function nr with type Float -> Float

   (4)  0.8088596491 2280701754
                     Type: Float
(5) -> nr(%)

   (5)  0.8087306283 5888432463
   cheap nba jerseys                     Type: Float

(6) -> nr(%)

   (6)  0.8087306004 7939331516
          14              Type:  Infinitesimals  Float

(7) -> nr(%)

   (7)  0.8087306004 7939201374
                     Type: Float

(8) -> nr(%)

   (8)  0.8087306004 7939201374
            method            Type: Float

And there we are!

One thought on “Newton's method in Axiom

  1. What a great blog! I will try Maxima when I log on as administrator … Have you tried GeoGebra? It’s free too and it does some symbolic things. Good for students who want visuals.

Leave a Reply

Your email address will not be published. Required fields are marked *