I see that Matlab uses the spectral decomposition to solve the continuous Lyapunov equation
$$AX+XA=B$$
The formula they use for positive definite $A$ with matrix of eigenvectors $U$ and column vector of eigenvalues $s$ is as follows
$$U \left( \frac{U' BU}{s + s'} \right) U'$$
(Addition of row and column is done with NumPy broadcasting rules)
Any suggestions on how to derive this?
Insert $A=U\Sigma U'$, $Σ=diag(s_1,...,s_n)$, into the equation $$ UΣU′X+XUΣU′ =B\implies ΣU′XU+U′XUΣ=U′BU. $$ Now with $Y=U′XU$ and $C=U′BU$ the equation on the element level is $$s_iY_{ij}+Y_{ij}s_j=C_{ij}$$ so that $$Y_{ij}=\frac{C_{ij}}{s_i+s_j}.$$ After this elementwise division reconstruct $X=UYU'$ with matrix operations.