Can you solve $y'+x+e^y=0$ by series expansion? 
Find an approximate solution by series expansion of $y(x)$ around $x =
0$ up to fourth order in $x$ given the inital conditions $y(0)=0$

Let 
$$
y=\sum_0^{\infty}a_nx^n \implies y'=\sum_0^{\infty}a_n nx^{n-1} \\ 
\implies \sum_0^{\infty}a_n nx^{n-1}+x+e^{\sum_0^{\infty}a_nx^n}=0
$$
Usually I would try to combine my terms but I can't do it here. Is this even the right approach?
 A: Yes, you can do it. We know $y(0)=0$. From the equation we get $y'(0)=-e^{y(0)}=-1.$ Derivate the equation:
$$
y''+1+e^y\,y'=0\implies y'(0)=0.
$$
Derivate once more to find $y'''(0)$ and still once more for $y''''(0)$.
There is another way of solving the equation. The term $y'+x$ suggests the change $z=y+x^2/2$. This changes the equation into an equation in separated variables.
A: Here is another way of solving the equation:
$$y'(x)+x+e^{y(x)}=0\Longleftrightarrow$$
$$\frac{\text{d}y(x)}{\text{d}x}+x+e^{y(x)}=0\Longleftrightarrow$$

Let $y(x)=\ln(v(x))$, which gives $\frac{\text{d}y(x)}{\text{d}x}=\frac{\frac{\text{d}v(x)}{\text{d}x}}{v(x)}$:

$$x+v(x)+\frac{\frac{\text{d}v(x)}{\text{d}x}}{v(x)}=0\Longleftrightarrow$$
$$\frac{\frac{\text{d}v(x)}{\text{d}x}}{v(x)}+x=-v(x)\Longleftrightarrow$$
$$-\frac{\frac{\text{d}v(x)}{\text{d}x}}{v^2(x)}-\frac{x}{v(x)}=1\Longleftrightarrow$$

Let $u(x)=\frac{1}{v(x)}$, which gives $\frac{\text{d}u(x)}{\text{d}x}=-\frac{\frac{\text{d}v(x)}{\text{d}x}}{v^2(x)}$:

$$\frac{\text{d}u(x)}{\text{d}x}-xu(x)=1\Longleftrightarrow$$

Let $\mu(x)=e^{\int -x\space\text{d}x}=e^{-\frac{x^2}{2}}$:

$$e^{-\frac{x^2}{2}}\frac{\text{d}u(x)}{\text{d}x}-\left(e^{-\frac{x^2}{2}}x\right)u(x)=e^{-\frac{x^2}{2}}\Longleftrightarrow$$

Substitute $e^{-\frac{x^2}{2}}x=\frac{\text{d}}{\text{d}x}\left(e^{-\frac{x^2}{2}}\right)$:

$$e^{-\frac{x^2}{2}}\frac{\text{d}u(x)}{\text{d}x}+\frac{\text{d}}{\text{d}x}\left(e^{-\frac{x^2}{2}}\right)u(x)=e^{-\frac{x^2}{2}}\Longleftrightarrow$$
$$\frac{\text{d}}{\text{d}x}\left(e^{-\frac{x^2}{2}}u(x)\right)=e^{-\frac{x^2}{2}}\Longleftrightarrow$$
$$\int\frac{\text{d}}{\text{d}x}\left(e^{-\frac{x^2}{2}}u(x)\right)\space\text{d}x=\int e^{-\frac{x^2}{2}}\space\text{d}x\Longleftrightarrow$$
$$e^{-\frac{x^2}{2}}u(x)=\sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+\text{C}\Longleftrightarrow$$
$$u(x)=e^{\frac{x^2}{2}}\left(\sqrt{\frac{\pi}{2}}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+\text{C}\right)\Longleftrightarrow$$
$$v(x)=\frac{2e^{-\frac{x^2}{2}}}{\sqrt{2\pi}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+2\text{C}}\Longleftrightarrow$$
$$v(x)=\frac{2e^{-\frac{x^2}{2}}}{\sqrt{2\pi}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+\text{C}}\Longleftrightarrow$$
$$e^{y(x)}=\frac{2e^{-\frac{x^2}{2}}}{\sqrt{2\pi}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+\text{C}}\Longleftrightarrow$$
$$y(x)=\frac{1}{2}\left(2\ln(2)-x^2-2\ln\left(\sqrt{2\pi}\text{erf}\left(\frac{x}{\sqrt{2}}\right)+\text{C}\right)\right)$$
With $\text{C}$ is an arbitrary constant.
A: By theorems on existence and uniqueness for analytic solutions of differential equations, the solution should be analytic at $0$, so there will be such an expansion.
Since $y(0) = 0$, the series starts $y(x) = a_1 x + \ldots$.
That would make $y'(x) = a_1 + \ldots$ and  $e^{y(x)} = 1 + y(x) + \ldots = 1 +  \ldots$, so the order $0$ expansion of your d.e. reads
$$ a_1 + 0 + 1 + O(x) = 0 $$
and $a_1 = -1$.  Now look at the next coefficient:
$$ \eqalign{y(x) &= -x + a_2 x^2 + \ldots \cr
            y'(x) &= -1 + 2 a_2 x + \ldots\cr
            e^{y(x)} &= 1 - x + \ldots\cr
            2 a_2 x & + x - x + O(x^2) = 0\cr} $$
so $a_2 = 0$.  Next:
$$\eqalign{y(x) &= -x + a_3 x^3 + \ldots \cr
       y'(x) &= -1 + 3 a_3 x^2 + \ldots \cr
       e^{y(x)} &= 1 + y(x) + \dfrac{y(x)^2}{2} + \ldots = 1 - x + \dfrac{x^2}{2} + \ldots\cr
3 a_3 x^2 & + \dfrac{x^2}{2} + O(x^3) = 0}$$
so $a_3 = - 1/6$.  
Etc.
