Hi Omer,
f[x_] := x^2;
j[x_] := D[f[x], x]
In the above, the definition of j uses SetDelayed ( := ). This means it will not evaluate the right side until the definition is used.
In[3]:= j[1]
During evaluation of In[3]:= General::ivar: 1 is not a valid variable. >>
So when we evaluate j[1], x is replaced by 1 in D[f[x],x] before the derivative is attempted, which does not work.
Below, Set rather than SetDelayed is used in the definition.
In[4]:= jj[x_] = D[f[x], x]
Out[4]= 2 x
In[5]:= jj[1]
Out[5]= 2
By using Set ( = ) rather than SetDelayed, the symbolic derivative is evaluated immediately and used as the definition.