<s>[INST] Finding a particular solution to the non-homogenous system I have the following problem $\vec{x}^{'}(t)=\begin{pmatrix} 2 & -5\\1 & -2 \end{pmatrix}\vec{x} + \begin{pmatrix} \csc t\\ \sec t \end{pmatrix}$
Step 1) Find the Eigenvalues $(2-\lambda)(-2-\lambda)+5=0 \implies \lambda= \pm i$
Step 2) The eigenvectors are $e_1=\begin{pmatrix}5 \\ 2-i \end{pmatrix}$ and $e_2= \begin{pmatrix} 5 \\ 2+i \end{pmatrix} $
This means that the fundamental matrix will be $\begin{pmatrix} 5e^{it} & 5e^{-it}\\ (2-i)e^{it} & (2+i)e^{-it}\end{pmatrix}$ and its inverse will be $$\dfrac{1}{10i}\begin{pmatrix} (2+i)e^{-it} & -5e^{-it}\\ (i-2)e^{it} & 5e^{it} \end{pmatrix}$$
This is going to get really really messy.... Please tell me if I am on the right track and if so for the love of god tell me I can omit the imaginary part when apply euler's formula.
So I decided to go forth with this messy problem and I'll show where I am stuck. I decided to leave the $\dfrac{1}{10i}$ to the end. So far I multiply $X^{-1}(t)g(t)$ which is $$\dfrac{-i}{10}\begin{pmatrix} (2+i)(\cos t - i \sin t) & -5\cos t +5i\sin t\\(i-2)(\cos t+i\sin t)& 5\cos t +5i\sin t) \end{pmatrix}\begin{pmatrix}\csc t\\ \sec t \end{pmatrix}=\dfrac{i}{10}\begin{pmatrix} 2\cot t-2i +i\cot t +5i \tan t -4\\ i \cot t -2\cot t -2i+5i\tan t +4 \end{pmatrix}$$ I than proceeded to integrate this monstrosity to obtain $$\begin{pmatrix} 2\ln(\sin t)-2it+i\ln(\sin t)-5i\ln(\cos t)-4t\\ i\ln(\sin t)-2it-2\ln(\sin t)-5i\ln(\cos t) +4t \end{pmatrix}$$ I than factored in the $\dfrac{-i}{10}$ to get $$\begin{pmatrix}-\frac{i}{5}\ln(\sin t)-\frac{t}{5}+\frac{1}{10}\ln(\sin t)-\frac{1}{2}\ln(\cos t) -\frac{2ti}{5}\\ \frac{1}{10}\ln(\sin t)-\frac{t}{5}+\frac{i}{5}\ln(\sin t)-\frac{1}{2}\ln(\cos t)-\frac{2ti}{5} \end{pmatrix}$$
But now I have to multiply THAT matrix by $X$ which is even messier... Am I doing something wrong?
Proceding with the Amzoti's method as follows:
 $\phi(t)= \begin{pmatrix} 5\cos t&5 \sin t\\ 2\cos t + \sin t& 2\sin t-\cos t \end{pmatrix}$  $$\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}$$ I multiply by $g(t)$ and get $$\begin{pmatrix} \cot t-2+5 \tan t\\ 2\cot t +1 -5  \end{pmatrix}$$
Next I take the integral: $$\begin{pmatrix}\int \cot t -2+5 \tan t=\ln(\sin t) -2t -5\ln(\cos t)\\\\ \int 2\cot t+1-5 t=2\ln(\sin t)+t-5t \end{pmatrix}$$ thus $$\dfrac{1}{5} \begin{pmatrix} \ln(\sin t)-2t-5\ln(\cos t)+c_1\\2\ln(\sin t)-4t+c_2\\ \end{pmatrix}$$ The top part isn't matching but the bottom part is.EDIT The moral of the problem... do your work in latex to find silly mistakes....
The solution in the book is $[\frac{1}{5}\ln(\sin t)-\ln(-\cos t)-\frac{2}{5}t+c_1]\begin{pmatrix} 5\cos t \\ 2\cos t +\sin t\end{pmatrix}+[\frac{2}{5}\ln(\sin t)-\frac{4}{5}t+c_2]\begin{pmatrix} 5\sin t\\-\cos t+2\sin t \end{pmatrix}$
 [/INST] We are given the nonhomogeneous system:
$$x'(t)=\begin{bmatrix} 2 & -5\\1 & -2 \end{bmatrix}\vec{x} + \begin{bmatrix} \csc t\\ \sec t \end{bmatrix}$$
We can write this as $X'(t) = A x(t) + F[t]$, where:
$$A = \begin{bmatrix} 2 & -5\\1 & -2  \end{bmatrix}, ~~ F[t] = \begin{bmatrix} \csc t\\ \sec t \end{bmatrix}$$
We first find the homogeneous solution. The eigenvalues and eigenvectors of $A$ are:
$$\lambda_1 = i, v_1 = (2+i, 1), \lambda_2 = -i, v_2 = (2-i, 1)$$
This gives us a solution of:
$$X_h(t) = \begin{bmatrix} x_h(t) \\ y_h(t) \end{bmatrix} = \begin{bmatrix}c_1(\cos (t)+2 \sin (t)) & -5c_2 \sin (t) \\  c_1\sin (t) & c_2(\cos (t)-2 \sin (t)) \end{bmatrix} $$
Now we need to find the particular solution using the Fundamental Matrix approach, by solving:
$$X(t) = e^{At}X_0 + \int_{t_0}^t e^{A(t-s)}F(s)~ds$$
So, we we use a linear combination from the components of the homogeneous solution to write:


*

*Write $\phi(t) = [x_1(t)~ | ~x_2(t)] $

*Find $\phi^{-1}(t) $

*Find $\phi^{-1}(t) \cdot F(t)$

*Now we integrate the previous result and this gives us: $w$

*Next, we find $X_p(t) = \begin{bmatrix} x_p(t) \\ y_p(t) \end{bmatrix} = \begin{bmatrix}\phi(t) \cdot w \end{bmatrix}$


Write the final solution as:
$X(t) = \begin{bmatrix} x(t) \\ y(t) \end{bmatrix} =\begin{bmatrix} -5 c_2 \sin (t)+c_1 (2 \sin (t)+\cos (t))+2 \sin (t) (\log (\sin (t))-2 t)+\cos (t) (-2 t+\log (\sin (t))-5 \log (\cos (t))) \\ \\ c_1 \sin (t)+c_2 (\cos (t)-2 \sin (t))-2 \cos (t) \log (\cos (t))+\sin (t) (-2 t+\log (\sin (t))-\log (\cos (t)))\end{bmatrix}$
Update
If we use your solution with the eigenvalues and eigenvectors, we have a solution of (we want to get rid of these imaginary components):
$$e^{it}\begin{pmatrix}5 \\ 2-i \end{pmatrix} = (\cos t + i \sin t)\begin{pmatrix}5 \\ 2-i \end{pmatrix} = \begin{pmatrix}5 \cos t + i(5 \sin t) \\ 2 \cos t + \sin t + i(2 \sin t - \cos t) \end{pmatrix}$$
So,
$$\phi(t) = \begin{pmatrix}5 \cos t & 5 \sin t \\ 2 \cos t + \sin t & 2 \sin t - \cos t \end{pmatrix}$$
Update 2
$$\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}$$ 
When you multiply out with $F(t)$ and do the integration, you get the same exact result as the author.
</s>