Skip to main content
3 of 3
deleted 13 characters in body; edited title
E. Chan-López
  • 34.3k
  • 3
  • 38
  • 55

Ignore higher order terms in an expression

I am trying to ignore terms that are higher order (third or more) in an expression. For example, for the input function:

$$f_{in}= \alpha\beta + \alpha^2 + \beta^2 + \alpha\beta^2/2 + \alpha^2 \beta $$

I would like the output function to be

$$f_{out}= \alpha\beta + \alpha^2 + \beta^2$$

To this end, I defined the rule:

rule = α^i_*β^j_ :> 0 /; (i + j) > 2;

but it doesn't seem to do the trick. Is there a simple fix?

Arnab
  • 123
  • 4