This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Some Mathematical Functions

Mathematica includes a very large collection of mathematical functions. "Mathematical Functions" gives the complete list. Here are a few of the common ones.
Sqrt[x]square root ()
Exp[x]exponential (ex)
Log[x]natural logarithm (logex)
Log[b,x]logarithm to base b (logbx)
Sin[x], Cos[x], Tan[x]trigonometric functions (with arguments in radians)
ArcSin[x], ArcCos[x], ArcTan[x]
inverse trigonometric functions
n!factorial (product of integers 1, 2, ..., n)
Abs[x]absolute value
Round[x]closest integer to x
Mod[n,m]n modulo m (remainder on division of n by m)
RandomReal[]pseudorandom number between 0 and 1
Max[x,y,...], Min[x,y,...]maximum, minimum of x, y, ...
FactorInteger[n]prime factors of n (see "Integer and Number Theoretic Functions")

Some common mathematical functions.

• The arguments of all Mathematica functions are enclosed in square brackets.
• The names of built-in Mathematica functions begin with capital letters.

Two important points about functions in Mathematica.

It is important to remember that all function arguments in Mathematica are enclosed in square brackets, not parentheses. Parentheses in Mathematica are used only to indicate the grouping of terms, and never to give function arguments.
This gives loge (8.4). Notice the capital letter for Log, and the square brackets for the argument.
In[1]:=
Click for copyable input
Out[1]=
Just as with arithmetic operations, Mathematica tries to give exact values for mathematical functions when you give it exact input.
This gives as an exact integer.
In[2]:=
Click for copyable input
Out[2]=
This gives an approximate numerical result for .
In[3]:=
Click for copyable input
Out[3]=
The presence of an explicit decimal point tells Mathematica to give an approximate numerical result.
In[4]:=
Click for copyable input
Out[4]=
Since you are not asking for an approximate numerical result, Mathematica leaves the number here in an exact symbolic form.
In[5]:=
Click for copyable input
Out[5]=
Here is the exact integer result for 3029...1. Computing factorials like this can give you very large numbers. You should be able to calculate up to at least 2000! in a short time.
In[6]:=
Click for copyable input
Out[6]=
This gives the approximate numerical value of the factorial.
In[7]:=
Click for copyable input
Out[7]=
Pi3.14159
Ee2.71828 (normally output as )
Degree/180: degrees-to-radians conversion factor (normally output as °)
I (normally output as )
Infinity

Some common mathematical constants.

Notice that the names of these built-in constants all begin with capital letters.
This gives the numerical value of 2.
In[8]:=
Click for copyable input
Out[8]=
This gives the exact result for sin (/2). Notice that the arguments to trigonometric functions are always in radians.
In[9]:=
Click for copyable input
Out[9]=
This gives the numerical value of sin (20). Multiplying by the constant Degree converts the argument to radians.
In[10]:=
Click for copyable input
Out[10]=
Log[x] gives logarithms to base e.
In[11]:=
Click for copyable input
Out[11]=
You can get logarithms in any base b using Log[b, x]. As in standard mathematical notation, the b is optional.
In[12]:=
Click for copyable input
Out[12]=