A determinant coming out from the computation of a volume form

I am convinced that the following identity is true: \begin{equation} \det\begin{bmatrix} 1+a_1^2 & a_1 a_2 & a_1 a_3 & \ldots & a_1a_n \\ a_1a_2 & 1+a_2^2 & a_2a_3 & \ldots & a_2a_n \\ \ldots &\ldots &\dots & \ldots & \ldots \\ a_na_1 &a_na_2 & a_na_3 &\ldots &1+a_n^2 \end{bmatrix}= 1+ a_1^2+a_2^2+\dots+a_n^2. \end{equation} Can you help me proving it?


This determinant comes out in the computation of the volume form on a n-dimensional surface on $\mathbb{R}^{n+1}$ described by the equation \begin{equation} x_{n+1}=f(x_1\ldots x_n). \end{equation} The volume form is given by $\sqrt{g}dx_1\ldots dx_{n}$, where $g$ is the determinant above with $a_j=\partial_{x_j}f$. The result proven in this question & answer shows that the volume form is $$ \sqrt{1+\sum_{j=1}^n \left(\frac{\partial f}{\partial x_j}\right)^2}\, dx_1\ldots dx_n.$$


The matrix can be expressed as $\mathbf{I}+\mathbf{a}\mathbf{a}^T$, where $\mathbf{I}\in\mathbb{R}^{n\times n}$ is the identity matrix, and vector $\mathbf{a}=[a_1\ a_2\ a_3\ \cdots\ a_n]^T\in\mathbb{R}^{n\times 1}$ is a column vector.

Now matrix $\mathbf{a}\mathbf{a}^T$ has rank $1$ and so it has a single non-zero eigenvalue, which will be equal to the trace of this matrix (as the trace of a matrix is equal to the sum of its eigenvalues), which is $\sum_{i=1}^na_i^2$.

Next, we use the property that the eigenvalues of matrix (of dimension $n$, so that there are $n$ eigenvalues) $\mathbf{I}+\mathbf{B}$ will equal either $1+\lambda_m(\mathbf{B})$, where $\lambda_m(\mathbf{B})$ is the $m$th eigenvalue of matrix $\mathbf{B}$, or $1$, if $\mathbf{B}$ is not full rank.

Having found the single non-zero eigenvalue of $\mathbf{a}\mathbf{a}^T$, there will be $n$ eigenvalues of $\mathbf{I}+\mathbf{a}\mathbf{a}^T$, with one equal to $1+\sum_{i=1}^na_i^2$, and the rest i.e. $(n-1)$ eigenvalues being $1$.

The determinant of the matrix is simply the product of its eigenvalues, and so will be $1+\sum_{i=1}^na_i^2$, which is what you rightly conjecture.