Is there a closed form expression for the inverse of the matrix with elements $A_{i,j}=x_i$ for $i=j$ and $A_{i,j}=1$ for $i\neq j$?

Hello All

Consider a matrix with elements:

$A_{i,j}=x_i$ for $i=j$
$A_{i,j}=1$ for $i\neq j$

Is there a closed form expression for the elements of $A^{-1}$?

Will be glad to know of any reference.

Thanks

HC

-
This question mathoverflow.net/questions/67924/… was on the eigenvalues of $D+J$ rather than the inverse, but it may be helpful. – Douglas Zare Jun 18 '11 at 20:08
have a look here: people.kyb.tuebingen.mpg.de/suvrit/work/dimath/bm --- that link covers a slightly more general case than covered by your question. – Suvrit Jun 19 '11 at 3:53
Aùazing, the number of MO questions whose answer is an application of the Sherman-Morrison formula. – Denis Serre Jun 19 '11 at 7:25

You can use the Sherman-Morrison formula.

In the notation of the Wikipedia article, let $u=v=(1,\ldots,1)'$ and $A$ (not the same as your $A$) be the diagonal matrix with $(x_{1}-1, \ldots, x_{n}-1)$ on the diagonal.

Then, if I haven't made a mistake, the entry of the inverse matrix you're looking for is

$\frac{1}{x_{i}-1} - \frac{ \frac{1}{(x_{i}-1)^{2}} }{ 1 + \sum_{k} \frac{1}{x_{k}-1}}$ if $i=j$, and $\frac{ -\frac{1}{ (x_{i}-1)(x_{j}-1) }}{ 1 + \sum_{k} \frac{1}{x_{k}-1}}$ otherwise.

-
Thanks Douglas for the reference. As I was working on the problem from your hint, Ian has already posted the solution! Thanks Ian. That's exactly I was looking for. Appreciate your help. – user15871 Jun 18 '11 at 20:33
You might also want to rearrange the formulas I give to make it clearer that they work fine if one of the $x_{i}$ equals one. (Obviously the matrix is not invertible if two or more of the $x_{i}$ equal one.) – Ian Martin Jun 18 '11 at 20:34
Yes, I noticed that. Interestingly, I used round-about method to reach the solution yesterday, but that was not elegant and it was bothering me (solved for n=2, 3 and extrapolated from there by induction). But your approach is simple and elegant, and right use of Sherman-Morrison formula. Glad I posted the problem on this site. – user15871 Jun 18 '11 at 20:40