TITLE: A Linear Algebra Problem
QUESTION [7 upvotes]: Given a matrix $A\in \mathbb{R}^{n\times n}$, I am looking for 
a symmetric matrix $S\in\mathbb{R}^{n\times n}$ such that
$$
S A + A^T S = I
$$
$A$ can be assumed to be regular (with positive determinant, if this is of any help).
The difficulty is of course that $S$ must be symmetric, otherwise one could simply take $2S = A^{-T}$. In principle this is a linear equation with $\frac{n(n+1)}{2}$ unknowns and this can be solved for $S$. 
Is there a nicer way to find $S$ such as a closed solution formula using some factorization? Has this problem been studied anywhere?

REPLY [11 votes]: These matrix equations are called Lyapunov equations and are extensively studied in control theory.
For instance, if $A$ is Hurwitz (all eigenvalues in the left half-plane), then the unique symmetric solution of $A^TX+XA+Q$ is
$$
X=\int_0^\infty e^{A^T t } Q e^{At} dt.
$$