Consider $\frac{dX}{dt}(t)=AX(t) + X(t)A^{T} + BX(t)B^{T}$ with $X(0)=X_0$, where $X$ is a square matrices, and $A$, $B$ and $X_0$ are diagonal matrices.
When is $X$ diagonal?
For the equation $\frac{dX}{dt}=AX + XA^{T} + BB^{T}$, if the initial condition $X_0$ is diagonal, then what we have is just multiple scalar valued ODEs, so it is clear. But in the presence of $BXB^{T}$ I am not really sure. I thought of Euler methods, and argue each step $\hat{X}$ is diagonal, and then argue a convergence etc., but I want to think about an infinite dimensional setting as well, and wondering if there is a neat way of proving/disproving this.
A newbye answer: the subspace of the diagonal matrices is a linear subspace. if $X_0$ is diagonal then the right hand side of the ODE is diagonal (as long as B and A are diagonal). Hence the subspace of the diagobal matrices is invariant under the flow of that ODE. Thus yes, if A B are diagonal then as long as the initial condition is diagonal you should have a diagonal solution.