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

Consider the following limit.

Limit[(a - Sqrt[a^2 + x])/(a^2 - a*Sqrt[a^2 - x]), x -> 0, Assumptions -> {a > 0}]

Mathematica gives -1/a, which is the correct answer. Notice that this limit is not trivial to compute, because both the numerator and denominator vanish when x=0. Therefore, L'Hopital's rule is required here.

Now remove the assumption.

Limit[(a - Sqrt[a^2 + x])/(a^2 - a*Sqrt[a^2 - x]), x -> 0]

For this, Mathematica gives 1/a, which is incorrect for general a (although it is correct for a<0).

Is this last result a bug, or am I missing something?

share|improve this question
By elementary algebra, the function is equivalent to -((a + Sqrt[a^2 - x])/(a (a + Sqrt[a^2 + x]))), so L'Hôpital's rule is not strictly necessary. – Michael E2 Feb 9 '14 at 19:00

This code should give you some insight as to why you are seeing this behavior:

Manipulate[Plot[(a - Sqrt[a^2 + x])/(a^2 - a*Sqrt[a^2 - x]), {x, -1, 1}], {a, -3, 3}]

When Assumptions -> {a > 0} is used, you get the correct limit. But when no assumptions are placed, Mathematica tries to evaluate the limit for a general complex $a$. This second result is not correct for $\Re(a) > 0$: The correct limit is $-1/a$ for $\Re(a) > 0$, and $1/a$ for $\Re(a) < 0$.

In general, limits whose values depend discontinuously on some parameter can be difficult for Mathematica to evaluate properly: see Calculating a limit with a result that is discontinuous in the parameters for example.

share|improve this answer
If the result depends on the parameters, then shouldn't Mathematica refuse to evaluate without additional assumptions, and just return Limit[...]? – Guy Gur-Ari Feb 9 '14 at 20:38

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.