I am trying to find roots for a particular function. It has reduced to the following expression.
$$ \frac{d f(\lambda)}{d \lambda}=8\lambda + 2\text{Trace}(Q\Sigma Q^\top)- \sum_i \frac{2 M_i}{1- 2\lambda M_i} $$
$M$ is a diagonal matrix with the eigenvalues of $Q\Sigma Q^\top$. I refer $i$ as the diagonal values.
How to solve and find roots for $8\lambda + 2\text{Trace}(Q\Sigma Q^\top)- \sum_i \frac{2 M_i}{1- 2\lambda M_i} =0$?
Note that $tr(Q\Sigma Q^T)=\sum_im_i$ if I correctly understand the question.
Then the considered equation (I assume that the unknown is $\lambda$) is $8\lambda+\sum_i(2m_i-\dfrac{2m_i}{1-2\lambda m_i})=8\lambda-4\lambda \sum_i \dfrac{m_i^2}{1-2\lambda m_i}=0$ and $\lambda=0$ is a solution.
Otherwise $2=\sum_i \dfrac{m_i^2}{1-2\lambda m_i}$ and you must find the real roots of a polynomial of degree $n$.