I've got to calculate determinant for this matrix: $$\begin{bmatrix} a_{ 1 } & 0 & 0 & \cdots & 0 & b_{ n } \\ b_1 & a_2 & 0 & \cdots & 0 & 0 \\ 0 & b_2 & a_3 & \cdots & 0 & 0 \\ \vdots & \vdots & & \vdots & \vdots & \vdots \\ 0 & 0 & 0 & \cdots & a_{n-1} & 0 \\ 0 & 0 & 0& \cdots & b_{n-1} & a_n \end{bmatrix}$$ Is there any clever way to find out the determinant of above matrix?
Thanks in advance.
If we use the permutation definition of the determinant, where $det(A) = \sum_{\sigma \in S_n} (-1)^\sigma \prod a_{i, \sigma(i)}$ we see that the only two permutations which yield nonzero terms are the identity permutation, and the permutation $(n ~n-1 ~n-2~ \ldots ~ 1)$. This permutation has sign $(-1)^{n-1}$, so $$det(A) = a_1 a_2 \ldots a_n + (-1)^{n-1} b_1 b_2 \ldots b_n$$
Another method would be to expand along the first column:
We would get $a_1 \det(\begin{bmatrix} a_2 & 0 & \ldots & 0 \\ b_2 & a_3 & \ldots & 0 \\ \vdots & \vdots & \vdots & \vdots \\ 0 & \ldots & b_{n-1} & a_n \\ \end{bmatrix} - b_1 \det(\begin{bmatrix} 0 & 0 & \ldots & b_n \\ b_2 & a_3 & \ldots & 0 \\ \vdots & \vdots & \vdots & \vdots \\ 0 & \ldots & b_{n-1} & a_n \\ \end{bmatrix}$ If we preform $n-2$ column swaps to the second matrix we get a upper triangular matrix, while the first matrix is lower triangular so we get $a_1 a_2 \ldots a_n + (-1)^{n-1} b_1 \ldots b_n$