# How to find the determinant of this $n \times n$ matrix in a clever way?

\begin{bmatrix} b_1 & b_2 & b_3 & \cdots & b_{n-1} & 0 \\ a_1 & 0 & 0 & \cdots & 0 & b_1 \\ 0 & a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{bmatrix}

Is there any clever and short way to find out the determinant of above matrix? Any help will be appreciated.

• Can the $a_i$'s take the value zero? – Rodrigo de Azevedo Jul 27 '16 at 17:31
• Consider them non-zero. – Real Hilbert Jul 27 '16 at 17:41

Think of the given matrix as a block matrix

$$\left[\begin{array}{ccccc|c} b_1 & b_2 & b_3 & \cdots & b_{n-1} & 0 \\ \hline a_1 & 0 & 0 & \cdots & 0 & b_1 \\ 0 & a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{array}\right] = \begin{bmatrix} \mathrm b^T & 0\\ \mbox{diag} (\mathrm a) & \mathrm b\end{bmatrix} = \begin{bmatrix} 0 & \mathrm b^T\\ \mathrm b & \mbox{diag} (\mathrm a)\end{bmatrix} \begin{bmatrix} 0_{n-1}^T & 1\\ \mathrm I_{n-1} & 0_{n-1}\end{bmatrix}$$

Since

$$\det \begin{bmatrix} 0_{n-1}^T & 1\\ \mathrm I_{n-1} & 0_{n-1}\end{bmatrix} = (-1)^{n+1}$$

assuming that none of the $a_i$'s is zero, then

$$\det \left[\begin{array}{ccccc|c} b_1 & b_2 & b_3 & \cdots & b_{n-1} & 0 \\ \hline a_1 & 0 & 0 & \cdots & 0 & b_1 \\ 0 & a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\ 0 & 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{array}\right] = \cdots = (-1)^n \cdot \mathrm b^T (\mbox{diag} (\mathrm a))^{-1} \mathrm b \cdot \det (\mbox{diag} (\mathrm a))$$

• @ Rodrigo can you please tell me how did you get the last term? – Real Hilbert Jul 27 '16 at 17:56
• @Real I used $$\det \begin{bmatrix} \mathrm A & \mathrm B\\ \mathrm C & \mathrm D\end{bmatrix} = \det( \mathrm D ) \cdot \det( \mathrm A - \mathrm B \mathrm D^{-1} \mathrm C)$$Take a look at en.wikipedia.org/wiki/Determinant#Block_matrices – Rodrigo de Azevedo Jul 27 '16 at 18:05

$b_1 \det\begin{pmatrix} 0 & 0 & \cdots & 0 & b_1 \\ a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{pmatrix} - a_1 \det\begin{pmatrix} b_2 & b_3 & \cdots & b_{n-1} & 0 \\ a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{pmatrix}$

$(-1)^nb_1\cdot a_2\cdot a_3\cdots a_{n-1}\cdot b_1-\\ a_1\cdot b_2 \det\begin{pmatrix} 0 & 0 & \cdots & 0 & b_2 \\ a_3 & 0 & \cdots & 0 & b_3\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{pmatrix}+\\ a_1\cdot a_2 \det\begin{pmatrix} b_3 & b_4 & \cdots & b_{n-1} & 0 \\ a_3 & 0 & \cdots & 0 & b_3\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & a_{n-1} & b_{n-1} \\ \end{pmatrix}$

I think we have a pattern.

$b_1^2\cdot a_2\cdots a_{n-1} + a_1\cdot b_2^2\cdot a_3\cdots a_{n-1}+a_1\cdot a_2\cdot b_3^2\cdot a_4\cdots a_{n-1}+\cdots$

$(-1)^n\sum_\limits{j=1}^{n-1} b_j^2 \frac{\prod_\limits{k=1}^{n-1} a_k}{a_j}$

I'll give you a bunch of hints to start:

When computing the determinant, it is best to start with the row containing the greatest number of null entries. In your case it's the last line. First step yields:

$$\det(A(n))=b_{n-1}\left|\begin{matrix} b_1 & b_2 & b_3 & \cdots & b_{n-1} \\ a_1 & 0 & 0 & \cdots & 0 \\ 0 & a_2 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots&\vdots \\ 0 & 0 & \cdots & a_{n-2}&0 \\ \end{matrix}\right|- a_{n-1}\left|\begin{matrix} b_1 & b_2 & b_3 & \cdots & b_{n-2} & 0 \\ a_1 & 0 & 0 & \cdots & 0 & b_1 \\ 0 & a_2 & 0 & \cdots & 0 & b_2\\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & \cdots & a_{n-2} & b_{n-2} \\ \end{matrix}\right|$$

The first term can easily shown to be equal to $$b_{n-1}^2\prod_{k=1}^{n-2}a_k$$ While the second term can be written as$$a_{n-1}\det(A(n-1))$$

Now you have a recurrence relation: $$\det(A(n))=\left(b_{n-1}^2\prod_{k=1}^{n-2}a_k\right)-a_{n-1}\det(A(n-1))$$

You can start with $$\det(A(2))=\left|\begin{matrix}b_1&0\\a_1&b_1\end{matrix}\right|=b_1^2$$

• @RealHilbert Not really. If $n$ is even, then the first element of the first row has a $+$ sign, and the first element of the $n$th row has a minus sign. And since there is an even number of elements in any row, the $n$th element of the $n$th row will have a $+$ sign. Same reasoning if $n$ is odd. – GeorgSaliba Jul 27 '16 at 16:48
• Ya I got it...that's why I immediately edited my comment ...but you answered it ...thanks again – Real Hilbert Jul 27 '16 at 16:51
• @RealHilbert Sorry, I didn't notice. I'm glad I could help! – GeorgSaliba Jul 27 '16 at 16:52