# Faddeev–LeVerrier algorithm

In mathematics (linear algebra), the Faddeev–LeVerrier algorithm is a recursive method to calculate the coefficients of the characteristic polynomial $p_{A}(\lambda )=\det(\lambda I_{n}-A)$ of a square matrix, A, named after Dmitry Konstantinovich Faddeev and Urbain Le Verrier. Calculation of this polynomial yields the eigenvalues of A as its roots; as a matrix polynomial in the matrix A itself, it vanishes by the Cayley–Hamilton theorem. Computing the characteristic polynomial directly from the definition of the determinant is computationally cumbersome insofar as it introduces a new symbolic quantity $\lambda$; by contrast, the Faddeev-Le Verrier algorithm works directly with coefficients of matrix $A$.
The algorithm has been independently rediscovered several times in different forms. It was first published in 1840 by Urbain Le Verrier, subsequently redeveloped by P. Horst, Jean-Marie Souriau, in its present form here by Faddeev and Sominsky, and further by J. S. Frame, and others. (For historical points, see Householder. An elegant shortcut to the proof, bypassing Newton polynomials, was introduced by Hou. The bulk of the presentation here follows Gantmacher, p. 88.)

## The Algorithm

The objective is to calculate the coefficients c$_k$ of the characteristic polynomial of the n×n matrix A,
       $p_{A}(\lambda )\equiv \det(\lambda I_{n}-A)=\sum _{k=0}^{n}c_{k}\lambda ^{k}~,$
where, evidently, c$_n$ = 1 and c$_0$ = (−1)$^n$ det A.
The coefficients c$_{n-i}$ are determined by induction on i, using an auxiliary sequence of matrices
    ${\begin{aligned}M_{0}&\equiv 0&c_{n}&=1\qquad &(k=0)\\M_{k}&\equiv AM_{k-1}+c_{n-k+1}I\qquad \qquad &c_{n-k}&=-{\frac {1}{k}}\mathrm {tr} (AM_{k})\qquad &k=1,\ldots ,n~.\end{aligned}}$
Thus,
    $M_{1}=I~,\quad c_{n-1}=-\mathrm {tr} A=-c_{n}\mathrm {tr} A;$
    $M_{2}=A-I\mathrm {tr} A,\quad c_{n-2}=-{\frac {1}{2}}{\Bigl\mathrm {tr} A^{2}-(\mathrm {tr} A)^{2}{\Bigr )}=-{\frac {1}{2}}(c_{n}\mathrm {tr} A^{2}+c_{n-1}\mathrm {tr} A);$
    $M_{3}=A^{2}-A\mathrm {tr} A-{\frac {1}{2}}{\Bigl\mathrm {tr} A^{2}-(\mathrm {tr} A)^{2}{\Bigr )}I,$
       $c_{n-3}=-{\tfrac {1}{6}}{\Bigl(\operatorname {tr} A)^{3}-3\operatorname {tr} (A^{2})(\operatorname {tr} A)+2\operatorname {tr} (A^{3}){\Bigr )}=-{\frac {1}{3}}(c_{n}\mathrm {tr} A^{3}+c_{n-1}\mathrm {tr} A^{2}+c_{n-2}\mathrm {tr} A);$
etc.,  ...;
    $M_{m}=\sum _{k=1}^{m}c_{n-m+k}A^{k-1}~,$
    $c_{n-m}=-{\frac {1}{m}}(c_{n}\mathrm {tr} A^{m}+c_{n-1}\mathrm {tr} A^{m-1}+...+c_{n-m+1}\mathrm {tr} A)=-{\frac {1}{m}}\sum _{k=1}^{m}c_{n-m+k}\mathrm {tr} A^{k}~;...$
Observe A$^{−1}$ = − M$_n$ /c$_0$ = (−1)$^{n−1}$M$_n$/detA terminates the recursion at λ. This could be used to obtain the inverse or the determinant of A.

## Derivation

The proof relies on the modes of the adjugate matrix, B$_k$ ≡ M$_{n−k}$, the auxiliary matrices encountered.  This matrix is defined by
       $(\lambda I-A)B=I~p_{A}(\lambda )$
and is thus proportional to the resolvent
    $B=(\lambda I-A)^{-1}I~p_{A}(\lambda )~.$
It is evidently a matrix polynomial in λ of degree n−1. Thus,
       $B\equiv \sum _{k=0}^{n-1}\lambda ^{k}~B_{k}=\sum _{k=0}^{n}\lambda ^{k}~M_{n-k},$
where one may define the harmless M$_0$≡0.
Inserting the explicit polynomial forms into the defining equation for the adjugate, above,
    $\sum _{k=0}^{n}\lambda ^{k+1}M_{n-k}-\lambda ^{k}(AM_{n-k}+c_{k}I)=0~.$
Now, at the highest order, the first term vanishes by M$_0$=0; whereas at the bottom order (constant in λ, from the defining equation of the adjugate, above),
    $M_{n}A=B_{0}A=c_{0}~,$
so that shifting the dummy indices of the first term yields
    $\sum _{k=1}^{n}\lambda ^{k}{\BigM_{1+n-k}-AM_{n-k}+c_{k}I{\Big )}=0~,$
which thus dictates the recursion
    $\therefore \qquad M_{m}=AM_{m-1}+c_{n-m+1}I~,$
for m=1,...,n. Note that ascending index amounts to descending in powers of λ, but the polynomial coefficients c are yet to be determined in terms of the Ms and A.
This can be easiest achieved through the following auxiliary equation (Hou, 1998),
       $\lambda {\frac {\partial p_{A}(\lambda )}{\partial \lambda }}-np=\operatorname {tr} AB~.$
