# Define the partial derivatives of a multivariable function

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.

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