Maybe you want to have a look to how to solve a system of linear differential equations of the form:
$$Y'(t) = A Y(t) + C(t), $$ with $Y, \ C \in \mathbb{R}^n$ and $A$ is a $n\times n$ matrix. Here I give you some thoughts. The solution is then given by:
$$ Y(t) = Y_0 \Phi(t) + \Phi(t) \int^t_0 \Phi^{-1}(s) C(s) \, \mathrm{d}s, $$
where $\Phi(t) = \exp{At}$ is the fundamental matrix of the system and $Y_0$ is the vector of initial conditions. If I'm not mistaken, the derivation of the above formula is pretty simple. Consider the system of equations:
$$ Y'(t) - A Y(t) = C(t), $$ and assume that there exists some (matrix) function $I(t)$ such that:
$$ \frac{\mathrm{d} }{ \mathrm{d} t} ( I(t) \, Y(t) ) = I(t) \, C(t), $$ so expanding this becomes:
$$ I(t) Y'(t) + I'(t) Y(t) = I(t) C(t). $$ Assuming now that $I(t)$ is an inversible matrix, we have that $Y'(t) + I^{-1}(t) I'(t) Y(t) = C(t)$, so comparing term by term with the original ODE we would have:
$$ I^{-1} (t) I'(t) = -A(t), $$ and then integrating we have: $I(t) = \exp(-At)$ and hence the solution is given by:
$$ I (t) Y(t) = D + \int^t_0 I(s) C(s) \, \mathrm{d}s , $$ for $D$ some constant vector. This yields to the formula I wrote before identifying $I(t)$ as $\Phi^{-1} (t)$ and applying the initial condition. Indeed $\exp(At)^{-1} = \exp(-At)$.
I would be greatly appreciated if somebody points me out any mistake or give some piece of advice.
I hope this helps.
Cheers!