<s>[INST] Solving $n\times n$ determinant using triangular shape I have just started learning to solve nth order determinants by getting it into the triangular shape ( in this way the determinant is equal to the multiple of main or additional diagonal + the determination of the sign ). I have solved a couple of easy ones, but got stuck on this one ( which seems easy, but however I manipulate the rows or columns I can't get it into the triangular shape ).
$$
        \begin{vmatrix}
        5 & 3 & 3 & \cdots & 3 & 3 \\
        3 & 6 & 3 & \cdots & 3 & 3 \\
        3 & 3 & 6 & \cdots & 3 & 3 \\
        \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
        3 & 3 & 3 & \cdots & 6 & 3 \\
        3 & 3 & 3 & \cdots & 3 & 6 \\
        \end{vmatrix}
$$
If someone could give the solution and explain the crucial steps to solving this, it would be very appreciated.
 [/INST] First, you can subtract the last line from the others which gives you :$$\begin{vmatrix}
   2 & 0 &\ldots&0&-3 \\
   0 & 3 &\ddots&\vdots& \vdots \\ 
   \vdots &\Large{0}&\ddots&0& \vdots \\
   0&\ldots&0&3&-3\\
  3&\ldots&\ldots&3&6
\end{vmatrix}$$
Then subtract $\frac{3}{2} L_{1}$ from $L_{n}$:
$$\begin{vmatrix}
   2 & 0 &\ldots&0&-3 \\
   0 & 3 &\ddots&\vdots& \vdots \\ 
   \vdots &\Large{0}&\ddots&0& \vdots \\
   0&\ldots&0&3&-3\\
  0&3&\ldots&3&\frac{3}{2}
\end{vmatrix}$$
Finally, subtract $L_{i}$ for every $i \in [2,n-1]$ from $L_{n}$:
$$\begin{vmatrix}
   2 & 0 &\ldots&0&-3 \\
   0 & 3 &\ddots&\vdots& \vdots \\ 
   \vdots &\Large{0}&\ddots&0& \vdots \\
   0&\ldots&0&3&-3\\
  0&\ldots&\ldots&0&\frac{3}{2}+3(n-2)
\end{vmatrix}=\begin{vmatrix}
   2 & 0 &\ldots&0&-3 \\
   0 & 3 &\ddots&\vdots& \vdots \\ 
   \vdots &\Large{0}&\ddots&0& \vdots \\
   0&\ldots&0&3&-3\\
  0&\ldots&\ldots&0&3(n-\frac{3}{2})
\end{vmatrix}$$
These operations don't affect the determinant so you can apply the formula for a triangular shaped matrix.
</s>