Solving a Non Homogeneous System of First Order Coupled Differential Equations

Suppose we have a non homogeneous system of linear differential equations. We can solve the system by expressing the solution of the solution to the homogeneous system, and any solution to the non homogeneous system.
Suppose we have the system of coupled differential equations.
\[\dot{x}=3x+2y+1\]

\[\dot{y}=2x+3y+2\]

To solve this system, we need to diagonalise the coefficient matrix
\[M= \left( \begin{array}{cc} 3 & 2 & \\ 2 & 3 \end{array} \right)\]
. Write the system in matrix form as
\[\begin{pmatrix}\dot{x}\\ \dot{y} \end{pmatrix}= \left( \begin{array}{cc} 3 & 2 \\ 2 & 3 \end{array} \right) \begin{pmatrix}x\\ y \end{pmatrix}\]

The eigenvalues of the matrix are the solutions to
\[det(\left( \begin{array}{cc} 3 & 2 \\ 2 & 3 \end{array} \right) - \lambda \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right))=0 \rightarrow det(\left( \begin{array}{cc} 3- \lambda & 2 \\ 2 & 3- \lambda \end{array} \right))=0 \rightarrow (3- \lambda)^2-4=\lambda^2-6 \lambda +5=0\]

This expression in
\[\lambda\]
factorises as
\[(\lambda-5)(\lambda -1)=0\]
and we solve the equation, obtaining
\[\lambda=5, \: 1\]

Now find the eigenvectors for each eigenvalue.
For
\[\lambda=5\]
, solve
\[(\left( \begin{array}{cc} 3 & 2 \\ 2 & 3 \end{array} \right) - 5 \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right)) \mathbf{v} =\mathbf{0}\]
for
\[\mathbf{v}=\begin{pmatrix}x\\y\end{pmatrix} \]
.
\[\left( \begin{array}{cc} -2 & 2 \\ 2 & -2 \end{array} \right)\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}-2x+2y\\2x-2y\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}\]

Hence
\[x=y\]
and we can take the eigenvector corresponding to the eigenvector 5 as
\[\begin{pmatrix}1\\1\end{pmatrix}\]
.
For
\[\lambda=1\]
, solve
\[(\left( \begin{array}{cc} 3 & 2 \\ 2 & 3 \end{array} \right) - 1 \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right)) \mathbf{v} =\mathbf{0}\]
for
\[\mathbf{v}=\begin{pmatrix}x\\y\end{pmatrix} \]
.
\[\left( \begin{array}{cc} 2 & 2 \\ 2 & 2 \end{array} \right)\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}2x+2y\\2x+2y\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}\]

Hence
\[x=-y\]
and we can take the eigenvector corresponding to the eigenvector 5 as
\[\begin{pmatrix}1\\-1\end{pmatrix}\]
.
The matrix of eigenvectors is
\[P= \left( \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array} \right) \]
.
At the moment our system takes the form
\[\dot{\mathbf{v}}=M \mathbf{v}\]
.
Let
\[\mathbf{w}=P^{-1} \mathbf{v}\]
so that
\[\mathbf{v}=P \mathbf{w}\]
&. The system becomes
\[P \mathbf{v}=M P \mathbf{w} \rightarrow \mathbf{w}=P^{-1}MP \mathbf{w}\]
.
\[P^{-1}MP\]
will be a diagonal matrix with entries equal to the eigenvalues of
\[M\]
and
\[\mathbf{w}\]
will be an elementary basis vector. The new system will be
\[\begin{pmatrix}\dot{w_1} \\\dot{w_2} \end{pmatrix}=\left( \begin{array}{cc} 5 & 0 \\ 0 & 1 \end{array} \right) \begin{pmatrix}w_1\\w_2\end{pmatrix}\]
.
This is equivalent to the system
\[\dot{w_1}=5w_1 \]

\[\dot{w_1}=1w_1 \]

The solutions are
\[w_1=Ae^{5t}, w_2=B e^t\]

Then
\[\mathbf{v}'=P \mathbf{w} = \left( \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array} \right) \begin{pmatrix}Ae^{5t}\\Be^t\end{pmatrix} =\begin{pmatrix}Ae^{5t}+Be^t\\Ae^{5t}-Be^t\end{pmatrix}\]

Now assume a solution to the non homogeneous system of the form
\[x_p=C_1, \: y_p=C_2\]
. Substitute these into the problem.
Equation (1)
\[0=3C_1+2C_2+1=0\]

Equating coefficients of
\[t\]
gives
\[0=2C_1+3C_2+1 \rightarrow 2C_1+3C_2=-1\]
\[0=3C_1+2C_2+2 \rightarrow 3C_1+2C_2=-2\]

Solving these gives
\[C_1=- \frac{4}{5}, \: C_2= \frac{1}{5}\]

The general solution is then
\[x=Ae^{5t}+Be^t- \frac{4}{5}, \: y=Ae^{5t}-Be^t+ \frac{1}{5}\]