I have the following problem in Mathematica 9 on Linux. I let Mathematica compute the Series expansion:

Block[{$Assumptions = {r, p}\[Element] Reals}, 
      Series[Log[r^2 - Sqrt[r^4 + p^2]], {p, 0, 0}]

But the output is a rather disappointing naked infinity:

Log[r^2 - Sqrt[r^4]] + O[p]^1

Similarly, for:

Block[{$Assumptions = {p, r} \[Element] Reals}, 
      Series[1/(r^2 - Sqrt[r^4 + p^2]), {p, 0, 0}]

I get:

1/(r^2 - Sqrt[r^4]) + O[p]^1

Why is Mathematica handing me naked infinities like that, even though I specified that the computation is to be carried out in the real numbers? What do I do wrong? How can I avoid this?


To make my point more clear, I would expect the Series to give results like $$\log(c_1 p^2)+O(p^1)$$ and $$\frac{1}{c_2 p^2}+O(p^1)$$ as a regulated infinity, instead of $\log(0)$ and $\frac{1}{0}$.

  • $\begingroup$ Are you disappointed about the output or do you think it's not correct ? $\endgroup$ Commented Mar 5, 2013 at 11:17
  • $\begingroup$ I am disappointed, since the Series function should give a regulated infinity, like $\frac{1}{p^2}$ or something, instead of a mathematically nonsensical $\frac{1}{0}$. $\endgroup$
    – Kagaratsch
    Commented Mar 5, 2013 at 11:19
  • $\begingroup$ I have been told, that as a quick solution one can substitute r by ie Zeta[5]. Any zeta of odd numbers greater than 1 will do. After the expansion is done one simply has to substitute back. $\endgroup$
    – Kagaratsch
    Commented Mar 5, 2013 at 14:11
  • $\begingroup$ Not a full-fledged answer, Mathematica's behaviour still puzzles me, but something that may point you in the right direction: you do get the expected result if you assume r>0 && p>0. The assumption r<0 && p>0 works too, but (r<0 || r>0) && p>0 does not... $\endgroup$ Commented Mar 5, 2013 at 14:42
  • 2
    $\begingroup$ It looks like some time between 12.0.1 and 12.3.1 Mathematica started returning your desired results. $\endgroup$
    – Carl Woll
    Commented Apr 20, 2023 at 22:30

2 Answers 2


The answer is very simple, mathematically: Series is a central instrument in complex analysis and has no real version. The series aquired formally e.g. by using Taylors formula, if all derivatives are computable, defines a complex analytic function in an open circle in the complex plane, that touches the nearest singularity anywhere, where the series diverges.

Standard example is the function


that has a geometric series representation. f[z_]:= Sum[x^(2n) ,{n,0,oo}] | z | < 1

Here the nearest singularities are simple poles in the points z= +-I, while along the real axis the function is perfectly smooth. But smoothness on the real axis does not yield a series , representationas the this classical example is showing:

x-> Exp[-1/x^2]  \el {0,1}

is a real function with all derivatives 0 at x=0. The function has a real power series

sum 0 z^n. 

The reason is that for z on the imaginary axis there is no value at z->0. The real line as a smooth path through the complex hell at z=0

ComplexPlot3D[ Exp[-1/z^2], {z, -(1 + 0.2 I), (1 + 0.2 I)} , 
       PlotRange -> {0, 50}, ViewPoint -> {7, 1, 5}, ImageSize -> 220]

essential singularity

  • $\begingroup$ You have "Series" as the first word in a sentence, so I do not know if you mean Taylor series in general, or the Mathematica function Series. If the latter, the rest is not really accurate, because it takes assumptions that are intended to allow for Piecewise or other conditional results. Series also tries to provide results that behave on branch cuts, results with asymptotic terms and various other extensions to basic Taylor series. $\endgroup$ Commented Apr 21, 2023 at 15:23

Try the following code:

ClearAll[r, p];
Log[r^2 - Sqrt[r^4 + p^2] + O[p]^3 //PowerExpand]
(* Log[-p^2/(2*r^2)] + O[p]^1 *)

Note the use of PowerExpand last updated in version 6.0.


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.