A problem with the geometric series and matrices? Let $n$ be a positive integer. Let $A$ be a square matrix. Let $I$ be the identity matrix with the same size as $A$.
I want to simplify $f_n(A) = I + A + A^2 + A^3 + A^4 + \cdots + A^n$
Now I know that for a complex number $z$ we have $1 + z + z^2 + z^3 + z^4 + \cdots + z^n= \dfrac{z^{n+1}-1}{z-1}$ when $z$ is not equal to $1$ ... and even if $z=1$ then by computing the limit we get the right answer : $n+1$.
This is well known as the geometric series and leads to the so-called q-analogue ideas.
But for matrices $A$ this does not work if the determinant of $A-I$ is $0$ , because then $\dfrac{A^{n+1} - I}{A - I}$ is not well defined.
This frustrates me a lot. Now I have heard about pseudoinverses but I do not know much about them and I even wonder if they can be of any help here.
I tried some things from calculus and continued fractions too, but nothing worked for me.
I also considered this problem for infinite (square) matrices but I assume that is analogue to this problem and so is its solution.
 A: First... It's nonstandard notation to divide by a matrix.  You should write it as $(A-I)^{-1}(A^{n+1}-I)$ or $(A^{n+1}-I)(A-I)^{-1}$; I believe both are valid, it just depends on how you multiply $A$ to the series when you are getting to the simplified form.
Sometimes you will just not be able to solve systems of equations.  It can be frustrating, but it actually has an interesting geometric interpretation.  Linear algebra is the study of transformations on vectors.  Matrix multiplication is simply rotating and scaling a vector, and matrix inversion is a way to reverse that scaling and rotation.  Let's consider a simple example, the system of equations
$Mx=b$.
If the matrix $M$ has a nonzero determinant, that means it is invertible.  What it really means is that for every single $b$ there is exactly one unique $x$ that will get you there (that will satisfy the equation), which means if you know $M$ and $b$ you can find the original $x$ every time.
If $M$ has a determinant of $0$ it means for a given $b$ there might be more than one $x$ that will get you there.  That means if you try to take a direct inverse, it will (and should) fail because even if you know $M$ and $b$ there is no way to know exactly what $x$ is.
Sometimes it might suffice to find a solution for $x$, but you have to remember that it won't be unique.  There are a few ways to do this: the Pseudoinverse is one of them, and another involves using optimization methods.  If you are interested in learining more about optimization I recommend starting with Boyd's Convex Optimization (the book and lectures are available for free online).
