I have $A$ and $B$ square matrices and I want to get rid of the integral in $$ \int_0^Te^{-As}(-A+B)e^{Bs}~ds. $$
This looks very related to the formula $$ \left(\int_0^T e^{At} dt \right) A + I = e^{AT} $$ that was mentioned here . But I don't get it...
I found a closed form solution by means of the theory of differential equations:
If someone gets a direct proof by matrix calculations, I will be happy to accept it. Anyways, here is my solution:
Consider the (matrix-valued) linear ODE: $$ \dot X = BX, \quad X(0)=I $$
and its solution $X(t) = e^{Bt}$.
The same $X$ then solves $$ \dot X = AX + (B-A)e^{Bt}, \quad X(0)=I, $$ which gives $X(t) = e^{At} + \int_0^t e^{A(t-s)}(B-A)e^{Bs}~ds$.
Thus $$ X(t) = e^{Bt} = e^{At} + \int_0^t e^{A(t-s)}(B-A)e^{Bs}~ds = e^{At} + e^{At}\int_0^t e^{-As}(B-A)e^{Bs}~ds $$ from where finds that $$ \int_0^t e^{-As}(B-A)e^{Bs}~ds = e^{-At}(e^{Bt}-e^{At}) $$ EDIT: I have removed an identity in the last formula that only holds for commuting matrices as @loupblanc pointed out. In general it only holds that $$ \int_0^t e^{-As}(B-A)e^{Bs}~ds = e^{-At}(e^{Bt}-e^{At}) = e^{-At}e^{Bt}-I. $$