# Do I really need to invert this matrix

I need to calculate a matrix $$A$$ (at least some elements of it, see below) as defined by the following equation

$$A=B(\mathbb{1}-B)^{-1}$$

where B is a square matrix of dimension $$N$$ and $$\mathbb{1}$$ is $$N \times N$$ identity matrix.

Inspired by this post:

https://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/

I was wondering if I really need to invert $$\mathbb{1}-B$$ in my case, or if there's some easier way. Keep in mind that:

• $$N$$ in my case is quite large, its order of magnitude can be ten thousand.

• I don't need to know the full matrix $$A$$, I just need a few elements in the upper left corner, let's say $$A_{00}$$, $$A_{01}$$, $$A_{11}$$, $$A_{02}$$, $$A_{12}$$, $$A_{22}$$ would be perfect.

Since $$A = B(I-B)^{-1} = (I-B)^{-1}(I-B)B(I-B)^{-1} = (I-B)^{-1}B(I-B)(I-B)^{-1} =(I-B)^{-1}B$$ So you want to solve $$(I-B)A=B$$ You seem to need only the first three columns of $$A$$. Solve the matrix problems $$(I-B)a_i = b_i, \qquad i=0,1,2$$ where $$b_0,b_1,b_2$$ are first three columns of $$B$$. Then $$a_0,a_1,a_2$$ are the first three columns of $$A$$.