2.4.70 problem 67

Solution using Matrix exponential method
Solution using explicit Eigenvalue and Eigenvector method
Maple step by step solution
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [8635]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 67
Date solved : Thursday, December 12, 2024 at 09:32:44 AM
CAS classification : system_of_ODEs

\begin{align*} x^{\prime }&=x+2 y+2 t +1\\ y^{\prime }&=5 x+y+3 t -1 \end{align*}

Solution using Matrix exponential method

In this method, we will assume we have found the matrix exponential \(e^{A t}\) allready. There are different methods to determine this but will not be shown here. This is a system of linear ODE’s given as

\begin{align*} \vec {x}'(t) &= A\, \vec {x}(t) + \vec {G}(t) \end{align*}

Or

\begin{align*} \left [\begin {array}{c} x^{\prime } \\ y^{\prime } \end {array}\right ] &= \left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ]\, \left [\begin {array}{c} x \\ y \end {array}\right ] + \left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \end{align*}

Since the system is nonhomogeneous, then the solution is given by

\begin{align*} \vec {x}(t) &= \vec {x}_h(t) + \vec {x}_p(t) \end{align*}

Where \(\vec {x}_h(t)\) is the homogeneous solution to \(\vec {x}'(t) = A\, \vec {x}(t)\) and \(\vec {x}_p(t)\) is a particular solution to \(\vec {x}'(t) = A\, \vec {x}(t) + \vec {G}(t)\). The particular solution will be found using variation of parameters method applied to the fundamental matrix. For the above matrix \(A\), the matrix exponential can be found to be

\begin{align*} e^{A t} &= \left [\begin {array}{cc} \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} & -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{10} \\ -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{4} & \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \end{align*}

Therefore the homogeneous solution is

