I have the following matrix: $$ A = \left[ \begin{matrix} -(a_1 + a_2) & a_2 \\ a_2 & -(a_2 + a_3) & a_3\\ & & \ddots & \\ &&a_{n-1}& -(a_{n - 1} + a_{n}) & a_n\\ &&&a_n & -(a_n + a_{n + 1}) \end{matrix} \right] $$ with $a_i > 0$. I want to prove that $A$ is invertible. Unfortunately, it is not strictly diagonally dominant, so Gerschgorin theorem only says that $\lambda \leq 0$ (since we know that $\lambda\in \mathbb{R}$).
I also tried to write $A$ as the sum of two triangular matrices (with eigevalues $-a_1, \dots, -a_n$ and $-a_2$, $\dots$, $-a_{n + 1}$), but that does not seem lead anywhere. I was also unable to directly compute $\det A$ or the null space of $A$: the expressions quickly become too ugly.
$A$ is the sum of $n+1$ negative semidefinite matrices $A_1+A_2+\ldots+A_{n+1}$, where \begin{cases} A_1=-a_1e_1e_1^T,\\ A_k=-a_k(e_{k-1}-e_k)(e_{k-1}-e_k)^T,&k=2,3,\ldots,n,\\ A_{n+1}= - a_{n+1}e_ne_n^T. \end{cases} So, if $Ax=0$, we must have $x^TAx=\sum_{j=1}^{n+1} x^TA_jx=0$. Since each $A_j$ is negative semidefinite, each summand $x^TA_jx$ is non-positive. So, for the sum to be zero, we must have $x^TA_jx=0$ for each $j$. Solving this system of quadratic equations, we get $x=0$ and hence $A$ is invertible.