# How to neglect some part of an expression

I have an expression of the form $a\,x^3 + b\,x^2 + c\,x$ in my answer. I want to avoid those terms in my answer of order 1, but want to keep those of order > 1 in $x$. Can you suggest how to do in Mathematica 8?

• Can we see the actual Mathematica expression from which you want to delete the terms of order < 2? Post the code by editing your question, not by making a comment. Sep 24, 2015 at 11:20

You don't say explicitly how you want to handle terms of order zero. Assuming that these are also to be discarded

expr = a x^3 + b x^2 + c x + d;

minOrder = 2;
coefList = CoefficientList[expr, x];
lenCoefList = Length[coefList];

Expand[(Expand[x*expr] /. ((x^n_ /; n > minOrder) -> $t^n) /. {x -> 0,$t ->
x})/x]

(*  b x^2 + a x^3  *)

Subtract @@ ((Series[expr, {x, 0, # - 1}] // Normal) & /@ {lenCoefList,
minOrder})

(*  b x^2 + a x^3  *)

ReplacePart[coefList,
Thread[Range[minOrder] -> 0]].x^Range[0, lenCoefList - 1]

(*  b x^2 + a x^3  *)

Nest[Integrate[#, x] &, D[expr, {x, minOrder}], minOrder]

(*  b x^2 + a x^3  *)


EDIT:

To include the constant term, add Coefficient[expr, x, 0] to any other solution. This will work whether this coefficient is symbolic, numeric, or any combination.

• I like the differentiate-integrate one. Sep 24, 2015 at 16:59
• I want to neglect only "cx" term...other constants in x are remain as it is... Sep 25, 2015 at 12:14
Normal@Series[your expression,{x,0,1}]

• No no dear, I want to neglect that part not to collect them. This can be same as "Collect[%,{x}]"....Have any idea...Or I may be wrong ? what does {x,0,1} represents, one by one please... Sep 24, 2015 at 11:37
• You could use Series this way: Normal@Series[a x^3 + b x^2 + c x + d /. x -> 1/x, {x, 0, -2}] /. x -> 1/x Sep 24, 2015 at 17:05
• Hi Yohbs,Thank you somuch Oct 2, 2015 at 9:15