Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  The Teacher's Book /  Basic Calculations /  Algebra /

6.1 Symbolic Computation

One of the most important features of Mathematica TE is that it can do symbolic, as well as numerical calculations. This means that it can handle algebraic formulas as well as numbers.

Here is a typical numerical computation.

In[1]:= 3 + 62 - 1

Out[1]=

This is a symbolic computation.

In[2]:= 3x - x + 2

Out[2]=

Numerical and symbolic computations.

You can type any algebraic expression into Mathematica TE. The expression is printed out in an approximation to standard mathematical notation.

In[3]:= -1 + 2x + x^3

Out[3]=

Mathematica TE automatically carries out standard algebraic simplifications. Here it combines and to get .

In[4]:= x^2 + x - 4 x^2

Out[4]=

You can type in any algebraic expression, using the operators listed on Section 2.1. You can use spaces to denote multiplication. Be careful not to forget the space in x y. If you type in xy with no space, Mathematica TE will interpret this as a single symbol, with the name xy, not as a product of the two symbols x and y.

Mathematica TE rearranges and combines terms using the standard rules of algebra.

In[5]:= x y + 2 x^2 y + y^2 x^2 - 2 y x

Out[5]=

Here is another algebraic expression.

In[6]:= (x + 2y + 1)(x - 2)^2

Out[6]=

The function Expand multiplies out products and powers.

In[7]:= Expand[%]

Out[7]=

Factor does essentially the inverse of Expand.

In[8]:= Factor[%]

Out[8]=

When you type in more complicated expressions, it is important that you put parentheses in the right places. Thus, for example, you have to give the expression in the form x^(4y). If you leave out the parentheses, you get instead. It never hurts to put in too many parentheses, but to find out exactly when you need to use parentheses, look at Section A2.

Here is a more complicated formula, requiring several parentheses.

In[9]:= Sqrt[8]/9801 (4n)! (1103 + 26390 n) /
(n!^4 396^(4n))

Out[9]=

When you type in an expression, Mathematica TE automatically applies its large repertoire of rules for transforming expressions. These rules include the standard rules of algebra, such as , together with much more sophisticated rules involving higher mathematical functions.

Mathematica TE uses standard rules of algebra to replace by .

In[10]:= Sqrt[1 + x]^4

Out[10]=

Mathematica TE knows no rules for this expression, so it leaves the expression in the original form you gave.

In[11]:= Sqrt[1 + Cos[x]]

Out[11]=

The notion of transformation rules is a very general one. In fact, you can think of the whole of Mathematica TE as simply a system for applying a collection of transformation rules to many different kinds of expressions.
The general principle that Mathematica TE follows is simple to state. It takes any expression you input, and gets results by applying a succession of transformation rules, stopping when it knows no more transformation rules that can be applied.

The fundamental principle of Mathematica.