Derivation of the formula $(I + cd^T)^{-1} = I - \frac{cd^T}{1 + d^Tc}.$ In the book is the following formula:

Let $c$ and $d$ be $n \times 1$ nonzero columns such that $1+d^Tc \neq 0$, then $$(I + cd^T)^{-1} = I - \frac{cd^T}{1 + d^Tc}.$$

If $1+d^Tc \neq 0$, then $\big(I + cd^T\big)\big(I - \frac{cd^T}{1 + d^Tc}\big) = I$ so the equation is correct. But I am trying to derive the formula. I tried the solve the following equation $(I + cd^T)= (I + X)$, but without success.
How can I derive such formula? Thank you.
 A: The series approach in the comments works but the following might be simpler: We start with your ansatz $$(I + cd^T)^{-1} = (I + X)$$ and compute
$$
I
  = (I + cd^T)(I + X)
  = I + cd^T + X + cd^TX
$$
but also
$$
  I = (I + X)(I + cd^T) = I + cd^T + X + X cd^T.
$$
Comparing these, we find
$$
  Xcd^T = cd^T X.
$$
So $X$ and $cd^T$ commute. Certainly all polynomials in $cd^T$ commute with $cd^T$ but let’s hope that we can make our life simpler and try it with the easiest kind of polynomial that might work first, i.e. with $X = a cd^T$ where $a$ is some scalar. Going back to the equation above (subtracting $I$ on both sides), we have
$$ 0 = cd^T + acd^T + acd^Tcd^T.$$
Now we have to look closely and see that $d^Tc$ in the last term is a scalar as well and hence can be moved to the front (a very useful trick!):
$$ 0 = cd^T + a cd^T + a(d^Tc) cd^T$$
Factoring out $cd^T$ on the right-hand side, we get a product of a matrix and a scalar. We know that the matrix is nonzero, so for the product to be zero the scalar has to be:
$$0 = 1 + a + a(d^Tc)$$
Solving for $a$ results in $$a = \frac {-1} {1 + d^Tc}$$
if $1 + d^Tc \neq 0$.
A: There are formulas for that, but maybe you are not allowed to use them. This is a so called "rank 1 perculation". Also known as Sherman-Morrison formula.
$$({\bf A+uv}^T)^{-1} = {\bf A}^{-1} - \frac{{\bf A}^{-1}{\bf uv}^T{\bf A}^{-1}}{1+{\bf v}^T{\bf A}^{-1}{\bf u}}$$
Now set $\bf A = I$ and you can probably see what happens.
