The theorem
For an n×n matrix A, let its characteristic polynomial be
p(λ)=det(λI−A)=λn+cn−1λn−1+⋯+c1λ+c0.
The Cayley–Hamilton theorem says A satisfies its own characteristic equation: substituting A for λ (and A0=I) gives the zero matrix,
p(A)=An+cn−1An−1+⋯+c1A+c0I=0.
The constant term is c0=p(0)=det(−A)=(−1)ndetA.
Why it hands you the inverse
Move the constant term to the other side and factor an A out of every remaining term:
A(An−1+cn−1An−2+⋯+c1I)=−c0I.
If A is invertible then c0=(−1)ndetA=0, so multiply by A−1/(−c0):
A−1=−c01(An−1+cn−1An−2+⋯+c1I).
The inverse is just a polynomial in A — you only ever need powers of A up to An−1, never a single cofactor.
Building p(λ) for a 3×3 matrix (the konkur case)
Write it from the three invariants of A:
p(λ)=λ3−(trA)λ2+m2λ−detA,
where trA is the sum of the diagonal, m2 is the sum of the three principal 2×2 minors (delete row/column i for i=1,2,3), and detA is the determinant. By Cayley–Hamilton,
A3−(trA)A2+m2A−(detA)I=0 ⟹ A−1=detA1(A2−(trA)A+m2I).
Mini-example
Let A=[1324]. Here trA=5 and detA=1⋅4−2⋅3=−2, so the characteristic polynomial is p(λ)=λ2−5λ−2. Cayley–Hamilton gives A2−5A−2I=0, hence
A−1=−21(A−5I)=−21[1−5324−5]=−21[−432−1]=[−2231−21].
A quick check: AA−1=I. (For 2×2 this reproduces the familiar detA1[d−c−ba] formula.)
Exam trick: for a 3×3 matrix, compute only the three invariants trA, m2, detA, form A2 once, and read off A−1=detA1(A2−(trA)A+m2I). This is faster and far less error-prone than the 9 cofactors of the adjugate method — and it instantly catches a singular matrix (if detA=0, the c0 term vanishes and no inverse exists).