\begin{align*} \vec {x}_h(t) &= e^{A t} \vec {c} \\ &= \left [\begin {array}{cc} \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} & -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{10} \\ -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{4} & \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \left [\begin {array}{c} c_{1} \\ c_{2} \end {array}\right ] \\ &= \left [\begin {array}{c} \left (\frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2}\right ) c_{1}-\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}\, c_{2}}{10} \\ -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}\, c_{1}}{4}+\left (\frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2}\right ) c_{2} \end {array}\right ]\\ &= \left [\begin {array}{c} \frac {\left (-c_{2} \sqrt {10}+5 c_{1}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{10}+\frac {\left (\frac {c_{2} \sqrt {10}}{5}+c_{1}\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \\ \frac {\left (-c_{1} \sqrt {10}+2 c_{2}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{4}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \left (c_{1} \sqrt {10}+2 c_{2}\right )}{4} \end {array}\right ] \end{align*}

The particular solution given by

\begin{align*} \vec {x}_p (t) &= e^{A t} \int { e^{-A t} \vec {G}(t) \,dt} \end{align*}

But

\begin{align*} e^{-A t} &= (e^{A t})^{-1} \\ &= \left [\begin {array}{cc} \frac {{\mathrm e}^{-2 t} \left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}+{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right )}{2} & \frac {\sqrt {10}\, {\mathrm e}^{-2 t} \left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right )}{10} \\ \frac {\sqrt {10}\, {\mathrm e}^{-2 t} \left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right )}{4} & \frac {{\mathrm e}^{-2 t} \left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}+{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right )}{2} \end {array}\right ] \end{align*}

Hence

\begin{align*} \vec {x}_p (t) &= \left [\begin {array}{cc} \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} & -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{10} \\ -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{4} & \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \int { \left [\begin {array}{cc} \frac {{\mathrm e}^{-2 t} \left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}+{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right )}{2} & \frac {\sqrt {10}\, {\mathrm e}^{-2 t} \left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right )}{10} \\ \frac {\sqrt {10}\, {\mathrm e}^{-2 t} \left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right )}{4} & \frac {{\mathrm e}^{-2 t} \left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}+{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right )}{2} \end {array}\right ] \left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ]\,dt}\\ &= \left [\begin {array}{cc} \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} & -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{10} \\ -\frac {\left (-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{4} & \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \left [\begin {array}{c} \frac {\left (\left (-63 t -67\right ) \sqrt {10}-180 t +85\right ) {\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{810}+\frac {7 \,{\mathrm e}^{\left (-1+\sqrt {10}\right ) t} \left (\left (t +\frac {67}{63}\right ) \sqrt {10}-\frac {20 t}{7}+\frac {85}{63}\right )}{90} \\ \frac {\left (\left (-36 t +17\right ) \sqrt {10}-126 t -134\right ) {\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{324}+\frac {{\mathrm e}^{\left (-1+\sqrt {10}\right ) t} \left (\left (t -\frac {17}{36}\right ) \sqrt {10}-\frac {7 t}{2}-\frac {67}{18}\right )}{9} \end {array}\right ]\\ &= \left [\begin {array}{c} -\frac {4 t}{9}+\frac {17}{81} \\ -\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \end{align*}

Hence the complete solution is

\begin{align*} \vec {x}(t) &= \vec {x}_h(t) + \vec {x}_p (t) \\ &= \left [\begin {array}{c} \frac {17}{81}+\frac {\left (-c_{2} \sqrt {10}+5 c_{1}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{10}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \left (c_{2} \sqrt {10}+5 c_{1}\right )}{10}-\frac {4 t}{9} \\ \frac {\left (-c_{1} \sqrt {10}+2 c_{2}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{4}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \left (c_{1} \sqrt {10}+2 c_{2}\right )}{4}-\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \end{align*}

Solution using explicit Eigenvalue and Eigenvector method

This is a system of linear ODE’s given as

\begin{align*} \vec {x}'(t) &= A\, \vec {x}(t) + \vec {G}(t) \end{align*}

Or

\begin{align*} \left [\begin {array}{c} x^{\prime } \\ y^{\prime } \end {array}\right ] &= \left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ]\, \left [\begin {array}{c} x \\ y \end {array}\right ] + \left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \end{align*}

Since the system is nonhomogeneous, then the solution is given by

\begin{align*} \vec {x}(t) &= \vec {x}_h(t) + \vec {x}_p(t) \end{align*}

Where \(\vec {x}_h(t)\) is the homogeneous solution to \(\vec {x}'(t) = A\, \vec {x}(t)\) and \(\vec {x}_p(t)\) is a particular solution to \(\vec {x}'(t) = A\, \vec {x}(t) + \vec {G}(t)\). The particular solution will be found using variation of parameters method applied to the fundamental matrix.

The first step is find the homogeneous solution. We start by finding the eigenvalues of \(A\). This is done by solving the following equation for the eigenvalues \(\lambda \)

\begin{align*} \operatorname {det} \left ( A- \lambda I \right ) &= 0 \end{align*}

Expanding gives

\begin{align*} \operatorname {det} \left (\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ]-\lambda \left [\begin {array}{cc} 1 & 0 \\ 0 & 1 \end {array}\right ]\right ) &= 0 \end{align*}

Therefore

\begin{align*} \operatorname {det} \left (\left [\begin {array}{cc} 1-\lambda & 2 \\ 5 & 1-\lambda \end {array}\right ]\right ) &= 0 \end{align*}

Which gives the characteristic equation

\begin{align*} \lambda ^{2}-2 \lambda -9&=0 \end{align*}

The roots of the above are the eigenvalues.

\begin{align*} \lambda _1 &= 1+\sqrt {10}\\ \lambda _2 &= 1-\sqrt {10} \end{align*}

This table summarises the above result

eigenvalue algebraic multiplicity type of eigenvalue
\(1-\sqrt {10}\) \(1\) real eigenvalue
\(1+\sqrt {10}\) \(1\) real eigenvalue

Now the eigenvector for each eigenvalue are found.

Considering the eigenvalue \(\lambda _{1} = 1-\sqrt {10}\)

We need to solve \(A \vec {v} = \lambda \vec {v}\) or \((A-\lambda I) \vec {v} = \vec {0}\) which becomes

\begin{align*} \left (\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ] - \left (1-\sqrt {10}\right ) \left [\begin {array}{cc} 1 & 0 \\ 0 & 1 \end {array}\right ]\right ) \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ]&=\left [\begin {array}{c} 0 \\ 0 \end {array}\right ]\\ \left [\begin {array}{cc} \sqrt {10} & 2 \\ 5 & \sqrt {10} \end {array}\right ] \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ]&=\left [\begin {array}{c} 0 \\ 0 \end {array}\right ] \end{align*}

Now forward elimination is applied to solve for the eigenvector \(\vec {v}\). The augmented matrix is

\[ \left [\begin {array}{@{}cc!{\ifdefined \HCode |\else \color {red}\vline width 0.6pt\fi }c@{}} \sqrt {10}&2&0\\ 5&\sqrt {10}&0 \end {array} \right ] \]
\begin{align*} R_{2} = R_{2}-\frac {\sqrt {10}\, R_{1}}{2} &\Longrightarrow \hspace {5pt}\left [\begin {array}{@{}cc!{\ifdefined \HCode |\else \color {red}\vline width 0.6pt\fi }c@{}} \sqrt {10}&2&0\\ 0&0&0 \end {array} \right ] \end{align*}

Therefore the system in Echelon form is

\[ \left [\begin {array}{cc} \sqrt {10} & 2 \\ 0 & 0 \end {array}\right ] \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ] = \left [\begin {array}{c} 0 \\ 0 \end {array}\right ] \]

The free variables are \(\{v_{2}\}\) and the leading variables are \(\{v_{1}\}\). Let \(v_{2} = t\). Now we start back substitution. Solving the above equation for the leading variables in terms of free variables gives equation \(\left \{v_{1} = -\frac {t \sqrt {10}}{5}\right \}\)

Hence the solution is

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} -\frac {t \sqrt {10}}{5} \\ t \end {array}\right ] \]

Since there is one free Variable, we have found one eigenvector associated with this eigenvalue. The above can be written as

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = t \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \]

