SAGE is a free and open-source symbolic algebra system which allows computations in many fields of mathematics, with particular strength in algebra and number theory. Packages can be written to extend SAGE in areas where the basic language is weak. SAGE is based on the Python language, which may be used to script SAGE commands.
The simplest way to access SAGE is to get an account (currently free) on SageMathCloud.
SAGE is installed on UMBC's
gl.umbc.edu servers, which are
accessible across the internet. Any UMBC employee or student has access using
the account name and password they normally use for UMBC e-mail.
Details of logging into this server are here.
Once you have logged in you can run SAGE by typing the command
followed by pressing the return key. (The version of SAGE run here is
badly out of date and non-functioning as of April 2014.)
SAGE can also be downloaded from
and installed on any Linux or Macintosh OS/X system.
SAGE is designed to be used in either of two ways - through a web-based notebook front end or as a command line application. The simplest installation (and the one currently used on the UMBC servers) is as a command line application, but the richer interface (graphics, etc) is through the notebook interface.
At the SAGE command prompt (which usually looks something
sage:) type the command to be run, and then press the
Return key to have SAGE evaluate the command. As a simple
example, if you want to add two integers type:
3 + 12
Intermediate values can be saved by giving them a name and assigning
them a value with the "
=" operator. If the following two
commands are run the second output will be 1:
thesum = 3 + 12
thesum - 14
SAGE is very careful about exact values. Exact values are things like
symbols and integers. Thus
sin(3) are exact
values and when you evaluate
sin(3) you get
back as an answer. Contrast this with the fact that
3.0 is an
approximate (floating point) value and thus
to the approximate value 0.14122. The
operators will force a numerical evaluation.
sage: sin(3) sin(3) sage: sin(3.0) 0.141120008059867 sage: float(sin(3)) 0.141120008059867
When you are done with SAGE, either type the command
exit or type ^D (type the letter D while holding down the
There are several ways to find help in SAGE. You can search by
the specific Mathematica command (if you know it). The basic help
This only works if cmd is a correctly spelled and capitalized SAGE command.
If you are uncertain about the name of a SAGE command there are at least
two ways to find it. Typing the first few letters of the command and then
Tab will list possible completions. The wildcard *, representing
any string of characters, can be used together with the question mark to get
a list of matching commands.
sage: power_mod? The n-th power of a modulo the integer m. sage: FiniteFi*? FiniteField FiniteFieldElement FiniteFields
A selection of documents are available on the SAGE web site
When working with SAGE on the web-based notebook interface you can edit a command using the usual mouse, click and type method. If you are using the command line interface for SAGE you can use the left and right arrow keys to move within a line, the up and down arrow keys to recall earlier commands and a number of simple Emacs commands.
The results of the previous command can be referred to as
(an underline), two commands ago as
__ and three commands ago
Much of the heavy computation done by SAGE is actually done by other domain specific languages which are distributed and installed together with SAGE. Examples include:
In addition to letting SAGE make calls to these languages they can be
called directly from within SAGE or started and run independently.
The SAGE interface to some of these languages is documented at
and a simple tutorial is found at