How to | Do Basic Calculations

The Wolfram Language serves as a convenient and extensible environment for doing basic math. In addition to performing advanced calculations, the Wolfram Language can also be used as a powerful calculator with arbitrary precision.

Add two numbers:

Subtract a number from another number:

Multiply two numbers by using * or a space:

Spaces between numbers, variables, or function values are interpreted as multiplication. The Wolfram System automatically shows a space between numbers with a multiplication symbol:

Multiply two complex numbers:

Divide two numbers:

The Wolfram Language follows the ordinary order of operations in algebraic calculations:

Compute the fifth power of 3:

Compute the square root of 25:

    

The Wolfram Language displays the results of calculations using integers, rational numbers, or variables in exact form:

Use N to get numerical results:

Adding a decimal to any number forces a numerical result:

This shows 40 significant digits:

    

Approximate using N:

Get 50 decimal places:

Calculate 50 significant digits of :

    

A large collection of common and well-known functions is built into the Wolfram Language.

Evaluate trigonometric functions:

Evaluate the natural logarithm of numbers:

Find the 125^(th) prime number:

Find the sum of the first billion positive integers:

    

Set a value to a variable by using =:

Display the value of sy:

Use sy in a calculation:

Define a function f:

Evaluate the function: