How to integrate on a nonhomogenous differential equation Hello im working on solving the ODE $y^{\prime}(t)=B y(t)+\left(\begin{array}{c}1 \\ -1\end{array}\right)$, with $y(0)=\left(\begin{array}{l}0 \\ 1\end{array}\right)$. Here $B=\left(\begin{array}{cc}1 & 4 \\ -1 & -3\end{array}\right)$. I encountered the following formula from my textbook $\mathbf{x}(t)=e^{A t} \mathbf{b}+\int_0^t e^{A(t-s)} \mathbf{g}(s) d s$ where $x(0) = \mathbf{b}$. I am having trouble applying this in this situation. particularly the integral part. I figured I could split it to $\int_0^t e^{At}e^{-Bs} \mathbf{g}(s) d s$ and then take out the $e^{At}$ as it is a constant. but This is where I got stuck since B is a 2x2 matrix I am unsure how to go about integrating that. any help would be appreciated. Thanks so much!
 A: This kind of problem is very common in Linear Control Systems.
First you need to simplify your matrix $B$ in some standard form. Unfortunately, not all matrices are similar to a diagonal matrix (like in this case), but you can express $\underline{any}$ matrix in the Jordan Canonical Form. Taking the exp() function of a matrix in such a form is standard and quite simple. See the attached document:

The Jordan Decomposition of your matrix is:
$B=SJS^{-1}=\begin{bmatrix}
-2&-1\\
1&0
\end{bmatrix}\begin{bmatrix}
-1&1\\
0&-1
\end{bmatrix}\begin{bmatrix}
0&1\\
-1&-2
\end{bmatrix}$
Applying the rules of the above scheme where $\lambda=-1$ is the single eigenvalue of B with algebraic multiplicity 2, gives:
$e^{B t}=\begin{bmatrix}
-2&-1\\
1&0
\end{bmatrix}\begin{bmatrix}
e^{-t}&e^{-t}t\\
0&e^{-t}
\end{bmatrix}\begin{bmatrix}
0&1\\
-1&-2
\end{bmatrix}=Se^{Jt}S^{-1}=\begin{bmatrix}
e^{-t}(1+2t)&4e^{-t}t\\
-e^{-t}t&e^{-t}(1-2t)
\end{bmatrix}$
Also, since $g(s)=[1 -1]^T$:
$\int_{0}^{t}e^{B (t-s)}g(s)ds=S\left(\int_{0}^{t}\begin{bmatrix}
e^{-(t-s)}&(t-s)e^{-(t-s)}\\
0&e^{-(t-s)}
\end{bmatrix}ds\right)S^{-1}g(s)=
\begin{bmatrix}
-1+e^{-t}(1+2t)\\
-e^{-t}
\end{bmatrix}$
Your solution is:
$x(t)=e^{Bt}x_0+\int_{0}^{t}e^{B (t-s)}g(s)ds=
\begin{bmatrix}
-1+e^{-t}(6t+1)\\
e^{-t}(1-3t)
\end{bmatrix}$
You can easily verify that this is the only solution that both verifies the initial condition and the differential equation!
A: We have the nonhomogeneous system $y' = Ay + g$ and are given an initial condition.
For the matrix $A=\left(\begin{array}{cc}1 & 4 \\ -1 & -3\end{array}\right) $, we get a single eigenvalue, $\lambda = -1$.
This is a deficient matrix, and we would typically find a generalized eigenvector (try this approach), but I will use the approach in these notes.
$$(A + I) = \left(\begin{array}{cc}2 & 4 \\ -1 & -2\end{array} \right) $$
$$(A+I)^2 = \left(\begin{array}{cc}0 & 0 \\ 0 & 0\end{array}\right), k = 2 $$
$$e^{(A+I)t} = I + (A+I)t = \left(\begin{array}{cc}1+2t & 4t \\ -t & 1-2t\end{array}\right)$$
$$e^{At} = e^{-t}e^{(A+I)t} = e^{-t}\left(\begin{array}{cc}1+2t & 4t \\ -t & 1-2t\end{array}\right)$$
Now using these notes, we have
$$y(t) = y_h(t) + y_p(t) = e^{At}y(0) +\displaystyle  \int_{t = 0}^s e^{A(t-s)} g(s)~ds$$
These notes are also easy to follow.
For the integral, we have
$$\displaystyle  \int_{t = 0}^s e^{A(t-s)} g(s)~ds = \int_{t = 0}^s e^{-(t-s)}\left(\begin{array}{cc}1+2(t-s) & 4(t-s) \\ -(t-s)t & 1-2(t-s)\end{array}\right) \left(\begin{array}{cc}1 \\ -1 \end{array} \right)~ds$$
This results in
$$\left(
\begin{array}{c}
 e^{-t} (2 t+1) \left(e^t (2 t-1)+1\right)-4 t^2 \\
 -t (1-2 t)-e^{-t} t \left(e^t (2 t-1)+1\right) \\
\end{array}
\right) = \left(
\begin{array}{c}
 e^{-t} (2 t+1)-1 \\
 -e^{-t} t \\
\end{array}
\right)$$
Hopefully you can proceed from here.
Recall that the final solution will be
$$y(t) = y_h(t) + y_p(t) = \begin{pmatrix} 6 e^{-t} t+e^{-t}-1 \\-e^{-t} (3 t-1) \end{pmatrix} $$
