Suppose f is a function for which f[2]=4 is already defined.
Let us redefine f and compute f[3];
In[53]:=
f[3]=8;
f[x_]:=x^3;
f[3]
Out[53]=
8
Let us redefine f to a new function and see what happens.
In[54]:=
f[a_]:= a+2;
f[3]
Out[54]=
8
In[55]:=
f[2]
Out[55]=
8
In[56]:=
f[5]
Out[56]=
125
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.
In[57]:=
Clear[f]
f[a_]:= a+2;
f[3]
Out[57]=
5
Up to Tutorial