*[Repost from MSE.](https://math.stackexchange.com/questions/4374009/a-series-expansion-of-a-function-at-a-non-differentiable-point)*


The function $x\mapsto (\frac{x}{1+x})^{x+x^2}$ is not differentiable in $0$, but nevertheless I'm interested in a series expansion at $0$. [Wolfram Alpha](https://www.wolframalpha.com/input?i=series%20of%20%28x%2F%281%2Bx%29%29%5E%28x%2Bx%5E2%29%20in%200) tells me it has the *Puiseux series* expansion


$$1 + x \log x + \mathcal O(x^2).$$


How do you compute this series expansion (or any "non-Taylor" Puiseux series expansion) over the reals?




---


It may be that the series expansion is easy to compute by making an educated guess first. If that is the case I'd prefer an answer without this "hindsight".


The [Wikipedia article](https://en.wikipedia.org/wiki/Puiseux_series) on Puiseux series has a strong algebraic focus related to polynomials, so I can't easily tell whether that information is really all the relevant to the case of real functions.


The [Mathworld article](https://mathworld.wolfram.com/PuiseuxSeries.html) on this topic is also very short. I wonder what the reason is that according to their definition (iterated) logarithms (as in the above example) can also appear, alongside fractional powers.



A series expansion of a function at a non-differentiable point
Let $$f(x)=\left(\frac{x}{1+x}\right)^{x+x^2}.$$
Expand first
$$g(x)=\log f(x)=(x+x^2)(\log x-\log(1+x))=x\log x+x^2\log x-x^2-\frac{1}{2}x^3-\ldots.$$
This has only two terms with $\log$, the rest are powers.
So powers of $g$ have the same property: they contain powers of $\log$ and ordinary powers. And then use
$$f=e^g=1+g+\frac{g^2}{2}+\frac{g^3}{6}+\ldots,$$
and substitute the series of $g$ to this series.


