Your First Wolfram Language Calculations

Type 2+2 and then press Shift+Enter (hold down the Shift key and press Enter) to tell the Wolfram Language to evaluate your input.

Note that labels are added automatically, and output is placed below the input.
In[1]:=
Click for copyable input
Out[1]=

Your first calculation will take longer than subsequent calculations because the Wolfram Language kernel has to start up.

You can use the Wolfram Language just like a calculator. Type the input 9.7^200 and press Shift+Enter. Here is the result.

A basic numerical calculation.
In[2]:=
Click for copyable input
Out[2]=

Here is an example from algebra. Type the input Factor[x^25-1] and note that as you type, the first bracket after the function name Factor has a special color until the closing bracket is typed.

A basic algebraic calculation.
In[3]:=
Click for copyable input
Out[3]=
You can use Greek letters or letters from other alphabets as variables.
In[4]:=
Click for copyable input
Out[4]=

You can recall your most recent input (or output) in your next evaluation by pressing Null (or Null).

The Wolfram Language uses syntax coloring to help you compose expressions that are complicated. As part of that, function names and variables that are known to the Wolfram Language kernel are colored black. New symbol names are by default colored blue, but turn black after being evaluated for the first time.

You can configure the syntax coloring system using the Syntax Coloring dialog box. To open the dialog box, choose Edit Preferences, click the Appearance tab, and then the Syntax Coloring tab.

Here are some more examples.

Integrate is just one of over a thousand built-in Wolfram Language functions.

Note that the variable of integration is specially colored in the input.
In[5]:=
Click for copyable input
Out[5]=

Plot3D produces a three-dimensional plot. The graphic appears directly in your notebook, and can be interactively rotated and zoomed in or out.

Note that the plotting variables are also specially colored.
In[6]:=
Click for copyable input
Out[6]=

You can get instant information about a built-in function. Type ?, the function name, and then press Shift+Enter.

In a notebook interface, ?function also gives a link to the documentation for function.
In[7]:=
Click for copyable input

To complete a partially typed command name, press Null. This is equivalent to Edit Complete Selection. To see a function template for a given function, press Null. This is equivalent to Edit Make Template.

To abort a calculation, press Null More options for controlling evaluation can be found under the Evaluation menu.

Some Wolfram Language Conventions

Here are some basic things to remember when working with the Wolfram Language:

Built-in functions are capitalized. Arguments to functions are wrapped with square brackets.
Sin[x]
Each of these represents multiplication.
a*b    a b    a(b+1)
2x means 2*x.
These are standard arithmetic operations.
2+3    2-3    2/3    2^3
Uppercase and lowercase letters are recognized as different characters. Lists are wrapped with curly brackets.
{a,b,B}
Built-in symbols are capitalized. Commas are used to separate arguments. A semicolon suppresses output, but the command is still evaluated.
N[Pi,50];
Variables are usually lowercase. Entire words can be used.
x=5    xvalue=3

Related Tutorials