I was trying to solve an optimization problem and the problem is simplified to solve
$X - X^{-1} = W$ and $X$ is symmetric matrix.
I was given the hint that I can perform eigenvalue decompoisiton on $W$, and construct a diagonal solution to obtain $X$, but not sure how to implement it as I'm not good at linear algebra.
Any idea or thoughts on this?
If $(v_i, \lambda_i)$ is an eigenpair of $X$, then $$X v_i - X^{-1} v_i = W v_i\Rightarrow Wv_i = (\lambda_i - \lambda_i^{-1}) v_i, $$ Therefore, $(v_i, \lambda_i - \lambda_i^{-1})$ is an eigenpair of $W$. So you can solve the eigendecomposition of $W$ first.
For each eigenvalue $\mu_i$ of $W$, solve $\lambda_ i - \lambda_i^{-1} = \mu_i$, thus $\lambda_i = \frac{1}{2}(\mu_i \pm \sqrt{\mu_i^2 + 4})$. Note there are two solutions for each, not sure if your problem has additional requirements, e.g. positive definiteness of $X$?
For instance, in MATLAB