Solution (source code)

= Solution

Let $f_j$ be the <determinant> of the leading $j\times j$ <principal submatrix>. Expansion along the last row gives an $a_jf_{j-1}$ term and a $c_{j-1}$ term with negative <cofactor> sign. In the latter minor, the final column has only $b_{j-1}$ nonzero, and deleting that row and column leaves the leading $(j-2)\times(j-2)$ <principal submatrix>. Thus the <tridiagonal determinant recurrence> is
$$
\boxed{f_0=1,\qquad f_1=a_1,\qquad f_j=a_jf_{j-1}-c_{j-1}b_{j-1}f_{j-2}\quad(j\ge2).}
$$
Here $f_0=1$ is the empty <determinant> convention, needed to include $f_2=a_1a_2-b_1c_1$. The derivation uses <cofactor expansion>, so the <recurrence relation> remains valid when coefficients or intermediate <determinants> vanish; it never divides by a <pivot element>.