Arbitrary Matrices Solving I'm trying to solve some equations with arbitrary matrices. My Problem is that I don't know what way to solve the equation should be taken.
Examples:


*

*Solve for $X$. $X,A$ are arbitrary matrices.
$XA+A^T = I $

*Solve for $X$. $X,A,B$ are arbitrary matrices and $C-2A^T$ is invertible.
$X^TC = 2 A(X+B)$
I solved the equations for some values (which I randomly chose), but cannot get the grip by doing it for generally.
 A: Since 1.) is already solved here, I will answer 2.):
$$
\begin{eqnarray}
X^T C-2AX &=& B  &(1)\\
C^T X - 2X^T A^T &=& B^T &(2)\\
\end{eqnarray}
$$
Now add $(1)$ and $(2)$:
$$
\begin{eqnarray}
X^T\underbrace{\left(C-2A^T\right)}_{D}+\underbrace{\left(C^T-2A\right)}_{D^T}X&=&B+B^T \tag{1+2}.\\
\end{eqnarray}
$$
Now let's multiply by $D^{-1}$ from the right:
$$
X^T + D^T X D^{-1} = \left(B+B^T\right)D^{-1}
$$
and use the following (to me known as superoperator formalism) representation of the problem:
$$
\text{vec}(AXB) = (B^T \otimes A) \text{vec}(X).
$$
(see here for a definition of $\text{vec}(X)$...).
We get:
$$
\hat{T}\text{vec}(X) + \left((D^{-1})^T\otimes D \right) \text{vec}(X)=\text{vec}\left((B+B^T)D^{-1}\right),
$$
where $\hat{T}$ is the superoperator representation of the transposition operation (essentially a permutation matrix, that is not representable as product $A\otimes B$).
We finally get:
$$
\text{vec}(X)= \left[\hat{T} + \left((D^{-1})^T\otimes D \right) \right]^{-1}\text{vec}\left((B+B^T)D^{-1}\right)
$$
