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 /  Numerical Calculations /

2.3 Some Mathematical Functions

Mathematica TE includes a very large collection of mathematical functions. Here are a few of the common ones.

Some common mathematical functions.

Two important points about functions in Mathematica.

It is important to remember that all function arguments in Mathematica TE are enclosed in square brackets, not parentheses. Parentheses in Mathematica TE are used only to indicate the grouping of terms, and never to give function arguments.

This gives . Notice the capital letter for Sin, and the square brackets for the argument.

In[1]:= Sin[8.4]

Out[1]=

Just as with arithmetic operations, Mathematica TE tries to give exact values for mathematical functions when you give it exact input.

This gives as an exact integer.

In[2]:= Sqrt[16]

Out[2]=

This gives an approximate numerical result for .

In[3]:= N[ Sqrt[2] ]

Out[3]=

The presence of an explicit decimal point tells Mathematica TE to give an approximate numerical result.

In[4]:= Sqrt[2.]

Out[4]=

There is no exact result for , so Mathematica TE leaves the original form. This kind of "symbolic" result is discussed in Section 6.1.

In[5]:= Sqrt[2]

Out[5]=

Here is the exact integer result for . Computing factorials like this can give you very large numbers. You should be able to calculate up to at least 1000! in a reasonable amount of time.

In[6]:= 30!

Out[6]=

This gives the approximate numerical value of the factorial. Large numbers are written in scientific notation.

In[7]:= N[30!]

Out[7]=

You can get scientific notation for smaller real numbers, too.

In[8]:= ScientificForm[123456.]

Out[8]//ScientificForm=

Some common mathematical constants.

Notice that the names of these built-in constants all begin with capital letters.

This gives the numerical value of .

In[9]:= N[Pi ^ 2]

Out[9]=

This gives the exact result for . Notice that the arguments to trigonometric functions are always in radians.

In[10]:= Sin[Pi/2]

Out[10]=

This gives the numerical value of . Multiplying by the constant Degree converts the argument to radians.

In[11]:= N[ Sin[20 Degree] ]

Out[11]=

Log[x] gives logarithms to base .

In[12]:= Log[E ^ 5]

Out[12]=

You can get logarithms in any base b using Log[b, x]. As in standard mathematical notation, the b is optional.

In[13]:= Log[10, 1000]

Out[13]=