How to compute integrals with matrix arguments. I apologise if this is trivial but I want to know how should I treat integrals having matrices
as arguments.
For example consider the integral $$\int_a^b e^{-As}ds$$, $A$ is some $n \times n$ invertible matrix, and $e^{-As}$ is an exponential matrix, how should I compute this?
What I would do is treat it as a usual integral so $$\int_a^b e^{-As}ds =[-e^{-Ax}A^{-1} ]_a^b$$ but here another question rises, is it $=[-e^{-Ax}A^{-1} ]_a^b$ or $[-A^{-1}e^{-Ax}]_a^b$?
Since $e^{-Ax}$ and $A^{-1}$ don't
necessarily commute
Can you explain this?
 A: By definition of the exponential of a matrix,
$$e^{-Ax}=\sum_0^\infty\frac{(-1)^n}{n!}A^nx^n\tag1$$
It turns out that this can be integrated term-by-term, and it gives exactly the answer you have guessed.
It should be apparent from equation $(1)$ that $e^{-Ax}$ does, in fact, commute with $A$ and $A^{-1}$, so either way you write it is fine.
A: Actually, they do necessarily commute, which is nice!
The exponential here is
$$e^{-As}=\sum_{n=0}^\infty \frac{(-As)^n}{n!} = \sum_{n=0}^\infty \frac{(-1)^ns^nA^n}{n!}$$
and so, upon distributing,
$$e^{-As}A^{-1}=\sum_{n=0}^\infty \frac{(-1)^ns^nA^{n-1}}{n!}=A^{-1}e^{-As}$$
You can be more confident in your integral by distributing the integration through the summation and calculating as usual (we handwave some steps here):
$$\begin{align}
\int_a^b e^{-As}\ ds &= \int_a^b \sum_{n=0}^\infty \frac{(-1)^ns^nA^n}{n!}\ ds \\
&=\sum_{n=0}^\infty \left(\frac{(-1)^nA^n}{n!}\int_a^b s^n\ ds\right) \\
&=\sum_{n=0}^\infty \left(\frac{(-1)^nA^n}{n!}\left[\frac{s^{n+1}}{n+1}\right]_{s=a}^b\right) \\
&=\left[\sum_{n=0}^\infty \left(\frac{(-1)^nA^n}{n!}\frac{s^{n+1}}{n+1}\right)\right]_{s=a}^b \\
&=\left[\sum_{n=0}^\infty \frac{(-1)^nA^ns^{n+1}}{(n+1)!}\right]_{s=a}^b
\\
&=\left[\sum_{n=1}^\infty \frac{(-1)^{n-1}A^{n-1}s^{n}}{n!}\right]_{s=a}^b\\
&=\left[(-1)^{-1}A^{-1}+\sum_{n=1}^\infty \frac{(-1)^{n-1}A^{n-1}s^{n}}{n!}\right]_{s=a}^b \\
&=\left[\sum_{n=0}^\infty \frac{(-1)^{n-1}A^{n-1}s^{n}}{n!}\right]_{s=a}^b \\
&=\left[-A^{-1}\sum_{n=0}^\infty \frac{(-1)^{n}A^{n}s^{n}}{n!}\right]_{s=a}^b \\
&=\left[-A^{-1}e^{-As}\right]_{s=a}^b
\end{align}
$$
Note that we were able to introduce the constant term $(-1)^{-1}A^{-1}$ for the usual integration reasons: we're taking a difference. Note also the steps which might not always be justified in different settings or with different sums if we were being more rigorous!
