For a real square matrix $S$ with all eigenvalues on the imaginary axis, does the following hold? Given a real square matrix $S$ which has all the eigenvalues on the imaginary axis, is it true that there exists a positive definite matrix $P=P^{T}>0$ such that 
\begin{equation}
 S^T{P}+PS=0? 
\end{equation}
I found that claim in a research paper (which is not yet available online!) but I do not find a way to prove this. 
While trying to do an example problem, I noticed that for a matrix 
\begin{equation}
S=\begin{bmatrix}\omega & \sigma\\-\sigma & \omega\end{bmatrix}, 
\end{equation}
the claim holds if $P$ is an identity matrix. Additionally, for any block-diagonal matrix $S_1$ with the diagonal matrix being in the same form as $S$, there exists a corresponding unique $P$ which satisfies the claim. 
But in general, the matrix which has all eigenvalues on the imaginary axis, needs not have the same form as $S_1$, and is there a way to show that there exists a unique $P$ for which the claim holds? 
 A: The answer is no. Here $S\in M_n(\mathbb{R})$ where $n$ is even.
Choose $n=4,S=\begin{pmatrix}U&I_2\\0&U\end{pmatrix}$ where $U=\begin{pmatrix}0&1\\-1&0\end{pmatrix}$. Let $P=[p_{i,j}]\in M_4(\mathbb{R})$ s.t. $S^TP+PS=0$.
With an easy calculation, we find that $P$ is in the form $\begin{pmatrix}0&0&0&-a\\0&0&a&0\\0&a&b&0\\-a&0&0&b\end{pmatrix}$; thus $P$ cannot be symmetric $>0$.
A: That $S^TP+PS=0$ means $PS$ is skew-symmetric. In turn, $P^{-1/2}(PS)P^{-1/2}=P^{1/2}SP^{-1/2}$ is skew-symmetric too. Thus a necessary condition for $P$ to exist is that $S$ is diagonalisable over $\mathbb C$.
This condition is also sufficient: if $S$ is diagonalisable over $\mathbb C$, it admits a real Jordan form $S=M^{-1}KM$. As $S$ has a purely imaginary spectrum and non-real eigenvalues of a real matrix must occur in conjugate pairs, $K$ is skew-symmetric. Hence $PS=M^TKM$ is skew-symmetric for $P=M^TM>0$.
A: Since $P$ is also real we have $P=P^*$ therefore $$P=P^H$$using Schur decomposition for $P$ we have$$P=UDU^H$$ where $D$ is diagonal with all the entries being real. For satisfying $S^TP+PS=0$ (or equivalently $S^HP+PS=0$) we must have:$$P^{-1}S^HP+S=0\\UD^{-1}U^HS^HUDU^H+S=0\\D^{-1}U^HS^HUDU+U^HSU=0$$defining $T=U^HSU$ we have$$D^{-1}TD+T=0$$or $$TD+DT=0$$ also by daggering it $$T^HD+DT^H=0$$which yields to $$D(T+T^H)+(T+T^H)D=0$$defining $V=T+T^H$ where $V$ is also hermition we obtain$$DV+VD=0$$The (ith,jth) entry of $DV$ is $d_{ii}v_{ij}$ and the (ith,jth) entry of $VD$ is $d_{jj}v_{ij}$ where$$d_{ii}v_{ij}+d_{jj}v_{ij}=0$$ which means that $v_{ij}=0$ for all $i,j$ since $D$ is positive definite and $d_{ii}>0\quad,\quad\forall i$. This means that $V=0$ or $T^H=-T$ or equivalently $S^H=-S$ which is the only solution with $P=I$.
