Recently I got in a problem and I will try to explain with a simple example. I have an expression which reads :
y = (10 + 2*x )/x;
Now I want to substitute 1/x -> 0 . Now if I substitute directly in this expression the result is zero i.e.
y = (10 + 2*x )/x;
y /. {1/x -> 0};
Print[y];
Answer = 0 which should not be.
So I have to expand before substituting i.e.
y = (10 + 2*x )/x;
y1=Expand[y,x];
y1 /. {1/x -> 0};
Print[y1];
which gives me the correct answer = 2.
My question is, is there any efficient way (or another way) to do this work. This is because in case of 'y' has a very large expression or coefficient of 1/x is very complicated, Expand command is taking very very long time.
x->Infinity
? $\endgroup$Limit[y, x -> Infinity]
, which does yield2
. So doesFirst@Collect[y, x]
orCoefficient[y, x, 0]
. The last may be best, depending on your goal. $\endgroup$