Finding general solution for a nonhomogeneous system of equations I have a system of differential equations:
$\begin{cases} x_1'=x_2+2e^t \\
 x_2'=x_1+t^2 \end{cases}$
And I want to find the general solution for it.
I started by finding the general solution for the homogeneous equations:
$\begin{pmatrix}x_1 \\ x_2 \end{pmatrix}=C_1\begin{pmatrix}e^t+e^{-t} \\ e^t-e^{-t}\end{pmatrix}+C_2\begin{pmatrix}e^t-e^{-t} \\ e^t+e^{-t}\end{pmatrix}$.
Now I need to find a "specific" solution for the nonhomogeneous equations but I have problems applying the method in which I make constants $C_1$ and $C_2$ a variable. Could anyone help me with this part?
 A: System is equivalent with $$x_2=x_1'-2 e^t, x_2'=x_1+t^2$$ or $$x_2=x_1'-2 e^t, x_1''=x_1+t^2+2 e^t.$$
Firstly, by using a method of variations of constants, we will solve the second equation:
$$x_1''-x_1=t^2+2e^t,$$ (after that, it will be easy to determine $x_2$ from the first equation). Solution of homogenuous equation is $x_1=C_1 e^t+C_2 e^{-t}$, so we have to solve the following system:
$$C_1' e^t+C_2' e^{-t}=0,$$
$$C_1' e^t-C_2' e^{-t}=t^2+2 e^t,$$ 
where $C_1$, $C_2$ are functions of $t$. 
It is easy to get that
$$C_1'=1+\frac{t^2}{2}e^{-t},$$ $$C_2'=-e^{2t}-\frac{t^2}{2}e^{t},$$ from where we get
$$C_1(t)=C_1+t-\frac{e^{-t}}{2}(t^2+2t+2),$$ $$C_2(t)=C_2-\frac{e^{2t}}{2}-\frac{e^t}{2}(t^2-2t+2).$$
Finally, $$x_1=(C_1-\frac{1}{2})e^t+C_2 e^{-t}+t e^t-t^2-2,$$
$$x_2=(C_1-\frac{1}{2}) e^t-C_2 e^{-t}+(t-1) e^t-2 t.$$ 
A: If $x_1, x_2$ are your solutions to the homogeneous equation (it doesn't actually matter what they are), look for solutions to the inhomogeneous equation in the form $y_i = v_i x_i.$ If you try that, you will have simple equations for $v_1, v_2.$
A: \begin{align*}
x_1&=C_1\cosh t+C_2\sinh t+te^t+\frac{e^t}{2}-t^2-2\\
x_2&=C_1\sinh t+C_2\cosh t+te^t-\frac{e^t}{2}-2t
\end{align*}
