This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
Wolfram Research, Inc.

Mathematica and Your Computing EnvironmentMathematica as a Programming Language

The Unifying Idea of Mathematica

Mathematica is built on the powerful unifying idea that everything can be represented as a symbolic expression.

All symbolic expressions are built up from combinations of the basic form:

A list of elements

An algebraic expression

An equation

A logic expression

A command


Abstract mathematical notation

A button

A cell in a notebook

A cell containing text

The uniformity of symbolic expressions makes it easy to add to Mathematica any construct you want.

A chemical compound

An electric circuit

All operations in Mathematica are ultimately transformations of symbolic expressions. Mathematica has a uniquely powerful pattern matcher for applying transformation rules.

The /. tells Mathematica to apply the simple transformation rule bRule1+x.

x_ and y_ each stand for any expression, so the pattern x_+y_ stands for a sum of terms.

Mathematica uses patterns to generalize the notion of functions.

This is an ordinary function definition to be used for any x.

Here is a special case that overrides the general definition.

Here is an example of the use of f.

This clears the definitions given for f.

An important feature of using patterns is that they allow "functions" to take arguments in any structure.

This defines a value for g with an argument that is a list of two elements.

This specifies the value for the "function" area when given a Circle object as an argument.

This implements a logic reduction rule.

Mathematica and Your Computing EnvironmentMathematica as a Programming Language