How do I compute the taylor series for $(1+x+x^2)^\frac{1}{x}$ I tried rewriting $(1+x+x^2)^\frac{1}{x}$ as $e^{\frac{1}{x}\ln(1+x+x^2)}$ and then computing the taylor series of $\frac{1}{x}$ and $\ln(1+x+x^2)$ but I'm still not getting the correct answer..
 A: Note that $$f(x) = (1 + x + x^{2})^{1/x} = \exp\left(\frac{\log(1 + x + x^{2})}{x}\right) = \exp\left(\frac{\log(1 - x^{3}) - \log(1 - x)}{x}\right)$$ so that we can get the series $$\frac{\log(1 - x^{3}) - \log(1 - x)}{x} = \sum_{n = 1}^{\infty}\frac{x^{n - 1} - x^{3n - 1}}{n} = 1 + \frac{x}{2} - \frac{2x^{2}}{3} + \cdots$$ and we can exponentiate this to get $$(1 + x + x^{2})^{1/x} = e\cdot\exp(x/2 - 2x^{2}/3 + \cdots) = e\left(1 + \frac{x}{2} - \frac{13}{24}x^{2} + \cdots\right)$$ Note that the calculation of coefficients in general is complicated with no specific formula.
A: This appears to be the approach you used, but without seeing your work, it is hard to tell where you were having trouble.
Use the series $\log(1+x)=x-\frac{x^2}2+\frac{x^3}3+\cdots$
$$
\begin{align}
\frac1x\log\left(1+x+x^2\right)
&=\frac1x\left(x+x^2-\frac{x^2+2x^3+x^4}2+\frac{x^3+3x^4+3x^5+x^6}3+\cdots\right)\\
&=1+\frac12x-\frac23x^2+\cdots
\end{align}
$$
Then use the series $e^x=1+x+\frac{x^2}2+\cdots$
$$
\begin{align}
\left(1+x+x^2\right)^{1/x}
&=e^{1+\frac12x-\frac23x^2+\cdots}\\
&=e\left(1+\left(\frac12x-\frac23x^2+\cdots\right)+\frac12\left(\frac12x-\frac23x^2+\cdots\right)^2+\cdots\right)\\
&=e\left(1+\frac12x-\frac{13}{24}x^2+\cdots\right)
\end{align}
$$
A: HINT: a workaround following your way to see the problem is this: you want to write the Taylor series around $x=a$ of $$f(x):=\frac{\ln (1+x+x^2)}x$$
in terms of $$\frac1{1-z}=\sum_{k=0}^\infty z^k,\quad |z|<1\tag{1}$$
and
$$\ln(1+z)=\sum_{k=1}^\infty(-1)^{k+1}\frac{z^k}k,\quad|z|<1\tag{2}$$
Then you want to solve the equations
$$K_1+\ln(1+x+x^2)=\ln(1+z),\quad\frac{K_2}x=\frac1{1-z}$$
for $x\in(a-\delta,a+\delta)$ and $|z|<1$, for some $\delta>0$, for some constants $K_1$ and $K_2$. When you have done that then the Cauchy product of $(1)$ and $(2)$, as functions of $x\in(a-\delta,a+\delta)$, is well-defined, so you can try to find a simple expression for this Cauchy product.
Finally you can try to write the double series of the exponential function and the previous Cauchy product as a series in an unique index, what will be the Taylor series of your function around $x=a$ with radius of convergence $\delta$.
