Random behaviour of Derivative(D[...]) with option "NonConstants"
I've found a partial answer to this. The documentation says:
D[f,v1,...,NonConstants->{u1,...}] specifies that every ui implicitly depends on every vj, so that they do not have zero partial derivative.
It seems the option is not designed to work with D[f,{{v1,...}},NonConstants->{u1,...}]
, i.e. gradients.
Still, this is pretty embarrassing considering there is no syntax error for this basic function and the behaviour is pretty random for different variable names. I spend like two days figuring out where my derivatives went missing.
It's probably a bug, but maybe someone has a better answer.
UPDATE: The Wolfram support has forwarded this issue to their developers, so it might be fixed in future versions.
possible workaround: Replace
D[f,{{v1,...}},NonConstants->{u1,...}]
by
Table[D[f,{{v1,...}}[[1,i]],NonConstants->{u1,...}], {i,1,Length[{{v1,...}}[[1]]]}]
and similar expressions for higher derivatives.
bug fixed in 11.1 Here is screen shot of both systems