In [6]:
dw = derivative(f,w)
In [7]:
J = w-alpha*dw