I have an example where Mathematica is not able to compute limits in a function restricted to assume that the input parameter is Real. I don't understand why this is so. 1. Could someone explain why this is a problem? 2. Is there a way to get around it, other than removing the restrictions on my function?

I would appreciate any help.

Here's the code:

blah3[x_] := -(1/32) x^4 Log[x^2/E^5.4076];
blah4[x_ /; x \[Element] Reals] := -(1/
    32) x^4 Log[x^2/E^5.4076];
Limit[-(1/32) x^4 Log[x^2/^E^5.4076], x -> 0]
Limit[blah3[Sin[x]], x -> 0]
Limit[blah4[Sin[x]], x -> 0]

The first two work, while the third limit evaluation does not.

Here's the context for the problem:

I'm trying to compare $$\int_0^\infty x^2 Log[1-E^{-\sqrt{\xi^2+x^2}}]$$ with its Taylor expansion, where the first few terms are given by $$-\frac{\pi ^4}{45}+\frac{\pi ^2 \zeta ^2}{12}-\frac{\pi \zeta ^3}{6}-\frac{1}{32} \zeta ^4 \log \left(\frac{\zeta ^2}{a_b}\right) + \ldots$$

To do this, I'm evaluating the former numerically and comparing against the latter approximation (of which blah3 and blah4 capture the part that is not easily calculable near $\xi = 0$). Just to ensure that I don't blindly trust results where things could go wrong (eg: $\xi^2 < 0$) I put in a condition that $\xi \in \mathbb{R}$ in my function definitions.

  • $\begingroup$ Seems, this is because everything is maintained in a symbolic form when calculating the limit. As functions such as Sin[x] are not something with head Real, the rule blah4[...] -> -(1/32)... does not apply. In fact even blah3[x] returns -1/32 x^4 Log[0.0048259 x^2] whereas blah4[x] stays unevaluated unless x is a variable with a specific real value. $\endgroup$
    – LLlAMnYP
    Apr 22, 2015 at 11:20
  • $\begingroup$ Maybe if you could explain the purpose of having the restrictions on your function, I could come up with an acceptable workaround. $\endgroup$
    – LLlAMnYP
    Apr 22, 2015 at 11:26

1 Answer 1


A conditional definition (using /;, that is) is not the same thing as a "Limit with assumptions", so far as Mathematica is concerned. To achieve that one does e.g. Limit[...,Assumptions->...]. To un derstand why, notice that, as written, blah4[Sin[x]] does not evaluate. So Limit can do nothing with it.

For your example, below is a form that Mathematica will be able to work with.

Limit[blah3[Sin[x]], x -> 0, Assumptions -> Element[x, Reals]]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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