Finding entire functions such that $g'(z)-g(z)=2\,z-z^2$ 
I am stuck on the following problem:
If $g(0)=-1$ and $g(z)\neq z^2, \forall{z}\in \mathbb{C}$,
  find all entire functions $g$ such that $$g'(z)-g(z)=2\,z-z^2$$ 

I can see that, since $g(z)\neq z^2$ then $g'(z)\neq 2\, z$, the equality does not look true.
 A: You can assume $g(z) = \sum_{n=0}^{+\infty} a_n z^n.$ Then your equation is $$\sum_{n=0}^{+\infty} (n+1)a_{n+1} z^{n} - \sum_{n=0}^{+\infty} a_n z^n =2z-z^2.$$ Now identify coefficients of same degree. You get $a_1-a_0 =0$ but $a_0=g(0)=-1$, hence $a_1 = -1$.
Then you get $2a_{2}-a_1 = 2$ hence $a_2 = 1/2$ and $3a_3-a_2 = -1$ hence $a_3 = -1/6.$ For the following coefficients you get a recurrence formula $$a_{n+1} = \frac{a_n}{n+1}.$$ You will easily find that $a_n = \frac{-1}{n!}$ for $n\geq 3$. Hence $$g(z) = -1-z+\frac{1}{2}z^2 + \sum_{n=0}^{+\infty} \frac{-z^n}{n!} =z^2-e^z.$$ Hence if your equation has a solution it is necessary $z^2-e^z.$ On the other side it is immediate to check that it is a solution. 
A: The equation is equivalent to
$$
\begin{align}
2z-z^2
&=g'(z)-g(z)\\
&=e^z\frac{\mathrm{d}}{\mathrm{d}z}\left(e^{-z}g(z)\right)
\end{align}
$$
Therefore,
$$
\begin{align}
g(z)
&=e^z\int\left(2z-z^2\right)e^{-z}\,\mathrm{d}z\\
&=e^z\left(z^2e^{-z}+C\right)\\
&=z^2+Ce^z
\end{align}
$$
A: Suppose $g$ is a solution and let $h(z) = g(z) - z^2$. Then $h'(z) - h(z) = 0$, hence $h(z) = c e^z$ for some constant $c \in \mathbb{C}$. It follows that $g(z) = z^2 + c e^z$. Now plug in $g(0) = -1$ to get $c = -1$, hence
$$g(z) = z^2 - e^z.$$
Moral of the story: just because you're studying complex analysis right now doesn't mean you should forget everything you learned about differential equations...
