OK. If one looks at the documentation of Derivative
, it should be found that Derivative
accepts two arguments. The first is a Sequence
of orders of derivatives to be taken and the second is a Function
or a Symbol
representing a function, say f
. So when the order argument is passed to Derivative
, it should be destructured from a List
to a Sequence
:
testx = {x1, x2, x3}; testf[x1_, x2_, x3_] := x1^3 x2^2 x3^2;
Derivative[Sequence @@ Table[1, {i, 1, 3}]][testf][Sequence @@ testx]
which gives
12 x1^2 x2 x3
Moreover, if one digs deeper in the "Details" part of the documentation, s/he should find out that the above description of requirement is not quite accurate. The true requirement is to achieve a structure consistency between the order argument and the argument of f
. So below codes work as well
testf2[{x1_, x2_, x3_}] := x1^3 x2^2 x3^2;
Derivative[Table[1, {i, 1, 3}]][testf2][testx]
testf3[{x1_, x2_}, x3_] := x1^3 x2^2 x3^2;
Derivative[{1, 1}, 1][testf3][{x1, x2}, x3]
and other combinations of Sequence
and List
as the argument.
Derivative
. $\endgroup$Derivative[Sequence @@ Table[1, {i, 1, 3}]][testf][Sequence @@ testx]
? $\endgroup$