Power series solution for ODE

Since you just need a few terms, setting $$y=\sum_{n=1}^6 a_i x^i$$ (because of the condition $y(0)=0$) you could develop $e^y$ as a Taylor series around $x=0$ and get $$e^y=1+a_1 x+\frac{1}{2} \left(a_1^2+2 a_2\right) x^2+\frac{1}{6} \left(a_1^3+6 a_2 a_1+6 a_3\right) x^3+$$ $$\frac{1}{24} \left(a_1^4+12 a_2 a_1^2+24 a_3 a_1+12 a_2^2+24 a_4\right) x^4+$$ $$\frac{1}{120} \left(a_1^5+20 a_2 a_1^3+60 a_3 a_1^2+60 a_2^2 a_1+120 a_4 a_1+120 a_2 a_3+120 a_5\right) x^5+$$ $$\frac{1}{720} \left(a_1^6+30 a_2 a_1^4+120 a_3 a_1^3+180 a_2^2 a_1^2+360 a_4 a_1^2+720 a_2 a_3 a_1+720 a_5 a_1+120 a_2^3+360 a_3^2+720 a_2 a_4+720 a_6\right) x^6$$

Expanding the term $\frac{e^x-e^{-x}}{4}$ as a Taylor series too, the differential equation then write $$(a_1+1)+\left(a_1+2 a_2+\frac{1}{2}\right) x+\frac{1}{2} \left(a_1^2+2 a_2+6 a_3\right) x^2+\frac{1}{12} \left(2 a_1^3+12 a_2 a_1+12 a_3+48 a_4+1\right) x^3+$$ $$\frac{1}{24} \left(a_1^4+12 a_2 a_1^2+24 a_3 a_1+12 a_2^2+24 a_4+120 a_5\right) x^4+$$ $$\frac{1}{240} \left(2 a_1^5+40 a_2 a_1^3+120 a_3 a_1^2+120 a_2^2 a_1+240 a_4 a_1+240 a_2 a_3+240 a_5+1440 a_6+1\right) x^5+$$ $$\frac{1}{720} \left(a_1^6+30 a_2 a_1^4+120 a_3 a_1^3+180 a_2^2 a_1^2+360 a_4 a_1^2+720 a_2 a_3 a_1+720 a_5 a_1+120 a_2^3+360 a_3^2+720 a_2 a_4+720 a_6\right) x^6=0$$

Cancelling the coefficients lead to $$a_1=-1\qquad a_2=\frac{1}{4}\qquad a_3=-\frac{1}{4}\qquad a_4=\frac{7}{48}\qquad a_5=-\frac{19}{160}$$

I hope I did not make any mistake since my results do not coincide with DaveNine's answer.


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.