<s>[INST] Determinant of a 5 × 5 matrix I have a little problem with a determinant.
Let $A = (a_{ij}) \in \mathbb{R}^{(n, n)}, n \ge 4$ with
$$a_{ij} = 
\begin{cases} 
  x \quad \mbox{for } \,i = 2, \,\, j \ge 4,\\
  d \quad \mbox{for } \,i \ge j, \\
  0 \quad \mbox{else.}
\end{cases}$$
So for example, if we choose $n = 5$, the matrix would look like this:
$$ A = 
\begin{pmatrix} 
d &0 &0 &0 &0 \\
d &d &0 &x &x \\
d &d &d &0 &0 \\
d &d &d &d &0 \\
d &d &d &d &d \\
\end{pmatrix}$$
How can I find the determinant of this matrix?
My first idea was to split this matrix into a product of a triangular matrix $T$ and a rest matrix $R$ so that $A = T \cdot R$. Then I wanted to use $$\det(A) = \det(T \cdot R) = \det(T) \cdot \det(R).$$
to figure out the determinant. This would be something like 
$$ d^n \cdot \det(R)$$
But is this approach even possible (I don't think so)? Is there any intelligent way of solving this? Thanks in advance.
 [/INST] 
My first idea was to split this matrix into a product of a triangular matrix $T$ and a rest matrix $R$ so that $A=T⋅R$.

That's very much a way to do it. The technique is called LU Decomposition. It produces a lower and upper triangular matrix, allowing trivial determinate calculations. For this reason, you actually only need to find the diagonal elements to get your determinant.
In this case,
$$ A =
\begin{pmatrix}
d &0 &0 &0 &0 \\
d &d &0 &x &x \\
d &d &d &0 &0 \\
d &d &d &d &0 \\
d &d &d &d &d \\
\end{pmatrix} = \begin{pmatrix}
1 &0 &0 &0 &0 \\
1 &1 &0 &0 &0 \\
1 &1 &1 &0 &0 \\
1 &1 &1 &1 &0 \\
1 &1 &1 &1 &1 \\
\end{pmatrix} \cdot \begin{pmatrix}
d &0 &0 &0 &0 \\
0 &d &0 &x &x \\
0 &0 &d &-x &-x \\
0 &0 &0 &d &0 \\
0 &0 &0 &0 &d \\
\end{pmatrix}$$
So
$$
\det A = \det L \cdot \det U = 1^5 \cdot d^5
$$

The first few steps of the method used here (takes longer to texify than to do) are:
$$
\begin{eqnarray}
\left[\begin{smallmatrix}
d &0 &0 &0 &0 \\
d &d &0 &x &x \\
d &d &d &0 &0 \\
d &d &d &d &0 \\
d &d &d &d &d \\
\end{smallmatrix}\right]
&&= \left[\begin{smallmatrix}
d &0 &0 &0 &0 \\
\end{smallmatrix}\right] \left[\begin{smallmatrix}
1 \\
1 \\
1 \\
1 \\
1 \\
\end{smallmatrix}\right]
+
\left[\begin{smallmatrix}
0 &0 &0 &0 &0 \\
0 &d &0 &x &x \\
0 &d &d &0 &0 \\
0 &d &d &d &0 \\
0 &d &d &d &d \\
\end{smallmatrix}\right]
\\
&&= \left[\begin{smallmatrix}
d &0 &0 &0 &0 \\
\end{smallmatrix}\right] \left[\begin{smallmatrix}
1 \\
1 \\
1 \\
1 \\
1 \\
\end{smallmatrix}\right]
+
\left[\begin{smallmatrix}
0 &d &0 &x &x \\
\end{smallmatrix}\right] \left[\begin{smallmatrix}
0 \\
1 \\
1 \\
1 \\
1 \\
\end{smallmatrix}\right]
+
\left[\begin{smallmatrix}
0 &0 &0 &0 &0 \\
0 &0 &0 &0 &0 \\
0 &0 &d &-x &-x \\
0 &0 &d &d-x &-x \\
0 &0 &d &d-x &d-x \\
\end{smallmatrix}\right]
\\
&&= \left[\begin{smallmatrix}
d &0 &0 &0 &0 \\
0 &d &0 &x &x \\
\end{smallmatrix}\right] \left[\begin{smallmatrix}
1 & 0\\
1 & 1\\
1 & 1\\
1 & 1\\
1 & 1\\
\end{smallmatrix}\right]
+
\cdots
\end{eqnarray}
$$
</s>