Why is the trace of $A$ equal to the determinant? I am new to matrix algebra, and trying to understand why
$\operatorname{tr} A = \det A$, where
$$A = \begin{pmatrix}
    1 & -1 & \ldots & -1\\
    1 & 1 & 0 &0\\
    \vdots & 0 & \ddots & 0 \\
    1&0&\ldots&1
    \end{pmatrix}$$
To be clear about my notation, all off diagonal elements are zeroes except the elements in the first column and first row. The proof of this could be done by using mathematical induction, yet I am interested in knowing why it is true from the matrix algebra perspective.
 A: We can write $$A = \begin{bmatrix}1 & -\vec{1}_n^T \\ \vec{1}_n & I_n\end{bmatrix}$$ where $\vec{1}_n$ is a column vector of $n$ ones and $I_n$ is the $n \times n$ identity matrix. Trivially, $\text{tr}(A) = n+1$. The block matrix determinant formula states that $$\det\left(\begin{bmatrix}A_{11} & A_{12} \\ A_{21} & A_{22}\end{bmatrix}\right) = \det(A_{22})\det(A_{11}-A_{12}A_{22}^{-1}A_{21})$$ provided that $A_{22}$ is invertible. Applying that formula here gives us $$\det(A) = \det(I_n) \det(1+\vec{1}_n^TI_n^{-1}\vec{1}_n) = \det(I_n)\det(1+\vec{1}_n^T\vec{1}_n) = \det(I_n)\det(n+1) = n+1.$$ So $\text{tr}(A) = \det(A) = n+1$.
A: Clearly $A$ has trace $n$. If you only want to prove that $\det(A)=n$, simply add the last $n-1$ rows to the first row.
You may also transform $A$ into a matrix whose trace is evidently equal to whose determinant. Consider $B=A-I$ first. Subtract the second row of $B$ from the last $n-2$ rows. Then add the last $n-2$ columns to the second column. This is a similarity transform. The result is
$$
\widetilde{B}=\pmatrix{0&-(n-1)&-1&\cdots&-1\\ 1\\ 0\\ \vdots\\ 0}
$$
where the blank entries are zero. Since $B$ is similar to $\widetilde{B}$, the matrix $A=I+B$ is similar to
$$
\widetilde{A}=I+\widetilde{B}=\pmatrix{X&\ast\\ 0&I_{n-2}},\text{ where }X=\pmatrix{1&-(n-1)\\ 1&1}.
$$
It is now evident that
$$
\det(A)=\det(\widetilde{A})=\det(X)\det(I_{n-2})=n=\operatorname{tr}(X)+\operatorname{tr}(I_{n-2})=\operatorname{tr}(\widetilde{A})=\operatorname{tr}(A).
$$
