4
$\begingroup$

I'm having a problem with polynomials. Let's say I have a polynomial "2x^2 - 5x + 6 - 3x^2" .. How can I check that this expression is not simplified ? Additionally, I would like to locate the uncombined terms (2x^2 and -3x^2) and print them. I tried a lot of polynomial built-in functions, all of them simplify the expression before output.. For example,

MonomialList[2 x^2 - 5 x + 6 - 3 x^2]
{-x^2, -5 x, 6}

Is there any command to suppress automatic simplification ? Thanks.

$\endgroup$
  • 4
    $\begingroup$ List @@@ HoldForm[2 x^2 - 5 x + 6 - 3 x^2] or Cases[List @@@ HoldForm[2 x^2 - 5 x + 6 - 3 x^2], _ x^2, Infinity] $\endgroup$ – Artes Feb 19 '13 at 12:39
  • $\begingroup$ Great, thanks Artes. $\endgroup$ – John Feb 20 '13 at 12:07
2
$\begingroup$

Answered by Artes in a comment to the question.

You can use

List @@@ HoldForm[2 x^2 - 5 x + 6 - 3 x^2]

or

Cases[List @@@ HoldForm[2 x^2 - 5 x + 6 - 3 x^2], _ x^2, Infinity]
| 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.