Some Mathematical Functions

The Wolfram Language includes a very large collection of mathematical functions. "Mathematical Functions" gives the complete list. Here are a few of the common ones.

Some common mathematical functions.

Two important points about functions in the Wolfram Language.

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

This gives (Subscript[log, e])(8.4). Notice the capital letter for (RefLink[Log, paclet:ref/Log]), and the square brackets for the argument:

Log[8.4]

Just as with arithmetic operations, the Wolfram Language tries to give exact values for mathematical functions when you give it exact input.

This gives (Sqrt[16]) as an exact integer:

Sqrt[16]

This gives an approximate numerical result for (Sqrt[2]):

Sqrt[2]//N

The presence of an explicit decimal point tells the Wolfram Language to give an approximate numerical result:

Sqrt[2.]

Since you are not asking for an approximate numerical result, the Wolfram Language leaves the number here in an exact symbolic form:

Sqrt[2]

Here is the exact integer result for 30×29×...×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:

30!

This gives the approximate numerical value of the factorial:

30!//N

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):

Pi^2//N

This gives the exact result for sin(π/2). Notice that the arguments to trigonometric functions are always in radians:

Sin[Pi/2]

This gives the numerical value of sin((20^◦)). Multiplying by the constant (RefLink[Degree, paclet:ref/Degree]) converts the argument to radians:

Sin[20 Degree]//N

(RefLink[Log, paclet:ref/Log])[x] gives logarithms to base e:

Log[E^5]

You can get logarithms in any base b using (RefLink[Log, paclet:ref/Log])[b,x]. As in standard mathematical notation, the b is optional:

Log[2,256]