0
$\begingroup$

This question already has an answer here:

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

  1. Why do I get different answer?
  2. How to do by hand part in MMA?
$\endgroup$

marked as duplicate by Jens, MarcoB, RunnyKine, march, Öskå Apr 1 '16 at 18:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ How did you use Series - you're not explaining what you tried, i.e., the code using Series that you said doesn't work. What are the small variables? Just x, or also y, or some combination of them? Are you expanding around zero? $\endgroup$ – Jens Apr 1 '16 at 15:51
  • $\begingroup$ I cannot figure out what is the desired result. $\endgroup$ – Daniel Lichtblau Apr 1 '16 at 16:17
  • $\begingroup$ I modified the question to make it clear. I am sorry for confusing question. @DanielLichtblau $\endgroup$ – Saesun Kim Apr 1 '16 at 16:20
  • $\begingroup$ I modified the question to make it clear. I am sorry for confusing question. @Jens $\endgroup$ – Saesun Kim Apr 1 '16 at 16:25
  • $\begingroup$ what happend to the 2*y^2 part 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 to x (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)->0 where term is some polynomial. $\endgroup$ – Lukas Apr 1 '16 at 16:25
3
$\begingroup$

I suspect that your "by hand" math is wrong. Here is what you get when doing a consistent first-order expansion:

expr = (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));

Normal[
  Series[expr /. {x -> ϵ x, y -> ϵ y}, {ϵ, 0, 1}]] /. ϵ -> 1

$$\frac{y^2}{x^2}+\frac{1}{x^2}+\frac{y}{x}-\frac{x}{4}+\frac {2}{x}+\frac{1}{2}$$

$\endgroup$
  • $\begingroup$ Thank you for the help, but when I combine together, (4 + 8 x + 2 x^2 - x^3 + 4 x y + 4 y^2)/(4 x^2) I still have cross term. and second order on top. $\endgroup$ – Saesun Kim Apr 1 '16 at 16:36
  • $\begingroup$ Oh, Sorry, I guess I can just separate , numerator and denaminator again and do the series $\endgroup$ – Saesun Kim Apr 1 '16 at 16:37

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