<s>[INST] Solving $y'''-y=\frac{1}{3}\left(e^x+e^{wx}+e^{w^2x}\right)$ by power series I have the following differential equation
$$y'''-y=\frac{1}{3}\left(e^x+e^{wx}+e^{w^2x}\right)$$
where $w=e^{2i\pi/3}$
I am trying to solve by power series.  So let $y(x)=\sum_{n=0}^\infty a_n\frac{x^n}{n!}$.  Then $y'''(x)=\sum_{n=0}^\infty a_{n+3}\frac{x^n}{n!}$.  Also, as a power series, the RHS is $\sum_{n=0}^\infty \frac{x^{3n}}{(3n)!}$.  Setting them equal gives
$$\sum_{n=0}^\infty a_{n+3}\frac{x^n}{n!}-\sum_{n=0}^\infty a_{n}\frac{x^n}{n!}=\sum_{n=0}^\infty \frac{x^{3n}}{(3n)!}$$
After expansion of the first 3 terms, we have that $a_0=1, a_1=a_2=0$.  The remaining expansion therefore produces the following;
$$a_{3(n+1)}-a_{3n}=1$$
$$a_{3(n+1)+1}-a_{3n+1}=0$$
$$a_{3(n+1)+2}-a_{3n+2}=0$$
Now if $n=0,$ we have that $a_3-1=1\rightarrow a_3=2, a_4-0=0\rightarrow a_4=0, a_5-a_2=0\rightarrow a_2=0$.
Thus, we have that $a_{3k+1}=a_{3k+2}=0$ for all $k\in \mathbb{N}$.  Continuing then we have $a_6-a_3=1\rightarrow a_6=1+2=3.$  Using an induction argument we thus have $a_{3n}=n+1$.  Thus, the solution would be 
$$y(x)=\sum_{n=0}^\infty(n+1)\frac{x^{3n}}{(3n)!}$$
Is this a correct approach?
 [/INST] Indeed, the term with $x^n$ in the right-hand side is
$$
\frac{x^n}{3n!}(1+w^n+w^{2n})
$$
since $w^3=1$, writing $n=3q+r$, we have
$$
1+w^n+w^{2n}=1+w^r+w^{2r}
$$
If $r=0$, this equals $3$; if $r=1$ or $r=2$ this equals $0$.
The left-hand side is
$$
\sum_{n=0}^{\infty}(a_{n+3}-a_n)\frac{x^n}{n!}
$$
so we must have $a_{n+3}-a_{n}=0$ when $n$ is not a multiple of $3$ and $a_{n+3}-a_n=1$ otherwise.
This does not allow you to conclude that $a_n=0$ when $n$ is not divisible by $3$, but just that $a_{3n+1}=a_1$ and $a_{3n+2}=a_2$. Similarly, $a_0$ cannot be determined.
If we set $b_n=a_{3n}$, then the recurrence is $b_{n+1}=b_n+1$, so $b_n=a_0+n$. If we set $a_0=a$, $a_1=b$ and $a_2=c$, the final result is
$$
a_n=\begin{cases}
a+(n/3) & \text{if $n\equiv0\pmod{3}$} \\[4px]
b & \text{if $n\equiv1\pmod{3}$} \\[4px]
c & \text{if $n\equiv2\pmod{3}$}
\end{cases}
$$
Since you're given a third order differential equation, you have to expect three constants.
</s>