# Peculiarities with Series and fractional exponents or bug?

The documentation of the Series[] function states that it can handle "certain expansions involving negative powers, fractional powers, and logarithms." What are the conditions that dictate whether a function falls into this class of "certain expansions?"

As impetus for this concern, I've shown a peculiarity found in using Series in conjunction with fractional powers below. Can this be explained in any way other than as a bug?

A contrived MWE where one finds the leading order expansion of $f(1+2\epsilon+5\epsilon^{3/2})$ about the point $\epsilon=0$:

In[1]:= Series[f[1 + 2 ϵ + 5 ϵ^(3/2)], {ϵ, 0, 0}]
Out[1]= SeriesData[ϵ, 0, {f[1]}, 0, 1, 2]


which works as it should. However, turning this into a multivariable function $f(1+2 \epsilon+5\epsilon^{3/2},x)$, Series can no longer returns the correct SeriesData.

In[2]:= Series[f[1 + 2 ϵ + 5 ϵ^(3/2), x], {ϵ, 0,0}]
Out[2]= f[1, x] + Derivative[1,0][f][1,x]


This sort of error does not occur when fractional exponents are absent in the argument of $f$. Why does this occur, and can it be prevented without completely avoiding expressions such as the one found above?

This honestly seems like a bug to me, but I think it's not entirely due to fractional exponents. To see why, get rid of the fractional exponents by setting ϵ=e^2 and finding Series[f[1 + 2 ϵ + 5 ϵ^(3/2), x], {e, 0, 0}] around e=0 instead of ϵ=0. We see Derivative[1,0][f][1,x] disppears from the output, but the output still lacks the SeriesData head and thus the O[e].

The following tests on arguments with only integer exponents suggest the SeriesData head gets lost when the smallest exponent greater than 0 is larger than 1, but smaller than the series order:

Series[f[e, x], {e, 0, 0}]


SeriesData[e, 0, {f[0, x]}, 0, 1, 1]

Table[Series[f[e^2, x], {e, 0, n}], {n, 0, 3}]


{f[0, x], f[0, x], SeriesData[e, 0, {f[0, x], 0, Derivative[1, 0][f][0, x]}, 0, 3, 1], SeriesData[e, 0, {f[0, x], 0, Derivative[1, 0][f][0, x]}, 0, 4, 1]}

Table[Series[f[e^3, x], {e, 0, n}], {n, 0, 3}]


{f[0, x], f[0, x], f[0, x], SeriesData[e, 0, {f[0, x], 0, 0, Derivative[1, 0][f][0, x]}, 0, 4, 1]}

For f[1 + 2 ϵ + 5 ϵ^(3/2), x], the smallest such exponent of ϵ=e^2 is 2, so the SeriesData head is lost, when expanding to order 0 in e. As expected, the head is recovered when expanding to order 2 or more. Likewise, Series[f[1 + 2 ϵ^(1/2) + 5 ϵ^(3/2), x], {e, 0, 0}] is ok because the smallest exponent of e is 1.

Going back to arguments with fractional exponents, I had expected the same rule to apply to the argument obtained from a change of variables to eliminate fractional exponents. Alas, that is not exactly the case. Clear[ϵ] and Series[f[1 + 2 ϵ + 5 ϵ^(3/2), x], {ϵ, 0, 1}] is still wrong, even though this is equivalent to Series[f[1 + 2 e^2 + 5 e^3, x], {e, 0, 2}]. However, Series[f[1 + 2 ϵ^(1/2) + 5 ϵ^(3/2), x], {ϵ, 0, 0}] is fine, as when ϵ was set to e^2.

These observations have led me to the following fix - add a term to have exponent 1 under change of variables to an argument with only integer exponents, and set this term to 0 after the Series expansion. In this case:

Series[f[a ϵ^(1/2) + 1 + 2 ϵ + 5 ϵ^(3/2), x], {ϵ, 0, 0}] /. a->0


SeriesData[[Epsilon], 0, {f[1, x]}, 0, 1, 2]

This solution requires knowing the appropriate change of variables - I'm not sure if this is always the one minimizing the resulting polynomial order. Therefore, the more robust solution is to delay using multivariate functions until after Series by e.g.

 Series[f[1 + 2 ϵ + 5 ϵ^(3/2)], {ϵ, 0, 0}] /.
{f[y_] -> f[y, x], Derivative[i_][f][y_] -> Derivative[i, 0][f][y, x]}