Solution
= Solution
Repeated substitution in the <affine iteration> gives
$$
x_k=M^{k-1}x_1+(I+M+\cdots+M^{k-2})c.
$$
Therefore the required <matrix polynomials> are
$$
\boxed{f(M)=M^{k-1},\qquad g(M)=\sum_{j=0}^{k-2}M^j.}
$$
These formulas do not require an inverse. If $I-M$ is an <invertible matrix>, multiplying the finite geometric sum by $I-M$ gives $g(M)=(I-M^{k-1})(I-M)^{-1}$.