I need help solving a ODE converting it to system of linear different equations $y'''+4y''+5y'+2y=10cos(t)$ 
Where it is subject to a condition
$y''(0)=3, y'(0)=0, y(0)=0$ 
Ok I'm having a very hard time to solving this b/c if one is going to solve using system of linear different equations don't we need a forcing term. I have solved for the Yc which is 
$Y_c=c_1v_1e^{-t}+c_2(v_1+v_2t)e^{-t}+c_3v_3e^{-2t} $
and my lambda= -1,-1,-2
and my vectors are $v_1=[1,-1,1] v_2=[1,0,-1] v_3=[1,-2,4]$
but for the Yp I don't know how solve without forcing terms. 
Am I doing something wrong? 
Help would be much appreciated. 
Thank You!
 A: I will guide you through hints and see if you can fill in the blanks using two methods and recommend a third.
Method 1 (Complimentary and Particular Solution)
For the complementary solution, we have:
$m^3 + 4m^2 + 5 m = 2 = 0 \rightarrow m_1 = -1, m_2 = -1, m_3 = -2$
This gives us a complimentary solution (when using the ICs) of:
$$y_c =  3 e^{-t} (t-1) + 3 e^{-2 t}$$
To find the particular solution, we guess at a solution in the form of:
$$y_p = a \cos t + b \sin t$$
Differentiate and substitute into ODE and solve for constants.
You should end up with:
$$y(t) = e^{-2 t} \left(-2 e^t (t-1)+2 e^{2 t} \sin t-1\right)-\cos t $$
Method 2 (Matrix DEQ)
We need to rewrite the system as a set of first order equations, so we let $x_1=y$ and have:


*

*$x_1' = y' = x_2$

*$x_2' = y'' = x_3$

*$x_3' = y''' = -4y'' - 5y' -2y + 10 \cos t = -4x_3 - 5x_2 -2x_1 + 10 \cos t$


Our initial conditions are now expressed as $x_1(0) = 0, x_2(0) = 0, x_3(0) = 3$. Please make a note that we have time $t_0 = 0$ as we need that for later.
Now, we have a system of three equations and we can rewrite it using matrix equations as:
$$x'(t) = Ax(t) + F(t), \text{with IC vector}~~ C$$
To solve this matrix equation with forcing function we have:
$$\tag 1 \displaystyle x(t) = e^{At}C + \int_{t_0}^{t} e^{A(t-s)}F(s)~ds$$
So, we have:
$$\tag 2 x'(t) = \begin{bmatrix}x_1'(t)\\x_2'(t)\\x_3'(t) \end{bmatrix} = \begin{bmatrix}0 & 1 & 0\\0 & 0 & 1\\ -2 & -5 & -4\end{bmatrix}\begin{bmatrix}x_1(t)\\x_2(t)\\x_3(t) \end{bmatrix} + \begin{bmatrix}0\\0\\ 10\cos t \end{bmatrix}, C = \begin{bmatrix}0\\0\\3 \end{bmatrix}, t_0 = 0$$
We have a generalized eigenvector for $v_3$ due to eigenvalue with multiplicity of two. We have eigenvalues/eigenvectors as (I changed the order you used, but it does not matter):


*

*$\lambda_1 = -2, ~v_1 = (1, -2, 4)$   

*$\lambda_2 = -1, ~v_2 = (1, -1, 1)$   

*$\lambda_3 = -1, ~v_3 = (2, -1, 0)$ 


Let me kick start you, to solve $(2)$, from $(1)$, we get:
$$e^{At}C = \begin{bmatrix}3 e^{-t} (t-1)+3 e^{-2 t}\\-3 e^{-t} (t-2)-6 e^{-2 t}\\3 e^{-t} (t-3)+12 e^{-2 t} \end{bmatrix}$$
Next do the integral (it is not bad), so see if you can do the others from this since you know the result.
Method 3: Variation of Parameters w/Greene's Function
This method is very useful because it makes it very easy to change the forcing function with little work.
Give it a go if you are bored!
