Computing explicit Riesz projection Consider the matrix:
$ A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} $
which has eigenvalue $1$ with algebraic multiplicity $2$ and geometric multiplicity $1$.
I am trying to explictly construct the Riesz projection
\begin{align*}
P = - \frac{1}{2 \pi i} \int_{\gamma} \frac{1}{A - z} d \gamma
\end{align*} 
where $\gamma$ is any curve enclosing the spectrum $\{1\}$. How to compute it?

It seems easiest to pick the contour $\gamma: \lbrack 0, 2 \pi \rbrack \to \mathbb{C} $ defined by
\begin{align*} 
\gamma( \theta) = 1+ e^{i \theta} 
\end{align*} 
which is the circle of unit radius around $1$ and $\gamma'(\theta) = i e^{i \theta} $.
Now, to evaluate the contour integral
\begin{align*}
- \frac{1}{2 \pi i}  \int_{0}^{2\pi} \frac{i e^{i \theta}}{ \begin{pmatrix} - e^{i \theta}  & 1 \\ 0 & - e^{i \theta} \end{pmatrix}} d \theta
&  = - \frac{1}{2 \pi i} \int_{0}^{2\pi} \frac{i e^{i \theta}}{e^{2i\theta}}   \begin{pmatrix} - e^{i \theta}  & - 1 \\ 0 & - e^{i \theta} \end{pmatrix} d \theta
= \frac{1}{2 \pi } \int_{0}^{2\pi}   \begin{pmatrix}  1  &  e^{-i \theta} \\ 0 &  1 \end{pmatrix} d \theta \\ 
& =  \frac{1}{2 \pi }  \begin{pmatrix} \int_{0}^{2\pi}   1  d\theta &  \int_{0}^{2\pi}    e^{-i \theta} d \theta \\ 0 & \int_{0}^{2\pi}   1 d \theta \end{pmatrix} =   \begin{pmatrix} 1  & 0 \\ 0 &  1 \end{pmatrix}.
\end{align*}
Which is a projection onto the entire $\mathbb{C}^2$ as expected.
