Integrate matrix exponential surrounded by vectors Suppose $\boldsymbol{M}$ is an $n \times n$ non-singular matrix, $\boldsymbol{\beta}$ is a $1 \times n$ row vector, $\boldsymbol{1}$ is a $n \times 1$ column vector of ones. How do I compute the following:
$$\int_{x_1}^{x_2}(\boldsymbol{\beta}e^{\boldsymbol{M}(x-u)}\boldsymbol{1})^2dx $$
Is it possible to get a nice closed form with respect to $x$?
I know for a non singular matrix the following result:
$$
\int_0^{T}e^{\boldsymbol{M}x}dx = (e^{\boldsymbol{M}{T}}-\boldsymbol{I})\boldsymbol{M}^{-1}
$$
where $\boldsymbol{I}$ is of course the $n \times n$ identity matrix, but i don't know how to apply it.
Note also that $(\boldsymbol{\beta}e^{\boldsymbol{M}(x-u)}\boldsymbol{1})$ is $1 \times 1$, i.e a scalar, and thus $(\boldsymbol{\beta}e^{\boldsymbol{M}(x-u)}\boldsymbol{1})^2$ is scalar too.
Any help appreciated!
Thanks
 A: $
\def\b{\beta^T}\def\l{\lambda}\def\o{{\tt1}}
\def\eMs{e^{Ms}}\def\eAs{e^{As}}
\def\J{\cal J}
\def\L{\left}\def\R{\right}
\def\LR#1{\L(#1\R)}
\def\op#1{\operatorname{#1}}
\def\trace#1{\op{Tr}\LR{#1}}
\def\qiq{\quad\implies\quad}
\def\c#1{\color{red}{#1}}
$The integration variable can be replaced
$$\eqalign{
s &= x-u \qiq &ds=dx \\
s_1 &= x_1-u \\
s_2 &= x_2-u \\
}$$
An interesting property of the Kronecker sum $(\oplus)$ is
that for two square matrices
$$
B\oplus C=B\otimes I_{\small C}\,+\,I_{\small B}\otimes C
 \qiq e^{B\,\oplus\,C}=e^B\otimes e^C
$$
The Kronecker product can be used to separate the integrand
$$\eqalign{
\LR{\b\eMs\o}^2 &= \LR{\b\eMs\o}\otimes\LR{\b\eMs\o} \\
 &= \LR{\b\otimes\b} \LR{\eMs\otimes\eMs} \LR{\o\otimes\o} \\
 &= \LR{\b\otimes\b} \eAs \LR{\o\otimes\o} \\
}$$
where the matrix $A=M\oplus M$ has been introduced to simplify the expression.
The integral of the matrix exponential can be written in terms of the phi-function, i.e.
$$\eqalign{
&\phi(x)
 \;=\; \sum_{k=0}^\infty \frac{x^k}{(k+\o)!}
 \;=\; \LR{\frac{e^x-\o}{x}} \\
&\int\eAs\:ds \;=\; s\cdot\phi(As) \:+\: C \\
}$$
Like $e^x$, the Taylor series for $\phi(x)$ has an infinite radius of convergence so it is defined for all
$x\;\big({\rm e.g.}\;\phi(0)=\o\big)\,$ and it can be evaluated using a matrix argument even if the matrix is singular.
Putting it all together, the integral can be evaluated as
$$\eqalign{
\J &= \int_{x_1}^{x_2}\LR{\b e^{M(x-u)}\o}^2 dx \\
 &= \LR{\b\otimes\b}\L[\int_{s_1}^{s_2}\eAs\:ds\R]\LR{\o\otimes\o} \\
 &= \LR{\b\otimes\b}
    \bigg[s_2\,\phi(As_2)-s_1\,\phi(As_1)\bigg]
    \LR{\o\otimes\o} \\
}$$
