# Complex integration

Find $\int_0^{\pi+2i} \cos(z/2) \; dz$?

What is the procedure for doing this problem?

I 'observed' that the derivative of $2\sin(z/2)$ is $\cos(z/2)$ so my answer was $2\sin(z/2)$ evaluated between $0$ and $\pi+2i$ which gives me $2\sin\left(\frac{\pi+2i}{2}\right)$

But wolfram alpha says the answer is $2\cos i\ldots$ So what am I doing wrong?

-

## 1 Answer

$\sin\left(\frac{\pi}{2} + z\right) = \cos z$

The two answers are equivalent.

You can easily derive the above using another trig identity for the $\sin$ of a sum:

$$\sin(a + b) = \sin(a) \cos(b) + \sin(b) \cos(a)$$

If we plug in $a = \pi/2$, we get

$$\sin (\pi/2 + b) = \sin(\pi/2) \cos(b) + \sin(b) \cos(\pi/2) = \cos(b)$$

since $\sin(\pi/2) = 1$ and $\cos(\pi/2) = 0$.

-