2
$\begingroup$

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

$\endgroup$
8
  • $\begingroup$ You do not have to rewrite this expression, MMA can handle that form. $\endgroup$ Commented Jul 10, 2013 at 7:56
  • $\begingroup$ @Kuba When I use 1/(1 + x^2/y^2) /. y -> 0 I get an error, infinite expression $\endgroup$ Commented Jul 10, 2013 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$ Commented Jul 10, 2013 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$ Commented Jul 10, 2013 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$ Commented Jul 10, 2013 at 9:18

2 Answers 2

4
$\begingroup$
 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) *) 
$\endgroup$
5
$\begingroup$

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] 1 

while

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

Coupling the two:

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

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.

$\endgroup$
2
  • $\begingroup$ @Penguin Dirk - I thought you should have elaborated! $\endgroup$ Commented Jul 10, 2013 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$ Commented Jul 10, 2013 at 13:48

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.