Calculating residue of pole of order $2$

Consider the residue of $f(z)/g(z)$ at the double pole $z=a$. Because $a$ is a double zero of $g(z)$, write

$$g(z) = (z-a)^2 p(z)$$

where $p(a) \ne 0$ and is analytic, etc. etc.

Then

$$\operatorname*{Res}_{z=a} \frac{f(z)}{g(z)} = \left [\frac{d}{dz} \frac{f(z)}{p(z)} \right ]_{z=a}$$

Now,

$$\frac{d}{dz} \frac{f(z)}{p(z)} = \frac{f'(z) p(z)-f(z) p'(z)}{p(z)^2}$$

Also, note that

$$g(z) = \frac12 g''(a) (z-a)^2 + \frac16 g'''(a) (z-a)^3+\cdots = p(a) (z-a)^2 + p'(a) (z-a)^3+\cdots$$

Therefore

$$p(a) = \frac12 g''(a)$$

and

$$p'(a) = \frac16 g'''(a)$$

Thus

$$\operatorname*{Res}_{z=a} \frac{f(z)}{g(z)} = \frac{6 f'(a) g''(a) - 2 f(a) g'''(a)}{3 [g''(a)]^2}$$

In your case, $f(z)=1+z$ and $g(z)=1-\sin{z}$. The residue at $z=\pi/2$ is then $2$.


My other answer (and Antonios above) requires knowledge of finding poles through Laurent series, which I assumed you have done (I hope!), but it is possible you have not. Instead, you can use that when $f(z) = \frac{p(z)}{q(z)}$ has a pole at $z=z_0$ where $p(z)$ and $q(z)$ are analytic in any neighborhood of $z_0$, you have $Res(f;z=z_0) = \frac{p(z_0)}{q'(z_0)}$. If, as in this case, $q'(z_0)=0$, you have to change this formula. It was derived from the Taylor series of $p(z)$ and $q(z)$ about $z=z_0$. So, we can take the next order term, namely $Res(f,z=z_0) = \frac{p'(z_0)}{q''{z_0}/2!}$. Here you have that case and can apply this formula nicely, but it is important to see where it comes from which is the residue from the Laurent series as described before.