Consider the following example expression dependent on parameter t:

expr= t a ((t b+t c+ d )(t e+ f)+t g (t k+ l)+m (t n+ p));

This is a very short expression, which stands as an example for more complicated ones that are much larger, more nested and of higher overall degree in t.

Now I would like to take the limit:


However, instead of doing it using this function, I would like to manipulate expr/t^3 such as to cancel most t parameters without opening any brackets, so that we get:


a (( b+ c+ d/t )( e+ f/t)+ g ( k+ l/t)+m (n+ p/t)/t)

Now we can see that taking the limit amounts to just setting t->Infinity:


a ( e ( b+ c )+ g k)

We did not have to open any brackets and did not have to use Limit function. Is there a way to write an efficient myManipulate function that does this for arbitrarily more complicated (larger and more nested) input? Thanks for any suggestion!


1 Answer 1


You should recursively reshape the expression.

Rules below work with your example, though I expect they wouldn't with a more complicated one. You'd probably want to divide innermost polynomial by its order, not just linear power y.

divide[x_ /; Depth[x] <= 3] := Expand[x]

divide[Times[x_Plus, y : _^_?Negative]] := Expand[x y]

divide[Times[x__Plus, y_^p_?Negative]] :=
 Module[{n, k},
  n = Length[{x}];
  k = Min[n, -p];
  (Times @@ Join[
      Table[divide[z/y], {z, Take[{x}, k]}],
      Drop[{x}, k]])/y^Max[-p - n, 0]]

divide[Times[x_, y_Plus, z : _^_?Negative]] := 
 Times[x, divide[z #] & /@ y]


e1 = t a ((t b + t c + d) (t e + f) + t g (t k + l) + m (t n + p));

e2 = divide[e1/t^3]

a ((b + c + d/t) (e + f/t) + g (k + l/t) + m (p/t^2 + n/t))

e2 /. t -> Infinity

a ((b + c) e + g k)

  • $\begingroup$ This looks useful! I am not sure I understand all the syntax. Does it specialize on cases when two things (like your x and y) are multiplied and would require a further rule for three things or more? $\endgroup$
    – Kagaratsch
    Aug 12, 2016 at 13:24
  • $\begingroup$ @Kagaratsch Check ?divide, rules are tried in that order. First rule matched, first fired. You should think about expressions in their FullForm. $\endgroup$
    – BoLe
    Aug 12, 2016 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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