Suppose a multivariable polynomial of Nth degree is given by
$P(x,y)=\displaystyle\sum_{j=0}^{N}\sum_{i=0}^{j} a_{i,\,j-i}x^{i}y^{j-i}$.
I want to express this polynomial using Mathematica. In addition, It is of my interest compute its first and second derivatives.
My attempts:
Previously, I tried to study the derivatives of the $P(x,y)$ through a generator of polynomial using 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]
However, it looks like that this code only works when n is equal to some integer number, for example, n =2. Otherwise, I receive an error message.
Attached below, you may find my notebook with my attempts.
Based on the above,
- Is there another way to express the general form of $P(x,y)$ as presented above using Mathematica
- How may I express the $P(x,y)$ derivatives?
Thanks in advance
Attachments: