$\det(I+A) = 1 + tr(A) + \det(A)$ for $n=2$ and for $n>2$?

If $a_1,a_2,\ldots,a_n$ are the eigenvalues of $A$ then the characteristic polynomial of $A$ is $$ \det(tI-A)=(t-a_1)(t-a_2)\cdots(t-a_n).$$ Therefore

  • $\det(I+A)=(1+a_1)(1+a_2)\cdots(1+a_n) = 1 + \operatorname{tr}A+ \ldots + \det A$

and

  • $\det(I+tA)=(1+ta_1)(1+ta_2)\cdots(1+ta_n)= 1 + t\operatorname{tr}A+ \ldots + t^n\det A$.

One can formally expand $\det(I+tA)$ as a power series of $t$ and get:

$$\begin{align} & \det(I + tA)\\ = & \exp\left(\text{Tr}\log(I+tA)\right)\\ = & \exp\left(t\,\text{Tr}A - \frac{t^2}{2}\text{Tr}A^2 + \frac{t^3}{3}\text{Tr}A^3 + \cdots \right)\\ = & 1 + t\,\text{Tr}A + \frac{t^2}{2!}\left( (\text{Tr}A)^2 - \text{Tr}A^2 \right) + \frac{t^3}{3!}\left((\text{Tr}A)^3 - 3 (\text{Tr}A)(\text{Tr}A^2) + 2 \text{Tr}A^3 \right) + \cdots \end{align}$$

When $A$ is a $n \times n$ matrix, the above expansion terminate at the $t^n$ term with coefficient equal to $\det A$. With this, you can obtain formula similar to what you have for $n = 2$:

$$ \det(I+tA) = \begin{cases} 1 + t\,\text{Tr}A + t^2 \det(A) & n = 2\\ \\ 1 + t\,\text{Tr}A + \frac{t^2}{2!}\left( (\text{Tr}A)^2 - \text{Tr}A^2 \right) + t^3 \det(A) & n = 3\\ \\ 1 + t\,\text{Tr}A + \frac{t^2}{2!}\left( (\text{Tr}A)^2 - \text{Tr}A^2 \right) \\\;\;\;+ \frac{t^3}{3!}\left((\text{Tr}A)^3 - 3 (\text{Tr}A)(\text{Tr}A^2) + 2 \text{Tr}A^3 \right) + t^4 \det(A) & n = 4\\ \end{cases} $$