Let \(t = 1\) the eigenvector becomes

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \]

Which is normalized to

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} -\sqrt {10} \\ 5 \end {array}\right ] \]

Considering the eigenvalue \(\lambda _{2} = 1+\sqrt {10}\)

We need to solve \(A \vec {v} = \lambda \vec {v}\) or \((A-\lambda I) \vec {v} = \vec {0}\) which becomes

\begin{align*} \left (\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ] - \left (1+\sqrt {10}\right ) \left [\begin {array}{cc} 1 & 0 \\ 0 & 1 \end {array}\right ]\right ) \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ]&=\left [\begin {array}{c} 0 \\ 0 \end {array}\right ]\\ \left [\begin {array}{cc} -\sqrt {10} & 2 \\ 5 & -\sqrt {10} \end {array}\right ] \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ]&=\left [\begin {array}{c} 0 \\ 0 \end {array}\right ] \end{align*}

Now forward elimination is applied to solve for the eigenvector \(\vec {v}\). The augmented matrix is

\[ \left [\begin {array}{@{}cc!{\ifdefined \HCode |\else \color {red}\vline width 0.6pt\fi }c@{}} -\sqrt {10}&2&0\\ 5&-\sqrt {10}&0 \end {array} \right ] \]
\begin{align*} R_{2} = R_{2}+\frac {\sqrt {10}\, R_{1}}{2} &\Longrightarrow \hspace {5pt}\left [\begin {array}{@{}cc!{\ifdefined \HCode |\else \color {red}\vline width 0.6pt\fi }c@{}} -\sqrt {10}&2&0\\ 0&0&0 \end {array} \right ] \end{align*}

Therefore the system in Echelon form is

\[ \left [\begin {array}{cc} -\sqrt {10} & 2 \\ 0 & 0 \end {array}\right ] \left [\begin {array}{c} v_{1} \\ v_{2} \end {array}\right ] = \left [\begin {array}{c} 0 \\ 0 \end {array}\right ] \]

The free variables are \(\{v_{2}\}\) and the leading variables are \(\{v_{1}\}\). Let \(v_{2} = t\). Now we start back substitution. Solving the above equation for the leading variables in terms of free variables gives equation \(\left \{v_{1} = \frac {t \sqrt {10}}{5}\right \}\)

Hence the solution is

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} \frac {t \sqrt {10}}{5} \\ t \end {array}\right ] \]

Since there is one free Variable, we have found one eigenvector associated with this eigenvalue. The above can be written as

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = t \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \]

