TITLE: yet another determinant and inverse of a matrix
QUESTION [11 upvotes]: This problem is some variation of another MO question. Consider the matrix
$$M_n:=\begin{bmatrix}-c& a & a& \dots & a \\ b & c & a& \ddots & a\\ b & b & -c & \ddots & a \\ \vdots & \ddots & \ddots & \ddots & a \\ b & b & b & \dots & (-1)^nc \end{bmatrix}_{n\times n},$$
that is, a matrix with diagonal $(-1)^ic$, below diagonal entries $b$ and above diagonal entries $a$.

Question 1. Is there a nice closed formula for the determinant $\det(M_n)$? This has been solved.
Question 2. Is there a nice expression for the inverse $M_n^{-1}$? This one awaits an answer.

REPLY [7 votes]: Let me continue on from the notation and reasoning of Gjergji Zaimi's answer. By the Sherman-Morrison formula:
$$(A_n  - a v^T v)^{-1} = A^{-1} + a \frac{ A^{-1} v v^T A^{-1} }{1 - a v^T A^{-1} v }  =A^{-1} + a \frac{ A^{-1} v v^T A^{-1} }{\frac{ (a-b) P_n(a)}{a P_n(b) - bP_n(a)} } $$
$$(A_n  - b v^T v)^{-1} = A^{-1} + b \frac{ A^{-1} v v^T A^{-1} }{1 - b v^T A^{-1} v }  =A^{-1} + b \frac{ A^{-1} v v^T A^{-1} }{\frac{ (a-b) P_n(b)}{a P_n(b) - bP_n(a)} } $$
where in each case the denominator is calculated as a ratio of determinants using the determinant formulas in Gjergji Zaimi's answer.
Hence
$$b P_n(a) (A_n  - a v^T v)^{-1} -  aP_n(b) (A_n  - b v^T v)^{-1} = (a P_n(b) - b P_n(A) ) A_n^{-1} + 0$$
as when we take a suitable linear combination, the second terms drop out, and
$$A_n^{-1} = \frac{ b P_n(a) (A_n  - a v^T v)^{-1} -  aP_n(b) (A_n  - b v^T v)^{-1}}{ bP_n(a) - aP_n(b) }$$
Now $A_n  - a v^T v$ and $A_n  - b v^T v$, and their inverses, are lower-triangular and upper-triangular matrices respectively. I think these shouldn't be too hard to calculate explicitly.