TITLE: Power series solution for ODE
QUESTION [6 upvotes]: The ODE I have is $$y'(x)+e^{y(x)}+\frac{e^x-e^{-x}}{4}=0, \hspace{0.2cm} y(0)=0$$
I want to determine the first five terms (coefficients $a_0,\ldots, a_5$) of the power series solution $$y(x)=\sum_{k=0}^{\infty} a_kx^k$$ So far, I know that $$y'(x)=\sum_{k=1}^{\infty} a_kkx^{k-1}$$
Now I plug these back into the equation and get:
$$\sum_{k=1}^{\infty} a_kkx^{k-1} + e^{\sum_{k=0}^{\infty} a_kx^k} + \frac{e^x-e^{-x}}{4}=0$$. Now I'm not sure how to continue with this. Please help.

REPLY [2 votes]: The answers provided are excellent, but I'll offer what I think is the easiest solution: Just take derivatives of the equation, plug in $0$ and get as many $y^{(n)}(0)$'s as you want, then finally construct your taylor series: 
$$y=\sum_{n=0}^\infty \frac{y^{(n)}(0)}{n!}x^n.$$
$$y'+e^{y}+\frac{1}{2}\sinh(x)=0, \quad\quad y(0)=0$$
Plugging in $y(0)=0$, we get $y'(0)+1=0$, thus $\boxed{y'(0)=-1}$.
Now differentiate the original equation as many times as needed to get the number of coefficients that you want:
$$y''+y'e^y+\frac{1}{2}\cosh(x)=0$$
$$y'''+(y')^2e^y+y''e^y+\frac{1}{2}\sinh(x)=0$$
etc...
Plugging in $x=0$ into the above equations gives:
$$y''(0)+y'(0)e^{y(0)}+\frac{1}{2}\cosh(0)=0 \quad \Rightarrow \quad \boxed{y''(0)=\frac{1}{2}}$$
$$y'''(0)+(y'(0))^2e^y+y''(0)e^{y(0)}+\frac{1}{2}\sinh(0)=0 \quad \Rightarrow \quad \boxed{y'''(0)=-\frac{3}{2}}$$
Thus:
$$
\begin{aligned}
y&=y(0)+y'(0)x+\frac{1}{2!}y''(0)x^2+\frac{1}{3!}y'''(0)x^3+\cdots \\
&=-x+\frac{1}{2}\frac{1}{2!}x^2-\frac{3}{2}\frac{1}{3!}x^3+\cdots \\
&=-x+\frac{1}{4}x^2-\frac{1}{4}x^3+\cdots
\end{aligned}
$$
This method is nice because you don't have to work out recursion relations, etc.