We consider generalizations of the Vieta formula (relating the coefficients of an
algebraic equation to the roots) to the case of equations whose coefficients are order-$k$
matrices. Specifically, we prove that if $X_1,\dots ,X_n$ are solutions of an algebraic
matrix equation $X^n+A_1X^{n-1}+\dots +A_n=0,$ independent in the sense that they determine
the coefficients $A_1,\dots ,A_n$, then the trace of $A_1$ is the sum of the traces of the
$X_i$, and the determinant of $A_n$ is, up to a sign, the product of the determinants of
the $X_i$. We generalize this to arbitrary rings with appropriate structures. This result
is related to and motivated by some constructions in non-commutative geometry.