Introduction and Survey

In the 21st century computers are in the process of changing all aspects of our lives. That includes also mathematics - both the way we do it and even the kind of problems that interest us. The ability to make computations far beyond anything that was possible without the aid of computers has opened up previously inaccessible areas of research to anyone equipped with a computer,   suitable software and some mathematical knowledge.  This has lead to the creation of sophisticated programs intended for dealing with all aspects of computational mathematics - symbolic manipulation, numerical computation and visualization (including interactive one).  A leading program of this type is Mathematica produced by Wolfram Research. Mathematica is, of course, not only a tool of research and exploring new areas of computational mathematics but also an extremely effective aid in studying traditional ones. The aim of this essay is to give a brief introduction to some of the possibilities offered by this remarkable program. For this purpose we have made use of a number of exmaples, some of which are due to the authors of this text, some have been borrowed from Mathematica’s official  documentation and some from various sources on the Internet.

Basic information about Mathematica

The main web-page

The main website for current information, useful projects, plug-ins, learning center
and documentation is . At this website one can also find a free CDF-Player,  thousands of demonstrations with source files and educational videos.

Mathematica is  one of the most powerful and sophisticated systems for symbolic and numerical computation and visualization. But it is also more than that. Wolfram Research used to describe Mathematica as a “system for doing mathematics by computer” but it has since changed this to “ the only development platform fully integrating computation into complete work-flows”. In other words, Wolfram Research now conceives Mathematica as essentially a universal tool for almost every purpose - symbolic and numerical computation and programming being a central aspect (but this is not the whole story). For example, Mathematica is also an advanced technical typesetting tool, which can produce mathematical documents of quality comparable to 1. Introduction and a survey_1.gif and Latex but in a fully WYSIWYG (What You See is What You Get) way. At the same time, these documents can contain “live” mathematical formulas and graphics that can be send to another person (a collaborator, a student or a professor) who can use them to verify the correctness of results or to perform additional computations etc.

In terms of its overall abilities Mathematica currently has no comparable rival (except, perhaps, for suites of several applications). But if we restrict our attention only to computation, there are other programs (e.g. Maple, MatLab and others) that can do similar things. As a mathematical tool, Mathematica is a “general purpose” system. It is very strong in both symbolic and numeric computation. It has very many powerful specialized functions for subjects as different as polynomial algebra, graph theory, statistics of financial mathematics. However, in some areas (particularly in pure mathematics) there are specialized programs (such as MAGMA, Singular, Macaulay2 etc.) which can do some things that Mathematica cannot do without additional programming or can do them  faster (which in certain situations can be crucial).

The official distributor of Mathematica in Poland is the company Gambit <>.

Wolfram Research sites and projects

Wolfram Research has a number of sites and projects of interest both  to Mathematica users and the general public:

Mathworld  <>

Mathworld is a very useful and extensive web  resource with definitions, examples and main theorems in mathematics (and often  - Mathematica files in the NB format, i.e., Mathematica notebooks .)

Wolfram Alpha  <>

Wolfram Alpha - Mathematica (and more) for everyone!

Wolfram Demonstrations Project <>


