One short question. If we have two matrices in fractional form, how to obtain the Eigenvalues[{A,B}] with maximum precision or get it also in fraction form?
2026-03-29 03:20:20.1774754420
On
How to obtain Eigenvalues with maximum precision in Mathematica
2.1k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
12
On
The Mathematica command Eigenvalues[{M,A}] finds the generalized eigenvalues $\lambda$ that satisfy the equation
$ M v = \lambda A v$, for eigenvectors $v$.
Unfortunately, this version of Eigenvalues does not support calculations with exact numbers or symbolic variables.
One way to proceed is to rearrange the generalized eigenvalue equation to
$ A^{-1} M v = \lambda v$, then you can just use Eigenvalues[Inverse[A].M],
provided $A$ is invertible.
Another way to get exact results is to solve it numerically with high precision then use an integer relation algorithm such as RootApproximant to identify the polynomial.
eVals = Eigenvalues[N[{M, A}, 100]];
RootApproximant[eVals, Method -> {"DegreeCost" -> 3}]
but this probably isn't a very sensible way to approach the problem!
The problem is that
Eigenvalues[]does not support matrices with exact entries for the case of the generalized eigenproblem $\mathbf A\mathbf x=\lambda\mathbf B\mathbf x$. If you want to get exact solutions, and $\mathbf B$ is invertible, just executeRootReduce[Eigenvalues[Inverse[B].A]]; here, one does not have to worry about ill-conditioning as in the inexact case. If $\mathbf B$ is not invertible, but $\mathbf A$ is, then you needRootReduce[1/Eigenvalues[Inverse[A].B]](the proof that this works is left as an exercise); if both $\mathbf A$ and $\mathbf B$ are singular, things are more complicated, and I'll just tell you to search for "singular pencils" in your favorite search engine.