Let \(t = 1\) the eigenvector becomes

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \]

Which is normalized to

\[ \left [\begin {array}{c} v_{1} \\ t \end {array}\right ] = \left [\begin {array}{c} \sqrt {10} \\ 5 \end {array}\right ] \]

The following table gives a summary of this result. It shows for each eigenvalue the algebraic multiplicity \(m\), and its geometric multiplicity \(k\) and the eigenvectors associated with the eigenvalue. If \(m>k\) then the eigenvalue is defective which means the number of normal linearly independent eigenvectors associated with this eigenvalue (called the geometric multiplicity \(k\)) does not equal the algebraic multiplicity \(m\), and we need to determine an additional \(m-k\) generalized eigenvectors for this eigenvalue.

multiplicity
eigenvalue algebraic \(m\) geometric \(k\) defective? eigenvectors
\(1+\sqrt {10}\) \(1\) \(1\) No \(\left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\)
\(1-\sqrt {10}\) \(1\) \(1\) No \(\left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\)

Now that we found the eigenvalues and associated eigenvectors, we will go over each eigenvalue and generate the solution basis. The only problem we need to take care of is if the eigenvalue is defective. Since eigenvalue \(1+\sqrt {10}\) is real and distinct then the corresponding eigenvector solution is

\begin{align*} \vec {x}_{1}(t) &= \vec {v}_{1} e^{\left (1+\sqrt {10}\right ) t}\\ &= \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] e^{\left (1+\sqrt {10}\right ) t} \end{align*}

Since eigenvalue \(1-\sqrt {10}\) is real and distinct then the corresponding eigenvector solution is

\begin{align*} \vec {x}_{2}(t) &= \vec {v}_{2} e^{\left (1-\sqrt {10}\right ) t}\\ &= \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] e^{\left (1-\sqrt {10}\right ) t} \end{align*}

Therefore the homogeneous solution is

\begin{align*} \vec {x}_h(t) &= c_{1} \vec {x}_{1}(t) + c_{2} \vec {x}_{2}(t) \end{align*}

Which is written as

\begin{align*} \left [\begin {array}{c} x \\ y \end {array}\right ] &= c_{1} \left [\begin {array}{c} \frac {\sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} \\ {\mathrm e}^{\left (1+\sqrt {10}\right ) t} \end {array}\right ] + c_{2} \left [\begin {array}{c} -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] \end{align*}

Now that we found homogeneous solution above, we need to find a particular solution \(\vec {x}_p(t)\). We will use Variation of parameters. The fundamental matrix is

\[ \Phi =\begin {bmatrix} \vec {x}_{1} & \vec {x}_{2} & \cdots \end {bmatrix} \]

Where \(\vec {x}_i\) are the solution basis found above. Therefore the fundamental matrix is

\begin{align*} \Phi (t)&= \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} & -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1+\sqrt {10}\right ) t} & {\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] \end{align*}

The particular solution is then given by

\begin{align*} \vec {x}_p(t) &= \Phi \int { \Phi ^{-1} \vec {G}(t) \, dt}\\ \end{align*}

But

