# Inverse of specified matrix

Please help me in finding the general form of inverse matrix to matrix with $n$ rows and $n$ columns with elements except elements on diagonal, equal $1$ and elements on diagonal equal $1+x_1$, $1+x_2$, ..., $1+x_n$.

Your matrix can be written as $$\begin{bmatrix}x_1 & 0 & 0 & \cdots & 0\\0 & x_2 & 0 & \cdots & 0\\0 & 0 & x_3 & \cdots & 0\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ 0 & 0 & 0 & \cdots & x_n \end{bmatrix}_{n \times n} + \begin{bmatrix} 1\\ 1\\ 1\\ \vdots \\ 1\end{bmatrix}_{n \times 1} \begin{bmatrix} 1& 1& 1& \cdots & 1 \end{bmatrix}_{1 \times n}$$ Now you can make use of the Sherman-Morrison-Woodbury formula i.e. $$(X+ee^T)^{-1} = X^{-1} - \dfrac{X^{-1}ee^TX^{-1}}{1+e^TX^{-1}e}$$ I will let you compute these relevant quantities.