I have the following generic set of variables:

x = {x1, x2, ..., xn}
nu = {0, 1, 2, ..., n - 1}
order(nu) := Total @ nu;

I would like to calculate:

$$ \frac{\partial^{\operatorname{order}(v)}}{\partial_1^{\nu_1} \partial_2^{\nu_2} \dots \partial_n^{\nu_n}} $$

With a generic $x$. Indeed, I would like a function of this sort:

MyMixedDerivative[f,x_?VectorQ]:= ...


  • $\begingroup$ You might need Derivative. $\endgroup$ Jul 31, 2019 at 7:58
  • $\begingroup$ I tried this: but it does not seam to work out: testx = {x1, x2, x3}; testf[x1_, x2_, x3_] := x1^3 x2^2 x3^2 Derivative[Table[1, {i, 1, 3}]][testf[x1, x2, x3]] $\endgroup$ Jul 31, 2019 at 8:07
  • 1
    $\begingroup$ How about Derivative[Sequence @@ Table[1, {i, 1, 3}]][testf][Sequence @@ testx]? $\endgroup$ Jul 31, 2019 at 8:12
  • $\begingroup$ It doesn't perform the derivative. I really can't figure out why. $\endgroup$ Jul 31, 2019 at 8:14
  • $\begingroup$ It does. See my new comment. $\endgroup$ Jul 31, 2019 at 8:16

1 Answer 1


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.

  • $\begingroup$ The second part of your comment is inspiring. Thank you a lot. $\endgroup$ Jul 31, 2019 at 8:38
  • $\begingroup$ @MirkoAveta You are welcome. Actually, it is a new point to me, too :) $\endgroup$ Jul 31, 2019 at 8:50
  • 1
    $\begingroup$ In short, Derivative[] is supposed to inherit the argument structure of the function it is operating on. To give yet another example: Derivative[{1, 0}, {0}, 0][HypergeometricPFQ][{-2, 1/2}, {1}, 1/2] is equivalent to Derivative[1, 0, 0, 0][Hypergeometric2F1][-2, 1/2, 1, 1/2], since HypergeometricPFQ[{a, b}, {c}, x] == Hypergeometric2F1[a, b, c, x]. $\endgroup$ Aug 1, 2019 at 12:42
  • $\begingroup$ @J.M.isaway Thx for your comments. Yes, "to inherit" is an accurate and concise description. $\endgroup$ Aug 1, 2019 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.