Problem 7-4(a) of John M. Lee's Introduction to Smooth Manifolds asks us to show that for any matrix $A\in M(n,\mathbb R)$, we have $$\left.\frac{d}{dt} \det(I_n+tA)\right|_{t=0}=\operatorname{tr}(A)$$ where $\det$ is the usual determinant map. The book's hint is to use the expansion $$\det(B)=\sum_{\sigma\in S_n}\operatorname{sgn}(\sigma)\prod_{i=1}^n b_{i,\sigma(i)},\text{ }B=[b_{ij}]_{i,j=1}^n$$ but when doing calculations with even the simple case $n=3$, I'm getting values that are not equal to $\operatorname{tr}(A)$. Could someone tell me what I'm doing wrong?
My work:
Going through the full determinant expansion for $n=3$, I computed \begin{align*} \det(I_n+tA) &= (1+t a_{11})(1+ta_{22})(1+ta_{33})\\ &- {\color{red}{a_{12}a_{21}(1+ta_{33})}}\\ &- {\color{red}{(1+ta_{11})a_{23}a_{32}}}\\ &- {\color{red}{a_{13}(1+ta_{22})a_{31}}}\\ &+ a_{12}a_{23}a_{31}\\ &+ a_{13}a_{32}a_{21}\\ \end{align*}
Because they're constants, the last two terms $a_{12}a_{23}a_{31},a_{13}a_{32}a_{21}$ vanish when differentiating. The first term $(1+t a_{11})(1+ta_{22})(1+ta_{33})$ expands as $$(1+t a_{11})(1+ta_{22})(1+ta_{33})=1+\operatorname{tr}(A)t+(\text{higher powers of $t$})$$ so, because $\left.\frac{d}{dt}t^n\right|_{t=0}=0$ for $n\geq 2$, we get $$\left.\frac{d}{dt}(1+t a_{11})(1+ta_{22})(1+ta_{33})\right|_{t=0} =\operatorname{tr}(A)$$ What worries me are the terms in red. Their derivatives are \begin{align*} \left.\frac{d}{dt} a_{12}a_{21}(1+ta_{33})\right|_{t=0} &= a_{12}a_{21}a_{33}\\ \left.\frac{d}{dt} (1+ta_{11})a_{23}a_{32}\right|_{t=0} &= a_{11}a_{23}a_{32}\\ \left.\frac{d}{dt} a_{13}(1+ta_{22})a_{31}\right|_{t=0} &= a_{13}a_{22}a_{31}\\ \end{align*} so I've (seemingly) calculated $$\left.\frac{d}{dt} \det(I_n+tA)\right|_{t=0}=\operatorname{tr}(A){\color{red}{-a_{12}a_{21}a_{33}-a_{11}a_{23}a_{32}-a_{13} a_{22}a_{31}}} $$ Does the red part evaluate to $0$? If not, where have I gone wrong? Any help is appreciated.