# 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

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.
$\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.
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