TITLE: Integral of the entrywise square of the exponential of a matrix
QUESTION [5 upvotes]: Note: I posted my question on math.stackexchange but got no answer. That is why I am asking it here.
Let $A$ be a $n\times n$ square matrix such that the real part of all eigenvalues are negative. For each $i,j$, let $\exp(At)_{ij}$ be the element $(i,j)$ of the matrix. It is well known that: 
$$ \int_0^\infty \exp(At)_{ij}dt = -(A^{-1})_{ij}$$
Is it possible to simplify a similar expression where each element is squared: 
$$ \int_0^\infty (\exp(At)_{ij})^2 dt = ??$$
I am wondering if it is possible to simplify the above expression. If it helps, I can assume that $A$ is diagonalizable.  Note that unless for one-dimensional matrices, $(\exp(At)_{ij})^2\ne\exp(2At)_{ij}$.

REPLY [2 votes]: Given a Hurwitz matrix $\mathrm A \in \mathbb R^{n \times n}$, let
$$\Phi (t) := \exp(\mathrm A t)$$
be the state transition matrix, and let its $(i,j)$-th entry be denoted by
$$\varphi_{ij} (t) := \mathrm e_i^{\top} \Phi (t) \, \mathrm e_j$$
Hence,
$$\begin{array}{rl } \displaystyle\int_0^{\infty} \left( \varphi_{ij} (t) \right)^2 \, \mathrm d t &= \displaystyle\int_0^{\infty} \left( \mathrm e_i^{\top} \Phi (t) \, \mathrm e_j \right)^2 \, \mathrm d t\\\\ &= \displaystyle\int_0^{\infty} \mathrm e_i^{\top} \Phi (t) \, \mathrm e_j \mathrm e_j^{\top} \Phi^{\top} (t) \, \mathrm e_i \, \mathrm d t\\\\ &= \mathrm e_i^{\top} \underbrace{\left( \displaystyle\int_0^{\infty} \Phi (t) \, \mathrm e_j \mathrm e_j^{\top} \Phi^{\top} (t) \, \mathrm d t \right)}_{=: \mathrm W_c}  \mathrm e_i = \mathrm e_i^{\top} \mathrm W_c \mathrm e_i\end{array}$$
where $\mathrm W_c$ is the controllability Gramian of the pair $(\mathrm A, \mathrm e_j)$ and is the solution to the following controllability Lyapunov equation
$$\boxed{\mathrm A \mathrm W_c + \mathrm W_c \mathrm A^{\top} + \mathrm e_j \mathrm e_j^{\top} = \mathrm O_n}$$
Thus, the $n$ columns of the integral of the entrywise product
$$\int_0^{\infty} \left( \Phi (t) \circ \Phi (t) \right) \mathrm d t$$
are the diagonals of $\mathrm W_c^{(1)}, \mathrm W_c^{(2)}, \dots, \mathrm W_c^{(n)}$, where $\mathrm W_c^{(1)}, \mathrm W_c^{(2)}, \dots, \mathrm W_c^{(n)}$ are the solutions to the following $n$ controllability Lyapunov equations
$$\begin{array}{cl} \mathrm A \mathrm W_c^{(1)} + \mathrm W_c^{(1)} \mathrm A^{\top} + \mathrm e_1 \mathrm e_1^{\top} &= \mathrm O_n\\ \mathrm A \mathrm W_c^{(2)} + \mathrm W_c^{(2)} \mathrm A^{\top} + \mathrm e_2 \mathrm e_2^{\top} &= \mathrm O_n\\ \vdots  & \\ \mathrm A \mathrm W_c^{(n)} + \mathrm W_c^{(n)} \mathrm A^{\top} + \mathrm e_n \mathrm e_n^{\top} &= \mathrm O_n\end{array}$$