Consider a matrix $A$ with given eigenvalues. Given any expression involving $A$ and its inverse as $f(A)$. If I wish to find $\det(f(A))$, is there any algorithmic approach that may be followed to achieve the result. For example, consider the problem below:
Eigenvalues of $A$ are $1,2,-1$, $B=f(A)=I+A-A^{-1}+A^{2}$. Find $\det(B)$.
I do not have any idea on how to come up with a generalised approach for solving this kind of problem. It is absolutely clear that Cayley Hamilton theorem has to be used somehow, but how exactly is not clear. Any hints are appreciated. Thanks.
According to the Spectral Mapping Theorem, the eigenvalues of $f(A)$ are precisely $$f(1), f(2), f(-1)$$ and therefore since the determinant is the product of eigenvalues $$\det f(A) = f(1)f(2)f(-1).$$ In general we have $$\det f(A) = \prod_{\lambda \in \sigma(A)} f(\lambda)$$ where the eigenvalues are taken with multiplicity.