Derivative of determinant Let $f:mat(n,\mathbb
R)\to\mathbb
R$ be given by $f(X)=\det(X)$. I have already proven that $f$ is differentiable in all invertible matrices with corresponding derivative $Df(A):T\mapsto Tr(A^{\#}T)$. I have also proven that the set of invertible matrcies is dense in $mat(n,\mathbb{R})$. Next, I am asked to show that $f$ is differentiable for all matrices. I have a certain clue how why this is true since I would think that since $f$ is differentiable in $A$, there is $\epsilon>0$ such that $f$ is differentiable at $B(A,\epsilon)$ and since the invertible matrices are dense, All matrices are in such a ball. However, I don't know if this reasoningis correct and I struggle to prove it rigorously. Could anyone help please?
 A: The map $f$ is polynomial in the entries of $X$,
$$
\det X =\sum_{s\in S(n)}(-1)^s
x_{1s(1)}
x_{2s(2)}
\dots
x_{ns(n)}
\ ,
$$
so it is differentiable. 
The sum is built over the permutation group $S(n)$ of the indices $1,2,\dots,n$. For a permutation $s\in S(n)$, $(-1)^s$ is the sign of this permutation.
Alternatively, viewing a $\det $ as a map which is multilinear in the columns of $X$, we can consider $D\det$ as a sum over the derivatives with respect to each variable. Explicitly: 
We start with $\det:\Bbb R^{n^2}\to \Bbb R$. Its derivative in a "point" $A$ is by definition a linear map $D\det(A)$, which can be applied in each "vector" (i.e. matrix) $T$ of $\Bbb R^{n^2}$, and delivers an element in $\Bbb R$ as a result. In our case the formula is by multilinearity:
$$
(D\det(A))(T) = \sum_k \det( A_1,\dots,A_{k-1},T_k,A_{k+1},\dots,A_n)\ .
$$
Here, $A_1,\dots,A_n$ are the columns of the matrix $A$. (And correspondingly for $T$.)
(Now, we can use development with respect to the $k$.th column in $\det( A_1,\dots,A_{k-1},T_k,A_{k+1},\dots,A_n)$ to see that $t_{1k}, t_{2k},\dots,t_{nk}$ appear with the coefficients corresponding to the adjoint matrix of $A$. The posted formula is recovered. In all cases, the formula possibly established by using the existence of the inverse on a dense subset, the dense subset of invertible matrices, extends by algebraicity to all matrices. Is is enough for this to mention that $\det$ is polynomial in the entries of $X$.)
