A solution for nonlinear system of ode Solve the system $$x'=-x$$
$$y'=-2y+x^2$$
I see that if we hvae $x(0)=x_0,y(0)=y_0$, then $x=x_0e^{-t}$ and $y=y_0e^{-2t}+x^2=y_0e^{-2t}+x_0^2e^{-2t}$? is that true?
Also, is there a general way to solve any linear system  $x'=x,  y'=y+x^n$?.
 A: For $x$ your solution is correct.
$$y'=-2y+x(0)^2e^{-2t}$$
$$y'+2y=x(0)^2e^{-2t}$$
$$(ye^{2t})'=x(0)^2$$
$$ye^{2t}=x(0)^2t+c$$
$$y=e^{-2t}(\color{red}{x(0)^2t}+y(0))$$
A $t$ is missing in your solution for $y$.
A: Your second question
$$x'=x\qquad \text{and} \qquad  y'=y+x^n$$ is rather simple.
Solving for $x$ gives $x=c_1 e^t$; then, for $n\neq 1$
$$y'=y+x^n\implies y'=y+c_1^n e^{nt}\implies y=\frac{c_1^n }{n-1}\,e^{n t}+c_2 \,e^t$$
A: The system 
\begin{eqnarray}
x' &=& -x \\
y'&=&-2y+x^n
\end{eqnarray}
has a general solution
\begin{eqnarray}
x(t) &=& C_1 e^{-t} \\
y(t)&=&\frac{(C_1 e^{-t})^n}{2-n} + e^{-2t} C_2
\end{eqnarray}
where $C_1$ and $C_2$ are constants. We can determine those constants from the initial conditions $x(0)=x_0,y(0)=y_0$.
This is very easy to obtain. We first need to solve the first differential equation (which dependes only on x) and then plug the solution into the second equation. This is then easily solved by first solving  the homogeneous part and then guessing one particular solution (which is easy to do for this type of equation).
We see that the given solution does not apply to the case of n=2. So we need to do that case independently, although the procedure is pretty much the same. We get:
\begin{eqnarray}
x(t) &=& C_1 e^{-t} \\
y(t)&=&e^{-2t} t C_1^2 +e^{-2t} C_2
\end{eqnarray}
Again, we can determine  constants $C_1$ and $C_2$ from the initial conditions $x(0)=x_0,y(0)=y_0$.
