a function is defined by
f(x)= 1 + 2x + x^2 +2x^3 + x^4 + ...
that is, its coefficients are c_2n = 1 and c_2n+1 = 2 for all n>=0
Find the interval of convergence of the series and find an explicit formula for f(x)
We have
$\displaystyle \begin{aligned}1+2x+x^2+2x^3+\cdots&=\sum_{n=0}^{\ infty}x^{2n}+2\sum_{n=0}^{\infty}x^{2n+1}\\
&=\sum_{n=0}^{\infty}\bigg[x^{2n}+2x^{2n+1}\bigg]\\
&=\sum_{n=0}^{\infty}(2x+1)x^{2n}\end{aligned}$
So applying the root test we get
$\displaystyle \begin{aligned}\lim_{n\to\infty}\sqrt[n]{(2x+1)x^{2n}}&=x^2\lim_{n\to\infty}\sqrt[n]{2x+1}\\
&=x^2<1\\
&\implies{|x|<1}\end{aligned}$
I think its pretty clear that this diverges at both endpoints, so we may conclude that the interval of convergence is $\displaystyle (-1,1)$. And if you are interested $\displaystyle \forall{x}\in(-1,1)\sum_{n=0}^{\infty}(2x+1)x^{2n}=\frac{2x+1}{1-x^2}$
Ratio test would also work. You could also note that $\displaystyle \sum_{n=0}^{\infty}x^{2n}+2\sum_{n=0}^{\infty}x^{2 n+1}$ are the sum of two geometric series, and that each is only convergent on $\displaystyle (-1,1)$, so the summation of them combined's IOC would be $\displaystyle (-1,1)\cup(-1,1)=(-1,1)$