Skip to main content
3 of 4
edited body
kglr
  • 403.4k
  • 18
  • 501
  • 959

For a general square matrix m and arbitrary partition of it into conformable parts m={{a,b},{c,d}} (i.e., a and d are square matrices, and b and c have appropriate dimensions),

partitioned matrix

the formula for the inverse is

 m={{a,b},{c,d}}; e = d - c.Inverse[a].b; minv={{Inverse[a] + Inverse[a].b.Inverse[e].c.Inverse[a], -Inverse[a].b.Inverse[e]}, {-Inverse[e].c.Inverse[a], Inverse[e]}}; 

enter image description here

This can be used to define a function that takes a matrix and a partition specification and does the needed type and conformability checks before applying the formula.

The formula can be found in, for example, Review of Matrix Algebra.

kglr
  • 403.4k
  • 18
  • 501
  • 959