I found that using Series and Normal command, I am able to approximate the first order of x or y, but If I also get rid of x*y (cross term), Series command does not work any more.
Let's define some arbitrary function for example.
f = 1/x + (x^2 y + 1)/(2 + x + x^2) + (y^2 + x)/x^2 + (x y + 1)/x^2
Series command
If I use Series function,
Series[Series[f, {x, 0, 1}], {y, 0, 1}] // Normal // Together
This will give me
(4 + 8 x + 2 x^2 - x^3 + 4 x y)/(4 x^2)
But I still have cross term but series command cannot get rid of cross term.
Series[%, {x*y, 0, 0}] // Normal // Together
Which does not know that it is cross term, and also I still have 2nd order
(4 + 8 x + 2 x^2 - x^3 + 4 x y)/(4 x^2)
By hand
(4 + 8 x )/(4 x^2)
=> 1/x^2 + 2/x
Ideal Result
Here is what I want to get, which results quite differently with previous approach.
Together[f]
This will give me
(2 + 5 x + 4 x^2 + 2 x^3 + 2 x y + x^2 y + x^3 y + x^4 y + 2 y^2 +
x y^2 + x^2 y^2)/(x^2 (2 + x + x^2))
Get rid of all the higher order term of x and y and cross term (Since the Denominator expands to 2 x^2 + x^3 + x^4, So I get rid of all the higher order so it will become 2 x^2,)
By hand
(2 + 5 x)/(2 x^2)
=> 1/x^2 + 5/(2 x)
So I have two question
- Why do I get different answer?
- How to do by hand part in MMA?
Series- you're not explaining what you tried, i.e., the code usingSeriesthat you said doesn't work. What are the small variables? Justx, or alsoy, or some combination of them? Are you expanding around zero? – Jens Apr 01 '16 at 15:512*y^2part in the numerator? From your desired result, I guess that you want to neglect it because its exponent (2) is larger than the smallest non-zero exponent belonging tox(1)? I do not have time to answer right now, will do that later if noone else does in the meantime. As a start for you: To get rid of crossterms, consider this:term/.x^(n___:1)*y^(n___:1)->0wheretermis some polynomial. – Lukas Apr 01 '16 at 16:25