When you do long calculations, it is often convenient to give names to your intermediate results. Just as in standard mathematics, or in other computer languages, you can do this by introducing named variables.
|x=value||assign a value to the variable x|
|x=y=value||assign a value to both x and y|
|x=. or Clear[x]||remove any value assigned to x|
It is very important to realize that values you assign to variables are permanent. Once you have assigned a value to a particular variable, the value will be kept until you explicitly remove it. The value will, of course, disappear if you start a whole new Wolfram Language session.
Forgetting about definitions you made earlier is the single most common cause of mistakes when using the Wolfram Language. If you set x=5, the Wolfram Language assumes that you always want x to have the value 5, until or unless you explicitly tell it otherwise. To avoid mistakes, you should remove values you have defined as soon as you have finished using them.
The variables you define can have almost any name. There is no limit on the length of their names. One constraint, however, is that variable names can never start with numbers. For example, x2 could be a variable, but 2x means 2*x.
The Wolfram Language uses both uppercase and lowercase letters. There is a convention that built‐in Wolfram Language objects always have names starting with uppercase (capital) letters. To avoid confusion, you should always choose names for your own variables that start with lowercase letters.
|aaaaa||a variable name containing only lowercase letters|
|Aaaaa||a built‐in object whose name begins with a capital letter|
|■ x y means x times y.|
|■ xy with no space is the variable with name xy.|
|■ 5x means 5 times x.|
|■ x^2y means (x^2) y, not x^(2y).|