# How to inverse this matrix?

A long time ago I used to do it very fast and easily [A long time ago].

I would like to refresh my memory on what are the methods, steps to do in order to calculate an inverse of a matrix?

Let say I have this matrix as an example:

$$A= \begin{bmatrix} 2 & 1 & \cdots & \cdots & 1 \\ 1 & 2 & \ddots & \cdots & 1 \\ 1 & 1 & 2 & 1 & \vdots \\ \vdots & \vdots & \ddots & \ddots & 1 \\ 1 & 1 & 1 & 1 & 2 \end{bmatrix}.$$

Or: $$A=\left[ \begin{array}{ccccc} 2\\ & 2 & & \huge1\\ & & \ddots\\ & \huge1 & & 2\\ & & & & 2 \end{array} \right].$$

Your example is $E + I$ where $E$ is the matrix of all $1$'s. Now $E^2 = n E$ where the matrix is $n \times n$, so any polynomial in $E$ will be of the form $a E + b I$. If you try $(a E + b I) (E + I) = I$, you are led to the equations $n a + a + b = 0$ and $b = 1$, so $a = -1/(1+n)$. That is, the inverse is $(-1/(1+n)) E + I$.