Inverse of symmetric matrix plus identity matrix

Let $p(x)=\sum_{k=0}^na_kx^k$ (with $a_n=1$) and $q(x)$ be the characteristic polynomials of $A$ and $B=I+A$ respectively. By Cayley-Hamilton theorem, $B^{-1}=g(B)$ where \begin{align} g(x) &=\frac{q(0)-q(x)}{xq(0)}\\ &= \frac{p(-1)-p(x-1)}{xp(-1)}\\ &=\frac{-\sum_{j=0}^n a_j[(x-1)^j - (-1)^j]}{xp(-1)}\\ &=\frac{-\sum_{j=1}^n a_j \sum_{k=0}^{j-1}(-1)^{j-1-k}(x-1)^k} {\sum_{j=0}^n (-1)^ja_j}\\ &=\frac{-\sum_{j=0}^{n-1} a_{j+1} \sum_{k=0}^j(-1)^{j-k}(x-1)^k}{\sum_{j=0}^n (-1)^ja_j}. \end{align} Therefore, $(I+A)^{-1}$ can be expressed in terms of $A$ by $f(A)$, where \begin{align} f(x) &=\frac{-\sum_{j=0}^{n-1} a_{j+1} \sum_{k=0}^j(-1)^{j-k}x^k} {\sum_{j=0}^n (-1)^ja_j}\\ &=\frac{-\sum_{k=0}^{n-1} x^k \sum_{j=k}^{n-1} (-1)^{j-k} a_{j+1}} {\sum_{j=0}^n (-1)^ja_j}\\ &=\frac{-\sum_{k=0}^{n-1} x^k \sum_{j=0}^{n-1-k} (-1)^j a_{j+k+1}} {\sum_{j=0}^n (-1)^ja_j}. \end{align} That is, $$ (I+A)^{-1}=\frac{-\sum_{k=0}^{n-1}\left[\sum_{j=0}^{n-1-k} (-1)^j a_{j+k+1}\right] A^k} {\sum_{j=0}^n (-1)^ja_j}.\tag{1} $$ It is well-known that each coefficient $a_i$ can be expressed in terms of the traces of the powers of $A$. More specifically, by Girard-Waring formula, if we define $s_k=\operatorname{tr}(A^k)$, then $$ a_{n-m} = \sum_{\substack{k_1+2k_2+\cdots+mk_m=m\\ k_1,k_2,\ldots,k_m\ge0}}(-1)^{k_1+k_2+\cdots+k_m}\frac{1}{k_1!k_2!\cdots k_m!}\left(\frac{s_1}1\right)^{k_1}\left(\frac{s_2}2\right)^{k_2}\cdots\left(\frac{s_m}m\right)^{k_m}.\tag{2} $$ In particular, when $n=5$, we have $a_5=1,\ a_0=-\det(A)$ and \begin{align} a_1 &=-\frac{s_4}4 + \frac{s_2^2}8 + \frac{s_1s_3}3 - \frac{s_1^2s_2}4 + \frac{s_1^4}{24},\\ a_2&= -\frac{s_3}3 + \frac{s_1s_2}2 - \frac{s_1^3}6,\\ a_3&= \frac{s_1^2-s_2}2,\\ a_4&= -s_1, \end{align} but surely, if $A^{-1}$ is also known, we would express $a_1$ as $\det(A)\operatorname{tr}(A^{-1})$ instead. Plug these into $(1)$, you can express $(I+A)^{-1}$ as a weighted sum of the powers of $A$ when $n=5$.