0
$\begingroup$

Suppose I have an expression like this one:

$\qquad x^2+4.4 y^2 + 5\ 10^2 x y$

How can I transform it into the following expression:

$\qquad \{x^2,\,y^2,\,x\,y \}$

$\endgroup$
0

1 Answer 1

4
$\begingroup$

Following the answer by @wuyingddg,

monomialList[poly_, vars_] := Times @@ (vars^#) & /@ CoefficientRules[poly, vars][[All, 1]]

f[x_, y_] = x^2 + 4*4*y^2 + 5*10^2*x*y;

monomialList[f[x, y], {x, y}]

{x^2, x y, y^2}

$\endgroup$
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.