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?
 A: 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).
A: Multiply the last row by $\frac{1-x}{x}$; this means that the determinant you want will be the determinant of the changed matrix times $-\frac{x}{x-1}$. Now subtract $r_1$ from $r_n$
leaving 
$$r_n = (0, -x, -x, -x, \cdots, -x, \frac{(x-1)^2 - x^2}{x})
$$
where I have intentionally written 
$$
\frac{1-x}{x} -1 = \frac{-2x+1}{x} =  \frac{(x-1)^2 - x^2}{x}
$$
Now we have 0 in the last row in columns 1 through 1.  For each remaining column $j$ up to column $n-1$, multiply the last row by $\frac{x-1}{x}$ (giving another power of $\frac{x}{x-1}$ in the factor before the changed matrix),  at which point you can eliminate the
$(1-x)$ in column $j$ of the last row by adding the $j$-th row.  When you do this, the last element of the $n$-th row changes to
$$
\frac{(x-1)^{j}- x^{j}}{x^{j-1} } \frac{x-1}{x} - 1 = \frac{(x-1)^{j+1}-x^{j}(x-1) -x^{j}}{x^{j}} = \frac{(x-1)^{j+1}-x^{j+1}}{x^{j}}
$$
and the process repeats for the mext $j$
In the end, the final term in $A_{nn}$ involves 
$$
\frac{(x-1)^n -x^n}{x^{n-1}}$$
and a lot of cancelation with the accumlated factors happens, leaving the answeer 
$$ (-1)^n
\left( (x-1)^n - x^n \right)$$
