Title: **Sage – beginner’s guide**

Author: Craig Finch

Technical Reviewers: Dr David Kirkby and Minh Nyugen.

Publisher: Packt Publishing, Open Source series

Review

Complete disclosure: I received this book for free from the publisher, with only the promise to put a review on this blog. Also, I have worked with one of the book’s reviewers (Minh) on a few projects. However, I didn’t receive any other renumeration, don’t know the author of the text under review, and no one asked to pre-approve this review.

The book under review is a book on `Sage`

, an open source mathematical software package started by William Stein, a mathematician at the University of Washington. It is very carefully written (either that, or very carefully reviewed by the Technical Reviewers!) and aimed, as the title suggests, at the beginner. However, it is assumed that the reader knows some undergraduate mathematics, say the level one obtains from getting an engineering degree. In fact, it has a bit of an applied slant with many examples from physics and engineering mathematics. This is a welcome contrast to the excellent **Sage Tutorial** (available free from the `Sage`

website, http://www.sagemath.org) which has a more of a pure slant. It’s nice to see a publisher like Packt Publishing take the risk of publishing a book like this on an open source software program which already has free documentation (in pdf form).

There are 10 chapters and it’s about 350 pages. Although `Sage`

of course has color plotting, all figures in this book are in black and white, so the reader really must try out the `Sage`

code given in the book to get the full effect. Each chapter features many *Time for action* Sage code examples (also conveniently listed in the table of contents at the front of the book), followed by a *What just happened?* section explaining in detail (and without computer code) what the example did. These make the book more useful to the beginner as well as for someone wanting a quick reference for one of the examples. All these examples use the command-line version of `Sage`

(typing your commands into a terminal window at a `sage:`

prompt) but there are several sections explaining the GUI version of `Sage`

(typing your commands into a `Mathematica`

-like “notebook cell”) as well.

Here is a chapter-by-chapter summary:

The first chapter, *What can you do with Sage?*, is a survey of some of `Sage`

‘s most commonly used capabilities. Examples such as solving a differential equations, plotting experimental data, and some simple example matrix computations are presented.

The second chapter is *Installing Sage*. This covers the steps you go though for a Mac OS, Windows, and Linux installation of `Sage`

. Since this is scary for a number of users who are not very computer-savvy, it is nice an entire chapter is devoted to this.

The third chapter, *Getting started with Sage,* introduces the new `Sage`

user to the user interface, basic `Sage`

syntax, user-defined functions, and some of the available data types (such as strings and real number types). For example, the (black and white version of the) `Sage`

plot of the `sinc`

function,

sage: f(x) = sin(x)/x sage: plot(f, x, xmin=-15, xmax = 15, thickness=2, color="red", legend_label="sinc")

is discussed, among many other things.

This motivates a more detailed introduction to Python, given in the next chapter.

*Introducing Python and Sage,* the fourth chapter, introduces syntax for Python lists, dictionaries, for loops, if-then statements, and also reading and writing to files. `Sage`

is based on Python, a popular language used extensively in industry (at `google`

among other places). This chapter introduces some very useful stuff, but is pretty basic if you know Python already.

The 5th chapter is *Vectors, matrices and linear algebra,* and you can guess what it is about. `Sage`

has very wide functionality in linear algebra, with specialized packages for numerical computations for real and complex matrices, matrices over a finite field, or matrices having symbolic coefficients, such as functions of a variable x.

`Sage`

‘s functionality in two-dimensional and three-dimensional plotting is described in the 6th chapter, *Plotting with Sage.* There is 3-d “live-view” (i.e., you can use the mouse to rotate a plot of a surface or solid in 3-space), histogram plots, as well as simpler plots using `Sage`

‘s 2-d plotting package, `matplotlib`

.

Chapter 7 is *Making symbolic mathematics easy.* Various topics are covered, from various calculus operations, such as limits, derivatives, integrals, and Laplace transforms, to exact

solutions to equations with variable coefficients, to infinite sums such as power series, to solving ordinary differential equations.

*Solving problems numerically* is the next chapter. This is the meat-and-potatoes for an applied mathematician. `Sage`

includes many packages which have been developed to solve optimization problems, linear programming problems, numerical solutions of ordinary differential equations, numerical integration, and probability and statistics. These are introduced briefly in this chapter.

The 9th chapter is *Learning advanced python programming.* Here object-oriented programming is introduced by means of examples, and it is shown how Python handles errors and imports.

The last chapter *Where to go from here* discusses selected miscellaneous advanced topics.

Topics covered include: `LaTeX`

, interactive plotting using the `Sage`

notebook, as well as a fairly detailed example of analyzing colliding spheres in `Sage`

from several different approaches.

The book has a very good index and, overall I believe is a very welcomed addition to the literature of `Sage`

books.