I have some vector $K = [K_1, K_2,...K_n]$ which is a function of variables $(x,y)$ i.e. $K = K(x,y)$

I want to symbolically calculate the partial derivatives e.g. $\partial_x K$, $\partial_x \partial_y K$, $\partial_x^2 K$where I myself define the derivatives.

At the moment in my code I am thinking of each of the elements $K$ as a function and I can then define the derivative as e.g.

Derivative[1, 0][k1][x_, y_] := k1dx;

i.e. this defines $\partial_x K_1$ = k1dx. However, I am unsure how to scale this up in a neat, efficient way.

Ideally I want to be able to define the derivatives to be of the form $\partial_a K$ = [K1da, K2da,...Knda] and something analogous for the mixed or second derivatives.

Thanks in advance

  • $\begingroup$ Derivative[1, 0][k[i_]][x_, y_] := kdx[i]? $\endgroup$ – AccidentalFourierTransform Aug 20 '19 at 16:59
  • $\begingroup$ Within a Do loop you mean? $\endgroup$ – user1887919 Aug 21 '19 at 16:28

Your Answer

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

Browse other questions tagged or ask your own question.