is there a closed form expression for the following matrix infinite series Consider this infinite sum of matrices. Is there any closed form to express this sum? 
$S=B+ABA^T +A^2B({A^T})^2+A^3B({A^T})^3+...$
And B is diagonal. 
Thanks
 A: Suppose that the infinite sum converges.  Then, as noted in the comments, we must have
$$
ASA^T - S = B
$$
This is a linear equation on $S$ that we can solve.  In particular, let $\operatorname{vec}$ denote the vectorization operator. We then have
$$
(A \otimes A - I) \operatorname{vec}(S) = \operatorname{vec}(B)
$$
where $\otimes$ denotes the Kronecker product.  Assuming invertibility, we can write
$$
\operatorname{vec}(S) = (A \otimes A - I)^{-1} \operatorname{vec}(B)
$$
A sufficient condition for both the invertibility of $A$ and the convergence of the series is that $\rho(A) < 1$ (where $\rho$ denotes the spectral radius).
A: This is the series expansion for the discrete time Lyapunov matrix equation
\begin{equation}
ASA^T - S = B
\end{equation}
mentioned by Hagen von Eitzen. It is central in the model reduction of discrete time dynamical systems. Here B is frequently a matrix of very low rank. The series is convergent if, say, the spectral norm of $A$ is strictly less than $1$. In practice, we distinguish between two cases: either $A$ is small and dense or it is large and sparse. If $A$ is dense, then we use two sided orthogonal transformations $U$ to reduce $A$ to (quasi) upper triangular form $A = UTU^T$. The transformed equation
\begin{equation}
T Y T^T - Y = U^T B U
\end{equation}
can then be solved recursively for the columns of $Y = U^T S U$. Back transformation completes the job. If $A$ is large and sparse and $B$ is low rank, then an iterative method is used, typically a Krylov subspace method or a variant of the low rank alternating direction implicit method.
