Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
You do not have to rewrite this expression, MMA can handle that form. – Kuba Jul 10 '13 at 7:56
@Kuba When I use 1/(1 + x^2/y^2) /. y -> 0 I get an error, infinite expression – BillyJean Jul 10 '13 at 7:58
How about Limit[1/(1 + x^2/y^2), y -> 0]? (you replace y, and thus divide by 0) – Pinguin Dirk Jul 10 '13 at 7:59
@PinguinDirk shouldn't it return some conditional result? Check Limit[1/(1 + x^2/y^2), y -> 0, Assumptions -> (x = 0)] – Kuba Jul 10 '13 at 8:59
@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? – Pinguin Dirk Jul 10 '13 at 9:18
up vote 4 down vote accepted
   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) *)
share|improve this answer

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.

share|improve this answer
+1! thanks for elaborating! – Pinguin Dirk Jul 10 '13 at 13:35
@Penguin Dirk - I thought you should have elaborated! – bill s Jul 10 '13 at 13:39
@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. – Kuba Jul 10 '13 at 13:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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