\begin{align*} \Phi ^{-1} &= \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{4} & \frac {{\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{2} \\ -\frac {\sqrt {10}\, {\mathrm e}^{\left (-1+\sqrt {10}\right ) t}}{4} & \frac {{\mathrm e}^{\left (-1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \end{align*}

Hence

\begin{align*} \vec {x}_p(t) &= \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} & -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1+\sqrt {10}\right ) t} & {\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] \int { \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{4} & \frac {{\mathrm e}^{-\left (1+\sqrt {10}\right ) t}}{2} \\ -\frac {\sqrt {10}\, {\mathrm e}^{\left (-1+\sqrt {10}\right ) t}}{4} & \frac {{\mathrm e}^{\left (-1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \, dt}\\ &= \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} & -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1+\sqrt {10}\right ) t} & {\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] \int { \left [\begin {array}{c} \frac {{\mathrm e}^{-\left (1+\sqrt {10}\right ) t} \left (2 t \sqrt {10}+\sqrt {10}+6 t -2\right )}{4} \\ -\frac {{\mathrm e}^{\left (-1+\sqrt {10}\right ) t} \left (2 t \sqrt {10}+\sqrt {10}-6 t +2\right )}{4} \end {array}\right ] \, dt}\\ &= \left [\begin {array}{cc} \frac {\sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} & -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1+\sqrt {10}\right ) t} & {\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] \left [\begin {array}{c} \frac {\left (18 t \sqrt {10}+185 \sqrt {10}-18 t -572\right ) {\mathrm e}^{-\left (1+\sqrt {10}\right ) t} \left (2 t \sqrt {10}+\sqrt {10}+6 t -2\right )}{-648 t -5184+1620 \sqrt {10}} \\ -\frac {\left (18 t \sqrt {10}+185 \sqrt {10}+18 t +572\right ) {\mathrm e}^{\left (-1+\sqrt {10}\right ) t} \left (2 t \sqrt {10}+\sqrt {10}-6 t +2\right )}{324 \left (2 t +16+5 \sqrt {10}\right )} \end {array}\right ] \\ &= \left [\begin {array}{c} \frac {-72 t^{3}-1118 t^{2}+436 t +51}{162 t^{2}+2592 t +243} \\ \frac {-126 t^{3}-2150 t^{2}-2333 t -201}{162 t^{2}+2592 t +243} \end {array}\right ] \end{align*}

Now that we found particular solution, the final solution is

\begin{align*} \vec {x}(t) &= \vec {x}_h(t) + \vec {x}_p(t)\\ \left [\begin {array}{c} x \\ y \end {array}\right ] &= \left [\begin {array}{c} \frac {c_1 \sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5} \\ c_1 \,{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \end {array}\right ] + \left [\begin {array}{c} -\frac {c_2 \,{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} \\ c_2 \,{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \end {array}\right ] + \left [\begin {array}{c} \frac {-72 t^{3}-1118 t^{2}+436 t +51}{162 t^{2}+2592 t +243} \\ \frac {-126 t^{3}-2150 t^{2}-2333 t -201}{162 t^{2}+2592 t +243} \end {array}\right ] \end{align*}

Which becomes

\begin{align*} \left [\begin {array}{c} x \\ y \end {array}\right ] = \left [\begin {array}{c} \frac {c_1 \sqrt {10}\, {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{5}-\frac {c_2 \,{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t} \sqrt {10}}{5}-\frac {4 t}{9}+\frac {17}{81} \\ c_1 \,{\mathrm e}^{\left (1+\sqrt {10}\right ) t}+c_2 \,{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}-\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \end{align*}

Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d t}x \left (t \right )=x \left (t \right )+2 y \left (t \right )+2 t +1, \frac {d}{d t}y \left (t \right )=5 x \left (t \right )+y \left (t \right )+3 t -1\right ] \\ \bullet & {} & \textrm {Define vector}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}\left (t \right )=\left [\begin {array}{c} x \left (t \right ) \\ y \left (t \right ) \end {array}\right ] \\ \bullet & {} & \textrm {Convert system into a vector equation}\hspace {3pt} \\ {} & {} & \frac {d}{d t}{\moverset {\rightarrow }{x}}\left (t \right )=\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ]\cdot {\moverset {\rightarrow }{x}}\left (t \right )+\left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \\ \bullet & {} & \textrm {System to solve}\hspace {3pt} \\ {} & {} & \frac {d}{d t}{\moverset {\rightarrow }{x}}\left (t \right )=\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ]\cdot {\moverset {\rightarrow }{x}}\left (t \right )+\left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \\ \bullet & {} & \textrm {Define the forcing function}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{f}}\left (t \right )=\left [\begin {array}{c} 2 t +1 \\ 3 t -1 \end {array}\right ] \\ \bullet & {} & \textrm {Define the coefficient matrix}\hspace {3pt} \\ {} & {} & A =\left [\begin {array}{cc} 1 & 2 \\ 5 & 1 \end {array}\right ] \\ \bullet & {} & \textrm {Rewrite the system as}\hspace {3pt} \\ {} & {} & \frac {d}{d t}{\moverset {\rightarrow }{x}}\left (t \right )=A \cdot {\moverset {\rightarrow }{x}}\left (t \right )+{\moverset {\rightarrow }{f}} \\ \bullet & {} & \textrm {To solve the system, find the eigenvalues and eigenvectors of}\hspace {3pt} A \\ \bullet & {} & \textrm {Eigenpairs of}\hspace {3pt} A \\ {} & {} & \left [\left [1-\sqrt {10}, \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\right ], \left [1+\sqrt {10}, \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\right ]\right ] \\ \bullet & {} & \textrm {Consider eigenpair}\hspace {3pt} \\ {} & {} & \left [1-\sqrt {10}, \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\right ] \\ \bullet & {} & \textrm {Solution to homogeneous system from eigenpair}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}_{1}={\mathrm e}^{\left (1-\sqrt {10}\right ) t}\cdot \left [\begin {array}{c} -\frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \\ \bullet & {} & \textrm {Consider eigenpair}\hspace {3pt} \\ {} & {} & \left [1+\sqrt {10}, \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ]\right ] \\ \bullet & {} & \textrm {Solution to homogeneous system from eigenpair}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}_{2}={\mathrm e}^{\left (1+\sqrt {10}\right ) t}\cdot \left [\begin {array}{c} \frac {\sqrt {10}}{5} \\ 1 \end {array}\right ] \\ \bullet & {} & \textrm {General solution of the system of ODEs can be written in terms of the particular solution}\hspace {3pt} {\moverset {\rightarrow }{x}}_{p}\left (t \right ) \\ {} & {} & {\moverset {\rightarrow }{x}}\left (t \right )=\mathit {C1} {\moverset {\rightarrow }{x}}_{1}+\mathit {C2} {\moverset {\rightarrow }{x}}_{2}+{\moverset {\rightarrow }{x}}_{p}\left (t \right ) \\ \square & {} & \textrm {Fundamental matrix}\hspace {3pt} \\ {} & \circ & \textrm {Let}\hspace {3pt} \phi \left (t \right )\hspace {3pt}\textrm {be the matrix whose columns are the independent solutions of the homogeneous system.}\hspace {3pt} \\ {} & {} & \phi \left (t \right )=\left [\begin {array}{cc} -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} & \frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1-\sqrt {10}\right ) t} & {\mathrm e}^{\left (1+\sqrt {10}\right ) t} \end {array}\right ] \\ {} & \circ & \textrm {The fundamental matrix,}\hspace {3pt} \Phi \left (t \right )\hspace {3pt}\textrm {is a normalized version of}\hspace {3pt} \phi \left (t \right )\hspace {3pt}\textrm {satisfying}\hspace {3pt} \Phi \left (0\right )=I \hspace {3pt}\textrm {where}\hspace {3pt} I \hspace {3pt}\textrm {is the identity matrix}\hspace {3pt} \\ {} & {} & \Phi \left (t \right )=\phi \left (t \right )\cdot \phi \left (0\right )^{-1} \\ {} & \circ & \textrm {Substitute the value of}\hspace {3pt} \phi \left (t \right )\hspace {3pt}\textrm {and}\hspace {3pt} \phi \left (0\right ) \\ {} & {} & \Phi \left (t \right )=\left [\begin {array}{cc} -\frac {{\mathrm e}^{\left (1-\sqrt {10}\right ) t} \sqrt {10}}{5} & \frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} \sqrt {10}}{5} \\ {\mathrm e}^{\left (1-\sqrt {10}\right ) t} & {\mathrm e}^{\left (1+\sqrt {10}\right ) t} \end {array}\right ]\cdot \left [\begin {array}{cc} -\frac {\sqrt {10}}{5} & \frac {\sqrt {10}}{5} \\ 1 & 1 \end {array}\right ]^{-1} \\ {} & \circ & \textrm {Evaluate and simplify to get the fundamental matrix}\hspace {3pt} \\ {} & {} & \Phi \left (t \right )=\left [\begin {array}{cc} \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} & -\frac {\left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{10} \\ -\frac {\left ({\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}-{\mathrm e}^{\left (1+\sqrt {10}\right ) t}\right ) \sqrt {10}}{4} & \frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{2}+\frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{2} \end {array}\right ] \\ \square & {} & \textrm {Find a particular solution of the system of ODEs using variation of parameters}\hspace {3pt} \\ {} & \circ & \textrm {Let the particular solution be the fundamental matrix multiplied by}\hspace {3pt} {\moverset {\rightarrow }{v}}\left (t \right )\hspace {3pt}\textrm {and solve for}\hspace {3pt} {\moverset {\rightarrow }{v}}\left (t \right ) \\ {} & {} & {\moverset {\rightarrow }{x}}_{p}\left (t \right )=\Phi \left (t \right )\cdot {\moverset {\rightarrow }{v}}\left (t \right ) \\ {} & \circ & \textrm {Take the derivative of the particular solution}\hspace {3pt} \\ {} & {} & \frac {d}{d t}{\moverset {\rightarrow }{x}}_{p}\left (t \right )=\left (\frac {d}{d t}\Phi \left (t \right )\right )\cdot {\moverset {\rightarrow }{v}}\left (t \right )+\Phi \left (t \right )\cdot \left (\frac {d}{d t}{\moverset {\rightarrow }{v}}\left (t \right )\right ) \\ {} & \circ & \textrm {Substitute particular solution and its derivative into the system of ODEs}\hspace {3pt} \\ {} & {} & \left (\frac {d}{d t}\Phi \left (t \right )\right )\cdot {\moverset {\rightarrow }{v}}\left (t \right )+\Phi \left (t \right )\cdot \left (\frac {d}{d t}{\moverset {\rightarrow }{v}}\left (t \right )\right )=A \cdot \Phi \left (t \right )\cdot {\moverset {\rightarrow }{v}}\left (t \right )+{\moverset {\rightarrow }{f}}\left (t \right ) \\ {} & \circ & \textrm {The fundamental matrix has columns that are solutions to the homogeneous system so its derivative follows that of the homogeneous system}\hspace {3pt} \\ {} & {} & A \cdot \Phi \left (t \right )\cdot {\moverset {\rightarrow }{v}}\left (t \right )+\Phi \left (t \right )\cdot \left (\frac {d}{d t}{\moverset {\rightarrow }{v}}\left (t \right )\right )=A \cdot \Phi \left (t \right )\cdot {\moverset {\rightarrow }{v}}\left (t \right )+{\moverset {\rightarrow }{f}}\left (t \right ) \\ {} & \circ & \textrm {Cancel like terms}\hspace {3pt} \\ {} & {} & \Phi \left (t \right )\cdot \left (\frac {d}{d t}{\moverset {\rightarrow }{v}}\left (t \right )\right )={\moverset {\rightarrow }{f}}\left (t \right ) \\ {} & \circ & \textrm {Multiply by the inverse of the fundamental matrix}\hspace {3pt} \\ {} & {} & \frac {d}{d t}{\moverset {\rightarrow }{v}}\left (t \right )=\Phi \left (t \right )^{-1}\cdot {\moverset {\rightarrow }{f}}\left (t \right ) \\ {} & \circ & \textrm {Integrate to solve for}\hspace {3pt} {\moverset {\rightarrow }{v}}\left (t \right ) \\ {} & {} & {\moverset {\rightarrow }{v}}\left (t \right )=\int _{0}^{t}\Phi \left (s \right )^{-1}\cdot {\moverset {\rightarrow }{f}}\left (s \right )d s \\ {} & \circ & \textrm {Plug}\hspace {3pt} {\moverset {\rightarrow }{v}}\left (t \right )\hspace {3pt}\textrm {into the equation for the particular solution}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}_{p}\left (t \right )=\Phi \left (t \right )\cdot \left (\int _{0}^{t}\Phi \left (s \right )^{-1}\cdot {\moverset {\rightarrow }{f}}\left (s \right )d s \right ) \\ {} & \circ & \textrm {Plug in the fundamental matrix and the forcing function and compute}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}_{p}\left (t \right )=\left [\begin {array}{c} \frac {\left (-67 \sqrt {10}-85\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{810}+\frac {\left (67 \sqrt {10}-85\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{810}-\frac {4 t}{9}+\frac {17}{81} \\ \frac {\left (17 \sqrt {10}+134\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{324}+\frac {\left (-17 \sqrt {10}+134\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{324}-\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \\ \bullet & {} & \textrm {Plug particular solution back into general solution}\hspace {3pt} \\ {} & {} & {\moverset {\rightarrow }{x}}\left (t \right )=\mathit {C1} {\moverset {\rightarrow }{x}}_{1}+\mathit {C2} {\moverset {\rightarrow }{x}}_{2}+\left [\begin {array}{c} \frac {\left (-67 \sqrt {10}-85\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{810}+\frac {\left (67 \sqrt {10}-85\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{810}-\frac {4 t}{9}+\frac {17}{81} \\ \frac {\left (17 \sqrt {10}+134\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{324}+\frac {\left (-17 \sqrt {10}+134\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{324}-\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \\ \bullet & {} & \textrm {Substitute in vector of dependent variables}\hspace {3pt} \\ {} & {} & \left [\begin {array}{c} x \left (t \right ) \\ y \left (t \right ) \end {array}\right ]=\left [\begin {array}{c} \frac {\left (-85+\left (-162 \mathit {C1} -67\right ) \sqrt {10}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{810}+\frac {\left (-85+\left (162 \mathit {C2} +67\right ) \sqrt {10}\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{810}-\frac {4 t}{9}+\frac {17}{81} \\ \frac {\left (324 \mathit {C1} +17 \sqrt {10}+134\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{324}+\frac {\left (324 \mathit {C2} -17 \sqrt {10}+134\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{324}-\frac {7 t}{9}-\frac {67}{81} \end {array}\right ] \\ \bullet & {} & \textrm {Solution to the system of ODEs}\hspace {3pt} \\ {} & {} & \left \{x \left (t \right )=\frac {\left (-85+\left (-162 \mathit {C1} -67\right ) \sqrt {10}\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{810}+\frac {\left (-85+\left (162 \mathit {C2} +67\right ) \sqrt {10}\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{810}-\frac {4 t}{9}+\frac {17}{81}, y \left (t \right )=\frac {\left (324 \mathit {C1} +17 \sqrt {10}+134\right ) {\mathrm e}^{-\left (-1+\sqrt {10}\right ) t}}{324}+\frac {\left (324 \mathit {C2} -17 \sqrt {10}+134\right ) {\mathrm e}^{\left (1+\sqrt {10}\right ) t}}{324}-\frac {7 t}{9}-\frac {67}{81}\right \} \end {array} \]
Maple dsolve solution

Solving time : 0.053 (sec)
Leaf size : 67

dsolve([diff(x(t),t) = x(t)+2*y(t)+2*t+1, diff(y(t),t) = 5*x(t)+y(t)+3*t-1] 
       ,{op([x(t), y(t)])})
 
\begin{align*} x \left (t \right ) &= {\mathrm e}^{\left (1+\sqrt {10}\right ) t} c_{2} +{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t} c_{1} -\frac {4 t}{9}+\frac {17}{81} \\ y \left (t \right ) &= \frac {{\mathrm e}^{\left (1+\sqrt {10}\right ) t} c_{2} \sqrt {10}}{2}-\frac {{\mathrm e}^{-\left (-1+\sqrt {10}\right ) t} c_{1} \sqrt {10}}{2}-\frac {7 t}{9}-\frac {67}{81} \\ \end{align*}
Mathematica DSolve solution

Solving time : 11.175 (sec)
Leaf size : 158

DSolve[{{D[x[t],t]==x[t]+2*y[t]+2*t+1,D[y[t],t]==5*x[t]+y[t]+3*t-1},{}}, 
       {x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {1}{810} e^{t-\sqrt {10} t} \left (e^{\left (\sqrt {10}-1\right ) t} (170-360 t)+81 \left (5 c_1+\sqrt {10} c_2\right ) e^{2 \sqrt {10} t}+81 \left (5 c_1-\sqrt {10} c_2\right )\right ) \\ y(t)\to \frac {1}{324} e^{t-\sqrt {10} t} \left (-4 e^{\left (\sqrt {10}-1\right ) t} (63 t+67)+81 \left (\sqrt {10} c_1+2 c_2\right ) e^{2 \sqrt {10} t}-81 \left (\sqrt {10} c_1-2 c_2\right )\right ) \\ \end{align*}