0
$\begingroup$

Considering a rational function, as for example

myExpr=(x+3)(2+5x+6x^2)/(x(x-5)(x+20))

I would like to have a function that tells me the leading order behavior of myExpr under limits to infinity or to zero. Note that I am not interested in explicit coefficients and would like to save computational resources. All I need the function to return is:

LeadingOrder[myExpr,{x,0}]

-1

and

LeadingOrder[myExpr,{x,Infinity}]

0

I know there is a built in function that does this for polynomials Exponent[myPoly,x] when considering a limit to infinity. So I wonder if this can be done computationally efficiently for rational functions? Thanks for any suggestion.

$\endgroup$

1 Answer 1

2
$\begingroup$

Why not just

myExpr = (x + 3) (2 + 5 x + 6 x^2)/(x (x - 5) (x + 20));
Series[myExpr, {x, Infinity, 0}] // Normal
(* 6 *)
Series[myExpr, {x, 0, -1}] // Normal
(* -3/(50 x) *)

For this myExpr, Limit[myExpr, x -> Infinity] works as well.

For ratios of polynomials, as suggested by the OP in a comment, the following may be of use.

Exponent[Numerator[myExpr], x] - Exponent[Denominator[myExpr], x]
(* 0 *)

indicating that myExpr becomes constant for large x. And,

-(Exponent[Numerator[myExpr /. x -> 1/y], y] - 
  Exponent[Denominator[myExpr /. x -> 1/y], y])
(* -1 *)

indicating that myExpr varies as 1/x for small x.

$\endgroup$
4
  • $\begingroup$ Yes, I am aware of these functions. Unfortunately, they are too resource hungry for the application I need it for. (Calculating explicit coefficients or limit results is much more than what I am looking for - makes the functions slow.) Thus my question above. $\endgroup$
    – Kagaratsch
    Commented Dec 2, 2015 at 5:07
  • $\begingroup$ @Kagaratsch The solutions I gave are, of course, quite general. More efficient, special purpose solutions may be possible, but they would need to be tuned to specific classes of expressions. What sorts of expressions do you have in mind. $\endgroup$
    – bbgodfrey
    Commented Dec 2, 2015 at 5:10
  • $\begingroup$ As mentioned in the question, I have rational functions in mind. I don't think I could narrow it down more than that. $\endgroup$
    – Kagaratsch
    Commented Dec 2, 2015 at 5:12
  • $\begingroup$ The function in your edit works twice as fast as Series and is more universal. Thanks! $\endgroup$
    – Kagaratsch
    Commented Dec 2, 2015 at 5:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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