I often end up with a function that contains the term $1/(1 + x^2/y^2)$, and I need to evaluate this in the limit $y\rightarrow 0$. By hand, I can rewrite this as $y^2/(y^2 + x^2)$, but how can I tell Mathematica to make such a simplification?

I have tried using 1/(1 + x^2/y^2) // Simplify and Expand, but neither work as intend (actually, they doesn't change anything).

  • $\begingroup$ You do not have to rewrite this expression, MMA can handle that form. $\endgroup$ – Kuba Jul 10 '13 at 7:56
  • $\begingroup$ @Kuba When I use 1/(1 + x^2/y^2) /. y -> 0 I get an error, infinite expression $\endgroup$ – BillyJean Jul 10 '13 at 7:58
  • 4
    $\begingroup$ How about Limit[1/(1 + x^2/y^2), y -> 0]? (you replace y, and thus divide by 0) $\endgroup$ – Pinguin Dirk Jul 10 '13 at 7:59
  • 2
    $\begingroup$ @PinguinDirk shouldn't it return some conditional result? Check Limit[1/(1 + x^2/y^2), y -> 0, Assumptions -> (x = 0)] $\endgroup$ – Kuba Jul 10 '13 at 8:59
  • $\begingroup$ @Kuba: good point! (maybe you want assumption x==0 (syntax)). Actually, I have no idea why Mathematica (and so did I) automatically assumes $x\neq0$. Maybe somebody else? $\endgroup$ – Pinguin Dirk Jul 10 '13 at 9:18
   expr = 1/(1 + x^2/y^2)

(*   1/(1 + x^2/y^2)  *)

Simplify[expr, ComplexityFunction -> (Count[#, _Power[_, -2]] &)]

(* y^2/(x^2 + y^2) *)

Like many limits involving two variables, this one is not as straightforward as it might seem. Consider

Limit[1/(1 + x^2/y^2), x -> 0]



Limit[1/(1 + x^2/y^2), y -> 0]


Coupling the two:

Limit[1/(1 + x^2/y^2) /. y -> x, x -> 0]


In other words, which direction you approach in x,y space is important to the limit. You can make this take almost any value between zero and one by choosing how the x,y are coupled. For example:

Limit[1/(1 + x^2/y^2) /. y -> 10 x, x -> 0]
Limit[1/(1 + x^2/y^2) /. y -> x/10, x -> 0]

give limits of 100/101 and 1/101. The same answers occur if the original form is replaced by the OPs simpler form, y^2/(x^2 + y^2).

There is a discussion of the use of generic solutions, which appears to be the reason that the first two give different answers: effectively the second is assuming that "generically" x is not zero. The tutorial doesn't explicitly mention Limit though presumably Solve is being used rather than Reduce (or at least, the methodology of Solve is being used rather than the methodology of Reduce) in terms of generic solutions.

  • $\begingroup$ @Penguin Dirk - I thought you should have elaborated! $\endgroup$ – bill s Jul 10 '13 at 13:39
  • $\begingroup$ @PinguinDirk Agree, almost because the thing is the first line shouldn't give us 1 without any assumptions. Also with, not bold at all, assumption that x and y are independent this limit[x,y] is the same as KronockerDelta[x], in values terms ofc. $\endgroup$ – Kuba Jul 10 '13 at 13:48

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.