Suppose
$P(x,y)=\displaystyle\sum^{N}_{i+j=0}\alpha_{ij}x^{i}y^{i} \equiv \alpha_{00}+\alpha_{10}x+\alpha_{01}y+a_{11}xy+\ldots+a_{0N}y^{N}$
is a multivariable polynomial of $N$th degree. I want to express the first and second derivatives of $P(x,y)$ through Mathematica.
My attemps:
Previously, I attempted to study the derivatives of the above polynomial through the following code
poly[vars_List, a_, order_] := Module[{n = Length@vars, idx, z},
idx = Cases[Tuples[Range[0, order], n], x_ /; Plus @@ x <= order];
z = Times @@@ (vars^# & /@ idx);
z.((Subscript[a, Row[#]]) & /@ idx)]
poly[{x, y}, a, N] (*a is used for coefficient*)
.
However, it looks like that this code only works when N is equal to some integer number, for example N=2.
Based on the above, is there another way to express the general form of $P(x,y)$ and obtain its first and second derivatives?
Ps:I have read other posts, however, those did not help me.