<s>[INST] Finding determinant of $n \times n$ matrix I need to find a determinant of the matrix:
$$ 
A = \begin{pmatrix}
1 & 2 & 3 & \cdot & \cdot & \cdot & n \\
x & 1 & 2 & 3 & \cdot & \cdot & n-1 \\
x & x & 1 & 2 & 3 & \cdot & n-2 \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
x & x & \cdot & \cdot & x & 1 & 2 \\
x & x & \cdot & \cdot & \cdot & x & 1 \\
     \end{pmatrix}
$$
We know that $x \in R$
So far I managed to transform it to the form:
$$ 
\begin{pmatrix}
1-x & 1 & 1 & \cdot & \cdot & \cdot & 1 \\
0 & 1-x & 1 & 1 & \cdot & \cdot & 1 \\
0 & 0 & 1-x & 1 & 1 & \cdot & 1 \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
\cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
0 & 0 & \cdot & \cdot & 0 & 1-x & 1 \\
x & x & \cdot & \cdot & \cdot & x & 1 \\
     \end{pmatrix}
$$
by the operations: (Let's say $r_i$ is the ith row) 
$$r_1 = r_1 - r_n,r_2 = r_2-r_n, r_3 = r_3 - r_n, ..., r_{n-1} = r_{n-1} - r_n$$
and then  $$r_1 = r_1 - r_2, r_2 = r_2 - r_3, r_3 = r_3 - r_4,...,r_{n-2} = r_{n-2} - r_{n-1}$$
Unfortunately, I have no idea how to eliminate the last row. Any hints?
 [/INST] If $c_i$ is $i$th column of your second determinant, do $c_n= c_n-c_{n-1}$, $c_{n-1}=c_{n-1}-c_{n-2}$, ..., $c_2=c_2-c_1$ to get: $$\left|\begin{array}{ccccccc}
1-x & x & 0 & 0 & \cdots & 0 & 0\\
0 & 1-x & x & 0 & \cdots & 0 & 0\\
0 & 0 & 1-x & x & \cdots & 0 & 0\\
\vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
0 & 0 & 0 & 0 & \cdots & 1-x & x\\
x & 0 & 0 & 0 & \cdots & 0 & 1-x\\
\end{array}\right|$$
This determinant is obviously equal $(1-x)^n+(-1)^{n+1}x^n$ (expand it by the first column).
</s>