Solved
StuartBruffAnswer
23-Emerald V
May 5, 2016
Forgot to add .. you'll need to vectorize your function, because the derivative operator only acts on scalars (and it's always safer to do so as there might be other unintended vector operations that occur, such as dot product rather than element-by-element multiplication).

Stuart

