I would like to assume that $x$ is small so that values of the order $x^2$ (and higher orders) are negligible.

For example, I would like Mathematica to return $1-2m$ when I ask it to simplify $(1-x)^2$. Something like


closed as off-topic by QuantumDot, user9660, RunnyKine, m_goldberg, LLlAMnYP Apr 28 '16 at 16:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – QuantumDot, Community, RunnyKine, m_goldberg, LLlAMnYP
If this question can be reworded to fit the rules in the help center, please edit the question.


You can use a conditional replacement rule to set any power of x higher than 1 to zero:

simp[expr_, x_] := ExpandAll[expr] /. {Power[x, a_] /; a > 1 -> 0}

simp[(1/x - 3 x + 4 - x)^4, x]
simp[(1 - x)^2, x]
(* -416 + 1/x^4 + 16/x^3 + 80/x^2 + 64/x - 256 x *)
(* 1 - 2 x *)

Of course, the easy way to do it would be to just take the Series and convert the answer to Normal form,

Series[(1/x - 3 x + 4 - x)^4, {x, 0, 1}] // Normal
(* -416 + 1/x^4 + 16/x^3 + 80/x^2 + 64/x - 256 x *)

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