I want to solve the following determinant:
$D_n= \begin{vmatrix} a_n & a_{n-1} & \cdots & a_2 & x\\ a_n & a_{n-1} & \cdots & x & a_1\\ a_n & a_{n-1} & \cdots & a_2 & a_1\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ a_n & x & \cdots & a_2 & a_1\\ a_n & a_{n-1} & \cdots & a_2 & a_1\\ \end{vmatrix}$
The idea I had was to 1) get the $a_n$ in front of the determinant, which gets me to:
$D_n= a_n \begin{vmatrix} 1 & a_{n-1} & \cdots & a_2 & x\\ 1 & a_{n-1} & \cdots & x & a_1\\ 1 & a_{n-1} & \cdots & a_2 & a_1\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 1 & x & \cdots & a_2 & a_1\\ 1 & a_{n-1} & \cdots & a_2 & a_1\\ \end{vmatrix}$
Then I multiplied the nth row with $-1$ and added it to all the other ones, which gives me:
$D_n= a_n \begin{vmatrix} 0 & 0 & \cdots & 0 & x-a_1\\ 0 & 0 & \cdots & x-a_2 & 0\\ 0 & 0 & \cdots & 0 & 0\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & x-a_{n-1} & \cdots & 0 & 0\\ 1 & a_{n-1} & \cdots & a_2 & a_1\\ \end{vmatrix}$
So, I got a triangular determinant, but with the opposite diagonal, not the main one. How do I transform it into a real triangular determinant? Obviously, my idea to replace every adjacent row (1st and nth, (n-1)th and 2nd...) is wrong? Any ideas?