I have a series which is expanded around $x=0$:

$$S=2 \sum_{n=0}^4 x^n (c_n\ln x+b_n)$$

where $ c_n=-\frac{1}{2}\left(\frac{(2n-1)!!}{2n!!}\right)^2$ and $b_n=-c_n\left(4 \ln 2+2\sum_{k=1}^n(\frac{1}{k}-\frac{2}{2k-1})+\frac{2}{2n-1}\right)$
I want to invert this series(i.e. x of series of function of S) using Mathematica, but it doesn't give me the result. How can I get this?

  c[n_] := -((1/2) ((2 n - 1)!!/(2 n)!!)^2/(2*n - 1));
    b[n_] := (-c[n])*(4*Log[2] + 2*Sum[1/k - 2/(2*k - 1), {k, 1, n}] + 
     2/(2*n - 1));
   S = Series[Sum[x^n (c[n] Log[x] + b[n]), {n, 0, 4}], {x, 0, 4}]
  • $\begingroup$ InverseSeries. $\endgroup$ Apr 9, 2018 at 22:46
  • $\begingroup$ Works for x=1 :InverseSeries[Series[Sum[x^n (c[n] Log[x] + b[n]), {n, 0, 4}], {x, 1, 4}]] $\endgroup$ Apr 9, 2018 at 22:47
  • $\begingroup$ I already tried with that, it didn't give the result. $\endgroup$
    – m. bubu
    Apr 9, 2018 at 22:49
  • $\begingroup$ but I need for X=0. $\endgroup$
    – m. bubu
    Apr 9, 2018 at 22:52
  • $\begingroup$ I have doubts about the question as the series is not a monotone function in $0<x<\infty$ $\endgroup$ Apr 10, 2018 at 10:17

2 Answers 2


You would like the series expansion of $x(S)$ around $x=0$, however $S$ is infinite at $x=0$ due to the presence of $\log(x)$, so you are effectively looking for an expansion at non-analytic point.

You can shift the singular point away from the origin for the expansion by using $\log(x+\epsilon)$ instead of $\log(x)$ and take the leading order term in $\epsilon$. With this, you can indeed directly use InverseSeries command, which gives

  Normal[Series[InverseSeries[Series[Sum[x^n (c[n] Log[x + \[Epsilon]]+ b[n]), {n, 0, 4}], {x, 0, 4}], S], {\[Epsilon], 0, 1}]]

$$\frac{\epsilon (-b(0)-c(0) \log (\epsilon )+S)^4}{24 c(0)^4}+\frac{\epsilon (-b(0)-c(0) \log (\epsilon )+S)^3}{6 c(0)^3}+\frac{\epsilon (-b(0)-c(0) \log (\epsilon )+S)^2}{2 c(0)^2}+\frac{\epsilon (-b(0)-c(0) \log (\epsilon )+S)}{c(0)}$$

At this point, if you take $\epsilon\to 0$, you get the result 0. However, you can think of this as if you are working with the function $x(S,\epsilon)$ instead of $x(S)\equiv x(S,\epsilon=0)$, and then take $\epsilon\to 0$ at the very end of your overall calculations.

By the way, notice that at leading order in $\epsilon$, only $n=0$ terms contribute.

More natural way to do this than the approach above is to consider the series expansion around a non-singular point, say $x=1$ as @Mariusz suggests.

One also observes same problem for similar cases; for example, if we replace $\log(x)$ with $e^{1/x}$, we get the same problem, and same approach, replacing $x$ with $x+\epsilon$ works there too.

Note that I am not taking into account how you deal with the branch cut: Depending on the specific problem at hand, you may prefer $\log(x\pm\epsilon)$ or even $\log(x\pm i \epsilon)$ for positive infinitesimal $\epsilon$.


I think you are interested in the behavior of x when S is near zero. If so, you can use the new in M12 function AsymptoticSolve. Here is your sum:

sum[x_] = Normal[S];
sum[x] //TeXForm

$\frac{5 x^4 (-210 \log (x)-473+840 \log (2))}{196608}+\frac{x^3 (-15 \log (x)-31+60 \log (2))}{1536}+\frac{1}{128} x^2 (-3 \log (x)-5+12 \log (2))+\frac{1}{8} x (4 \log (2)-\log (x))+\frac{1}{2} (\log (x)+2-4 \log (2))$

First we need to find the value of x when S is 0 (there are two solutions, so I arbitrarily pick the first):

rt = x /. First @ Solve[sum[x] == 0, x, Reals];
rt //InputForm
Root[{196608 - 393216*Log[2] + 98304*Log[2]*#1 - 7680*#1^2 + 18432*Log[2]*#1^2 - 
3968*#1^3 + 7680*Log[2]*#1^3 - 2365*#1^4 + 4200*Log[2]*#1^4 + 
Log[#1]*(98304 - 24576*#1 - 4608*#1^2 - 1920*#1^3 - 1050*#1^4) & , 1.00539774899781526543905294588054396717`20.60186555560688}]

Now, use AsymptoticSolve:

g[s_] = x /. First @ AsymptoticSolve[s == sum[x], {x, rt}, {s, 0, 5}] //N

1.0054 + 1.31037 s + 0.731207 s^2 + 0.36329 s^3 + 0.421708 s^4 + 0.600283 s^5

I used N because the unnumericized version is quite messy. Let's check:

Plot[{sum[g[s]], s}, {s, -1, 1}]

enter image description here

It looks like the approximation is pretty good for $-.5 < s < .5$.


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.