I have a simple linear equation of the form $A\vec{y}=\vec{x}$ for $A$ an $n\times n$ invertible matrix whose diagonal entries are all equal to $a$ and off diagonal entries are all equal to $b$.
Writing $\vec{x}=(x_1,x_2,...,x_n)$, $\vec{y}=(y_1,y_2,...,y_n)$, I want to find the coefficients $c_i$ in $y_1+y_2+...+y_n=\sum_{i=1}^n c_i x_i$. I am looking for an answer in the form of a ratio of two polynomials in $a$ and $b$, which I have found is the case for $n=2$ and $n=3$, for example I found $ y_1+y_2=\frac{a-b}{a^2-b^2}x_1+\frac{a-b}{a^2-b^2}x_2$ for $n=2$.
**edit: using some other means I am fairly certain the answer is $c_i=\frac{1}{a+(n-1)b}$, but I'm not sure how to prove it.
The simplest way to do this would be to find the inverse of $A$, but I am not sure how to do this for general $n$. I found the question Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$) gives the determinant of the matrix $A$, which would be helpful in finding the inverse as well as using another method such as Cramer's Rule.