Non-homogenous System where did I go wrong? Solve the system $\vec{x^{'}}=\begin{pmatrix}2 & -5\\1 & -2 \end{pmatrix}\vec{x}+ \begin{pmatrix} -\cos t\\ \sin t \end{pmatrix}$
The Eigenvalues are $(2-\lambda)(-2-\lambda)+5=0 \implies \lambda=\pm i$
The Eigevalue we choose is $\lambda=i$ and get a fundamental matrix of $$ \phi(t)=\begin{pmatrix} 5\cos t & 5\sin t\\ 2\cos t + \sin t & 2\sin t - \cos t \end{pmatrix}$$
We find the inverse by \begin{gather*}
\phi^{-1}(t)=\dfrac{1}{5\cos t(2\sin t-\cos t)- 5\sin t(2 \cos t+ \sin t)} \begin{pmatrix} 2\sin t - \cos t & -5\sin t\\ -2 \cos t - \sin t & -5\cos t \end{pmatrix}=\\[8pt]\dfrac{1}{5}\begin{pmatrix} \cos t-2\sin t & 5\sin t\\ 2 \cos t + \sin t & 5\cos t \end{pmatrix}
\end{gather*}
We multiply by $g(t)$ and have \begin{gather*}\dfrac{1}{5}\begin{pmatrix} \cos t-2\sin t & 5\sin t\\ 2 \cos t + \sin t & 5\cos t \end{pmatrix}\begin{pmatrix} -\cos t\\ \sin t \end{pmatrix}=\begin{pmatrix} -\cos^2 t+2\sin t\cos t +5 \sin^2 t\\ -2\cos^2 t -2\cos t \sin t +5\cos t \sin t \end{pmatrix}=\\[8pt]\begin{pmatrix} 5 \sin^2 t-\cos^2 t +2 \sin t \cos t\\ -2\cos^2 t +3\sin t \cos t \end{pmatrix}\end{gather*}
Integrating all of this yields $$\begin{pmatrix} \frac{5}{2}t - \frac{5}{4}\sin 2t - \frac{1}{2}t -\frac{1}{4}\sin 2t + \sin^2 t\\[8pt] -t-\frac{1}{2}\sin 2t+\frac{3}{2}\sin^2 t\end{pmatrix}=\begin{pmatrix} 2t-3\sin 2t +\sin^2 t\\ -t-\frac{1}{2}\sin 2t+\frac{3}{2}\sin^2 t \end{pmatrix}$$
Multiply by $\phi(t)$ and we have \begin{gather*}\begin{pmatrix} 5\cos t & 5\sin t\\ 2\cos t + \sin t & 2\sin t - \cos t \end{pmatrix}\begin{pmatrix} 2t-3\sin 2t +\sin^2 t\\ -t-\frac{1}{2}\sin 2t+\frac{3}{2}\sin^2 t \end{pmatrix}=\end{gather*}
$$\begin{pmatrix} 10t\cos t -15 \sin 2t \cos t +5 \sin^2 t \cos t-5t\sin t -\frac{5}{2}\sin 2t \sin t+\frac{15}{2}\sin^3 t \\ 4t \cos t +2t \sin t -6 \sin 2t \cos t -3 \sin t \sin 2t+2\cos t \sin^2 t + \sin^3 t -2t\sin t  +2t\cos t -\sin 2t \sin t+\frac{1}{2}\sin 2t \cos t +3\sin^3 t-\frac{3}{2}\sin^2 t \cos t \end{pmatrix}     
\dfrac{1}{5}$$
The book gets $x_h+\begin{pmatrix}2\\1 \end{pmatrix} t \cos t -\begin{pmatrix}1\\
0 \end{pmatrix} t \sin t$
So how did they simplify all that?
 A: Note: the author used $\lambda = i$ and $v_1 = (5, 2-i)$ for the calculations.
You have a sign issue:
$$\phi^{-1}(t)=\dfrac{1}{5}\begin{pmatrix} \cos t-2\sin t & 5\sin t\\ 2 \cos t + \sin t & -5\cos t \end{pmatrix}$$
Look at the sign of entry $\phi^{-1}(t)_{22}$, which should be a negative.
Multiplying by $g(t)$, we get:
$$\left(
\begin{array}{c}
 \sin ^2(t)-\frac{1}{5} \cos (t) (\cos (t)-2 \sin (t)) \\
 -\cos (t) \sin (t)-\frac{1}{5} \cos (t) (2 \cos (t)+\sin (t)) \\
\end{array}
\right)$$
Integrating, we get:
$$\left(
\begin{array}{c}
 \frac{2 t}{5}-\frac{1}{10} \cos (2 t)-\frac{3}{10} \sin (2 t) \\
 \frac{3 \cos ^2(t)}{5}-\frac{1}{10} \sin (2 t)-\frac{t}{5} \\
\end{array}
\right)$$
Expanding the trig terms, we get:
$$\left(
\begin{array}{c}
 -\frac{1}{10} \cos ^2(t)-\frac{3}{5} \sin (t) \cos (t)+\frac{\sin ^2(t)}{10}+\frac{2 t}{5} \\
 \frac{3 \cos ^2(t)}{10}-\frac{1}{5} \sin (t) \cos (t)-\frac{t}{5}-\frac{3 \sin ^2(t)}{10}+\frac{3}{10} \\
\end{array}
\right)$$
Multiplying by $\phi(t)$, we get:
$$\left(
\begin{array}{c}
 \left(2 t-\frac{1}{2}\right) \cos (t)-t \sin (t) \\
 \frac{1}{10} (2 (5 t-4) \cos (t)+\sin (t)) \\
\end{array}
\right)$$
Of course the $\cos t$ and $\sin t$ terms get absorbed into the constants and you are left with the author's result.
