This link answers the question on how to express the derivative of a function with an arbitrary number of variables. However, what if I wanted the gradient? More specifically, if
f[x1,...,xn] is a given function where
n may vary, then how would I express its gradient? I could alway do a
Do loop, but is there an easier way?
More specifically, I would like a function
F[f_,n_] that has
f and the number of arguments
n of function
f as inputs.
F[f_,n_] should output the gradient of