This is but the trace of the defining equation for B by dint of Jacobi's formula,
    ${\frac {\partial p_{A}(\lambda )}{\partial \lambda }}=p_{A}(\lambda )\sum _{m=0}^{\infty }\lambda ^{-(m+1)}\operatorname {tr} A^{m}=p_{A}(\lambda )~\operatorname {tr} {\frac {I}{\lambda I-A}}\equiv \operatorname {tr} B~.$
Inserting the polynomial mode forms in this auxiliary equation yields
    $\sum _{k=1}^{n}\lambda ^{k}{\Bigkc_{k}-nc_{k}-\operatorname {tr} AM_{n-k}{\Big )}=0~,$
so that
    $\sum _{m=1}^{n-1}\lambda ^{n-m}{\Bigmc_{n-m}+\operatorname {tr} AM_{m}{\Big )}=0~,$
and finally
    $\therefore \qquad c_{n-m}=-{\frac {1}{m}}\operatorname {tr} AM_{m}~.$
This completes the recursion of the previous section, unfolding in descending powers of λ.
Further note in the algorithm that, more directly,
    $M_{m}=AM_{m-1}-{\frac {1}{m-1}}(\operatorname {tr} AM_{m-1})I~,$
and, in comportance with the Cayley–Hamilton theorem,
    $\operatorname {adj} (A)=(-1)^{n-1}M_{n}=(-1)^{n-1}(A^{n-1}+c_{n-1}A^{n-2}+...+c_{2}A+c_{1}I)=(-1)^{n-1}\sum _{k=1}^{n}c_{k}A^{k-1}~.$
The final solution might be more conveniently expressed in terms of complete exponential Bell polynomials as
    $c_{n-k}={\frac {(-1)^{n-k}}{k!}}{\mathcal {B}}_{k}{\Bigl\operatorname {tr} A,-1!~\operatorname {tr} A^{2},2!~\operatorname {tr} A^{3},\ldots ,(-1)^{k-1}(k-1)!~\operatorname {tr} A^{k}{\Bigr )}.$

## Example

    ${\displaystyle A=\left[{\begin{array}{rrr}3&1&5\\3&3&1\\4&6&4\end{array}}\right]}$
${\displaystyle {\begin{aligned}M_{0}&=\left[{\begin{array}{rrr}0&0&0\\0&0&0\\0&0&0\end{array}}\right]\quad &&&c_{3}&&&&&=&1\\M_{\mathbf {\color {blue}1} }&=\left[{\begin{array}{rrr}1&0&0\\0&1&0\\0&0&1\end{array}}\right]&A~M_{1}&=\left[{\begin{array}{rrr}\mathbf {\color {red}3} &1&5\\3&\mathbf {\color {red}3} &1\\4&6&\mathbf {\color {red}4} \end{array}}\right]&c_{2}&&&=-{\frac {1}{\mathbf {\color {blue}1} }}\mathbf {\color {red}10} &&=&-10\\M_{\mathbf {\color {blue}2} }&=\left[{\begin{array}{rrr}-7&1&5\\3&-7&1\\4&6&-6\end{array}}\right]\qquad &A~M_{2}&=\left[{\begin{array}{rrr}\mathbf {\color {red}2} &26&-14\\-8&\mathbf {\color {red}-12} &12\\6&-14&\mathbf {\color {red}2} \end{array}}\right]\qquad &c_{1}&&&=-{\frac {1}{\mathbf {\color {blue}2} }}\mathbf {\color {red}(-8)} &&=&4\\M_{\mathbf {\color {blue}3} }&=\left[{\begin{array}{rrr}6&26&-14\\-8&-8&12\\6&-14&6\end{array}}\right]\qquad &A~M_{3}&=\left[{\begin{array}{rrr}\mathbf {\color {red}40} &0&0\\0&\mathbf {\color {red}40} &0\\0&0&\mathbf {\color {red}40} \end{array}}\right]\qquad &c_{0}&&&=-{\frac {1}{\mathbf {\color {blue}3} }}\mathbf {\color {red}120} &&=&-40\end{aligned}}}$
Furthermore, ${\displaystyle M_{4}=A~M_{3}+c_{0}~I=0}$, which confirms the above calculations.
The characteristic polynomial of matrix A is thus ${\displaystyle p_{A}(\lambda )=\lambda ^{3}-10\lambda ^{2}+4\lambda -40}$; the determinant of A is ${\displaystyle \det(A)=(-1)^{3}c_{0}=40}$; the trace is 10=−c$_2$; and the inverse of A is
    ${\displaystyle A^{-1}=-{\frac {1}{c_{0}}}~M_{3}={\frac {1}{40}}\left[{\begin{array}{rrr}6&26&-14\\-8&-8&12\\6&-14&6\end{array}}\right]=\left[{\begin{array}{rrr}0{.}15&0{.}65&-0{.}35\\-0{.}20&-0{.}20&0{.}30\\0{.}15&-0{.}35&0{.}15\end{array}}\right]}$.

## An equivalent but distinct expression

A compact determinant of an m×m-matrix solution for the above Jacobi's formula may alternatively determine the coefficients c,
    $c_{n-m}={\frac {(-1)^{m}}{m!}}{\begin{vmatrix}\operatorname {tr} A&m-1&0&\cdots &0\\\operatorname {tr} A^{2}&\operatorname {tr} A&m-2&\cdots &0\\\vdots &\vdots &&&\vdots \\\operatorname {tr} A^{m-1}&\operatorname {tr} A^{m-2}&\cdots &\cdots &1\\\operatorname {tr} A^{m}&\operatorname {tr} A^{m-1}&\cdots &\cdots &\operatorname {tr} A\end{vmatrix}}~.$