Wolfram Research has an extensive educational program. To register for on-line Wolfram Educational Group (WEG) seminars and classes, one can visit  
The Wolfram Education Group (WEG)  offers a wide range of free on-line seminars featuring the latest version of Mathematica  (see

There are conferences/master classes/other events in Europe and in particular, in Poland. In Warsaw, ICM (the interdisciplinary center at UW) has Mathematica and  provides  some training.


The Mathematica Journal

The Mathematica Journal <> is an on-line journal with research and educational papers.

Other Mathematica related sites

There is an excellent and free introduction to Mathematica programming due to Leonid Shifrin:
Also the Mathematica Guidebooks <> provide a wealth of applications and examples, particularly from physics but also from other areas. Unfortunately the guidebooks are still not fully compatible with Mathematica 6 and later versions so they are only suitable for users who are advanced enough to update the relevant parts themselves.

Finally there is an excellent Mathematica discussion group (known as the MathGroup)
You can ask any questions about any aspect of Mathematica and get a variety of answers from Mathematica experts, including Wolfram Research employees. Sometimes you can even have your math problems solved for you.
This is really the best Mathematica centered resource on the Web, if you know how to make use of it.

The above is, of course, not intended to be a exhaustive account of Mathematica related resources on the Internet. Far from it, the number of  both general purpose and specialised sites intended for beginners as well as advanced users is huge and constantly increasing (e.g., Mathematica Tips on Twitter etc).

Selected examples od what Mathematica can do

Computational applications

Built-in functions

A large number of problems (even some “real life” ones)  can be solved by simply applying one of Mathematica’s built-in “functions” (the word “function” in connection with Mathematica is used in a somewhat different sense than in mathematics, closer to what in other programming languages is called a “procedure”).  Among the most useful of these functions are Solve and  Reduce. These are very general functions that use a large ensemble of advanced algorithms to solve all kinds of equations and inequalities, many of which would appear unsolvable even to people with good knowledge of mathematics. We will looks at some remarkable examples of the sort of  thing that can be accomplished with Reduce.
(In version 8 the functions Solve became very enhanced and can solve many of the problems that Reduce can, but it often uses somewhat different techniques. Probably the main difference between the two functions is that Reduce always attempts to return the complete solutions of a problem while Solve will in some situations return a partial solution.)

Perhaps the most basic and frequently performed task in mathematics is solving equations. Reduce can be used, of course, to solve equations (and systems of equations) far too complicated to solve by hand. We start by looking at a simple cubic equation, which Mathematica can solve using the famous formula of del Ferro (often attributed to Tartaglia):

1. Introduction and a survey_2.gif

1. Introduction and a survey_3.gif

We can also ask Mathematica to compute the real root only:

1. Introduction and a survey_4.gif

1. Introduction and a survey_5.gif

We can compute it’s numerical value to arbitrary precision:

1. Introduction and a survey_6.gif

1. Introduction and a survey_7.gif

From the work of Abel and Galois it is known that no solutions of the above kind (in terms of radicals) can be given for polynomial equations of degree higher than 5. However, this does not stop Mathematica :

1. Introduction and a survey_8.gif

1. Introduction and a survey_9.gif

Again the values can be computed to arbitrary precision:

1. Introduction and a survey_10.gif

1. Introduction and a survey_11.gif

Reduce can also deal with purely symbolic problems. For example, consider the quadratic equation 1. Introduction and a survey_12.gif.  Let’s obtain the well known condition for it to have two equal roots.

1. Introduction and a survey_13.gif

1. Introduction and a survey_14.gif

Let’s now try something non-polynomial. Here is a trigonometric equation.  We ask Reduce to solve it for a range of values  in an interval, where there is a finite number of solutions:

1. Introduction and a survey_15.gif

1. Introduction and a survey_16.gif

We can also obtain a complete solution without a restriction on the domain of solutions.

1. Introduction and a survey_17.gif

1. Introduction and a survey_18.gif

Here is an equation that seems impossible to solve by hand, but Reduce can do it:

1. Introduction and a survey_19.gif

1. Introduction and a survey_20.gif

1. Introduction and a survey_21.gif

1. Introduction and a survey_22.gif

All the solutions are complex numbers. Reduce can prove that there are no real solutions:

1. Introduction and a survey_23.gif

1. Introduction and a survey_24.gif

Here is a completely different kind of equation, this time over the integers.

1. Introduction and a survey_25.gif

1. Introduction and a survey_26.gif

Let’s now try something harder - a “real life” problem. There is an Internet forum, called the MathGroup,  where people post questions about Mathematica, including mathematical questions they try to solve with Mathematica. Solutions are posted by other users including some of the staff of Wolfram Research. One such question was posted by Ivan Smirnov in January 2011 (the whole thread can be found here: Smirnov’s problem

Are there any integer solutions of 1. Introduction and a survey_27.gif?

It is easy to find trivial solutions where two of the three variables x,y,z are zero, so let’s look for such solutions. Reduce cannot solve the complete problem but it can quickly verify that there are no solutions for 1. Introduction and a survey_28.gif.

1. Introduction and a survey_29.gif

1. Introduction and a survey_30.gif

In fact (after changing certain settings which limit the number of cases Reduce will consider, one can verify that there are no solutions for 1. Introduction and a survey_31.gif.

Reduce can be very useful in many undergraduate courses. For example, in Analysis 1 one often needs to prove that a certain integer sequence is monotonic. Consider, for example, the problem

1. Introduction and a survey_32.gif

1. Introduction and a survey_33.gif


Although many problems can be solved just by applying built-in functions, in many cases there is no built-in function that will do all the work by itself. In such cases we need to do our own programming. Here are some recent problems taken from the MathGroup.

Find three 2 - digit prime numbers such that :
(i)  The average of any two of the three is a prime number, and
(ii) The average of all three is also a prime number

There is no Mathematica function that will automatically answer a question like this, but the answer can be found with a few lines of Mathematica code:

1. Introduction and a survey_34.gif

1. Introduction and a survey_35.gif

Here is another question from the MathGroup:

What' s the easiest way to determine the length of the repeating cycle for decimal expansions of fractions? For example, 1/7 == 0.14285714285714285714. . .so the length of its repeating cycle
(142857) is 6. For 1/3 the length of the cycle is obviously 1. For some fractions, e.g., 1/4, the decimal expansion is not cyclical (in base 10).

We use programming to define a function lengthOfCycle. We make use of several built-in Mathematica functions, in particular, IntegerExponent and MultiplicativeOrder.  If we could not use these functions the program would have to be much longer, more complicated and less efficient.

1. Introduction and a survey_36.gif

1. Introduction and a survey_37.gif

1. Introduction and a survey_38.gif

In certain situations programs written in  Mathematica programming language can be much slower than programs written in typed and compiled languages such as C, Java, etc (although, of course, writing such programs in Mathematica is almost always much quicker). However, for many types of programs this difference can be greatly reduced by “compiling”. Not every kind of Mathematica program can be successfully compiled but when it can, this can make a very big difference to performance. Here is an example where a non-compiled Mathematica program performs rather poorly. We will give only a compiled version, that is very fast. The program constructs an Ulam spiral and is due to Daniel Lichtblau of Wolfram Research:

1. Introduction and a survey_39.gif

Making a spiral with 60 000 points takes only a fraction of a second:

1. Introduction and a survey_40.gif

1. Introduction and a survey_41.gif

We can view the spiral as a collection of points:

1. Introduction and a survey_42.gif

1. Introduction and a survey_43.gif

or of lines

1. Introduction and a survey_44.gif

1. Introduction and a survey_45.gif

In Mathematica version 8, this can be speeded up further by using the option CompilationTarget›C, which however, requires that a C-compiler be installed on the computer.

Specialized Mathematics

Mathematica contains a large number of specialized functions for various areas of mathematics, ranging from Group Theory and Number Theory to Statistics (a vast number of statistical distributions are available as built-in functions) and financial mathematics. A particularly interesting aspect is Mathematica’s ability to obtain live financial data from the Internet and analyze them by means of a variety of specific financial functions. As an example we compare the performance of the value of the index of the American NASDAQ stock exchange (on which most US technology companies are represented) and of Apple Computer Inc.

1. Introduction and a survey_46.gif

1. Introduction and a survey_47.gif

1. Introduction and a survey_48.gif

1. Introduction and a survey_49.gif

1. Introduction and a survey_50.gif

1. Introduction and a survey_51.gif


Mathematica has remarkable graphic capabilities. Here is an example of a mathematical graphic related to the subject of iteration of functions in the complex plane and “fractals”.

1. Introduction and a survey_52.gif

Beyond Graphics - Interactive Dynamics

A completely new set of features, that have nothing quite similar in other programs, appeared in Mathematica 6.  These involve interactive “dynamic” abilities that are difficult to describe in a static format, but can be seen below.

Wolfram Demonstrations Project

It is difficult to describe on a static page how remarkably useful this functionality is in all kinds of situations, including both research and teaching. A single interactive Mathematica notebook can replace dozens of static pictures.

Here we see one example.  It shows the convergence of the power series 1. Introduction and a survey_53.gif on the unit disk {z}?1 for k=0,1,2….  Here we only see the case n=1, when the series converges in the unit disk and everywhere on the boundary except at the point z=1. The graphic on the left shows the complex values over the unit disk of a finite sum of terms of the series, on the right we see the values of the analytic function defined by the series. The modulus of the complex values of a function is represented by the height of the graph and the argument by colour. In the first graphic a shorter finite sum is used, in the second a longer. We can see the improvement in the approximation and the singular behaviour at z=1. We can also interactively choose any point on the unit disk and see the modulus of the difference between the values of the corresponding finite sum and the infinite series. Again, this is the sort of thing that would be very difficult to reproduce by other means.

1. Introduction and a survey_54.gif

The CDF Format and the CDF Player

With version 8 of Mathematica a new file format for Mathematica files was introduced.

The CDF player makes it easy to use Mathematica in class or at home even when students do not have Mathematica themselves. It is a free program that can be downloaded from Wolfram’s web site.
Wolfram CDF Player

Wolfram Alpha

Wolfram Alpha - Mathematica for everyone!

Wolfram Alpha received a great deal of publicity when it first appeared and it may even be better known than Mathematica, but not many people seem to realize that Wolfram Alpha is based on Mathematica and, in effect, provides the general public with free access to much of Mathematica’s functionality. Moreover, it does not require learning the Mathematica syntax. Indeed, the most famous aspect of Wolfram Alpha is its ability to use “free form” mathematical input - just type in what you want Wolfram Alpha to do for you in ordinary English (other language input is planned for the future) and Wolfram Alpha will attempt to guess what you want and then will use Mathematica to obtain the answer. In fact, the answers returned my Wolfram Alpha are generally more complete then Mathematica would normally return (they can all be obtained with Mathematica but it may require several commands or even some programming). Here is an example of computing the integral ?x log(x)dx with Wolfram Alpha. Just type: “indefinite integral of x log(x) “ and you will obtain the output shown below. In versions of Mathematica earlier than 8, a very precise syntax would be needed to obtain the same result (version 8 of Mathematica can also use “free form” input).

1. Introduction and a survey_55.gif