*Note: I posted my question on [math.stackexchange](https://math.stackexchange.com/questions/2016550/integral-of-the-square-of-the-exponential-of-a-matrix?noredirect=1#comment4140463_2016550) 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}$.



Integral of the entrywise square of the exponential of a matrix
Inspired strongly by Anthony's answer, here is a formula that works for arbitrary $A$. Let $M$ be the $n^2 \times n^2$ square matrix given by $$M= A \otimes I\_n + I\_n \otimes A\_n$$
i.e. in terms of indices


$$ M\_{ij,kl}=A\_{i,k} \delta\_{j,l} + \delta\_{i,k}A\_{j,l}$$


Then because $A \otimes I\_n$ and $I\_n \otimes A$ commute, $$e^{Mt} = (e^{At} \otimes I\_n) (I\_n \otimes e^{At}) = e^{At} \otimes e^{At}$$ i.e. in indices $$(e^{M t})\_{ij,kl} = (e^{A t})\_{i,j} (e^{At})\_{k,l}$$ so in particular $$(e^{At})\_{i,j}^2 = (e^{Mt})\_{ii,jj}$$ and $$\int\_t (e^{At})\_{i,j}^2 = \int\_t (e^{Mt})\_{ii,jj} = - (M^{-1})\_{ii,jj}$$


(Here I am using commas to separate the two indices of a matrix entry)


