The Clear command

An important feature of Mathematica is that it remembers the values of variables
and definitions of functions throughout the session. This can be a problem when the
same names are used again, because Mathematica will use the old values. You can
remove the values and names from Mathematica's memory by using the Clear command.
It is important to do this, as Mathematica will not compute a new value for a function
that is stored in memory. Not clearing names is the most frequent source of erroneous
results in Mathematica programs. Consider the following example.

Suppose f is a function for which f[2]=4 is already defined.

Let us redefine f and compute f[3];


  f[3]=8;
  f[x_]:=x^3;
  f[3]


Let us redefine f to a new function and see what happens.


  
  f[a_]:= a+2;
  f[3]


  f[2]


  f[5]

The redefinition does not effect the values of the function. For this, it is necessary to clear
all the values if the function. It is best to place the clear statement before the definition
of a function. This way, if you make changes to the function, then the function is cleared
before the changes are entered and all values will be computed again.


  Clear[f]
  f[a_]:= a+2;
  f[3]

Up to Tutorial