0
$\begingroup$
   lst1 = {x1, 123, x1 + x2, x2^5, x3^2, 4 x1 - x2, 4/5, (x2 + x4)^2, 1/x4, 1/(x1 + x3)};

How can I pick up the some kind of multinomial from lst1 and get lst2 in a simple way,

lst2 = { x1 + x2, 4 x1 - x2, (x2 + x4)^2, 1/(x1 + x3)};
$\endgroup$
  • 2
    $\begingroup$ 1/(x1 + x3) is not a multinomial. Are you trying to filter expressions that depend on two or more variables? $\endgroup$ – J. M.'s technical difficulties Mar 30 '17 at 9:38
  • $\begingroup$ @J.M. Yes, that's the point. Thanks! $\endgroup$ – Orders Mar 30 '17 at 12:02
3
$\begingroup$

If the aim is to extract multivariate expressions:

Pick[lst1, Length[Variables@#] > 1 & /@ lst1]

or as per J.M.:

Select[lst1, Length[Variables@#] > 1 &]
|improve this answer|||||
$\endgroup$

Your Answer

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

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