I am an undergrad statistics student and I am having troubles with non-homogeneous ODE systems. During my classes I went over just three methods for solving odes: Laplace transform, Fourier transform and power series; so I should use one of those to solve such systems and now I am having trouble with a particular one. I would be glad if you could show me the solution! The system is the following: $$\begin{align} x'(t)&=x(t)-3y(t)+2\\ y'(t)&=5x(t)+y(t)-t \end{align}$$
As I told you I don't know how to solve it and it would be great if you can time me a detailed solution. Thank you very much!!!
As Paul stated, you can solve this using Laplace transform, however in this case it is also possible to convert this system of equations to a homogeneous ODE system.
For a system of $N$ linear differential equations with polynomial functions in time, with maximum order $M$, which makes it non-homogeneous, it is possible to find an equivalent ODE which is homogeneous by defining new variables. Thus the system of differential equations can be written as,
$$ \dot{x}_i = \sum_{j=1}^{N}a_{i,j}\ x_j + \sum_{k=0}^{M}b_{i,k}\ t^k \quad \forall\ i\in \{1,\dots,N\}. \tag{1} $$
The new variables are defined as,
$$ x_i = y_i + \sum_{k=0}^{M}c_{i,k}\ t^k \quad \forall\ i\in \{1,\dots,N\}, \tag{2} $$
such that the added polynomial coefficients satisfy,
$$ (k+1)\ c_{i,k+1} = \sum_{j=1}^{N}a_{i,j}\ c_{j,k}+b_{i,k} \quad \forall\ \big\{(i,k)|i\in\{1,\dots,N\}\land k\in\{0,\dots,M\}\big\}, \tag{3} $$
where $c_{i,M+1}=0$ for every $i$, because the added polynomials are of maximum order $M$.
This will simplify equations $(1)$ to a homogeneous ODE,
$$ \dot{y}_i = \sum_{j=1}^{N}a_{i,j}\ y_j. \tag{4} $$
This system of equations can be solved relative easy. These solutions can then be substituted into equations $(2)$ to find the solutions for $x_i(t)$.
In order to find the polynomial coefficients, $c_{j,k}$, you can write it as a vector $\textbf{w}$, whose components are defined as $w_{j+Nk}=c_{j,k}$, such that it can be written as a $N(M+1)\times N(M+1)$ matrix equation,
$$ \textbf{A}\textbf{w}=\textbf{v}. $$
The components of the matrix $\textbf{A}$ can then be found with $k+1=A_{i+Nk,\ i+N(k+1)}$ and $-a_{i,j}=A_{i+Nk,\ j+Nk}$ and the components of the vector $\textbf{v}$ can then be found with $v_{i+Nk}=b_{i,k}$.
For example when $N=2$ and $M=2$ the polynomial coefficients, $c_{j,k}$, can be found by solving,
$$ \begin{bmatrix} -a_{1,1} & -a_{1,2} & 1 & 0 & 0 & 0 \\ -a_{2,1} & -a_{2,1} & 0 & 1 & 0 & 0 \\ 0 & 0 & -a_{1,1} & -a_{1,2} & 2 & 0 \\ 0 & 0 & -a_{2,1} & -a_{2,1} & 0 & 2 \\ 0 & 0 & 0 & 0 & -a_{1,1} & -a_{1,2} \\ 0 & 0 & 0 & 0 & -a_{2,1} & -a_{2,1} \end{bmatrix} \begin{bmatrix} c_{1,0} \\ c_{2,0} \\ c_{1,1} \\ c_{2,1} \\ c_{1,2} \\ c_{2,2} \end{bmatrix} = \begin{bmatrix} b_{1,0} \\ b_{2,0} \\ b_{1,1} \\ b_{2,1} \\ b_{1,2} \\ b_{2,2} \end{bmatrix} $$
The determinant of such a matrix will be equal to $|\textbf{a}|^{M+1}$, thus if the homogeneous ODE does not have any eigenvalues/poles at zero then you will be able to solve for the polynomial coefficients.