Replacing $\sin(z)$ with $1 - e^{2iz}$ I have seen many integral evaluations within logs where they change the sine to:
$$\sin(z) \rightarrow 1 - e^{2iz}$$
Such as here: Contour integral evaluation.
I dont understand how those expressions are equal. Please take a look?
Thanks.
 A: They are not equal. What is true is that $\sin(z)=\frac{e^{iz}-e^{-iz}}{2i}=\frac{-e^{-iz}}{2i} (1-e^{2iz})$.
A: I know this post is old, but maybe this answer helps someone.


then why do they only use $(1−e^{2iz})$?

This change makes it easier to solve the integral because of limit properties, while having the same zeroes as the sine.

The post you linked in short: 


*

*Using Cauchy's theorem, the contour integral of a holomorphic function (at least inside and on the contour) vanishes, and the contour presented in the post satisfies this condition. $sin(x)$ and $(1−e^{2iz})$ have the same zeroes in the interval presented, so the log will have the same poles too. The arc on the picture is required to avoid that pole.

*The contour is divided into parts seen on the picture, which can be evaluated easily because of the change you noticed.

*The $(1−e^{2i(x+iy)})$ was necessary, because it $\rightarrow 0$ as $y\rightarrow \infty$, which is not true for the sine (in that case the norm is increasing).

*$f(z):=log^2(1−e^{2iz})=log^2(−ie^{iz}\,2\,sin\,z)$ as you know.

*$log(−ie^{iz}\,2\,sin\,z)=log(2\,sin\,z)+i(z−\pi/2)$, with log addittion.

*Since the whole integral vanishes, its real and imaginary parts are $0$. The top side and the arc is vanishing (due to point 3), the integral of the two vertical sides are purely imaginary, so the real part of the bottom side vanishes. $$Re\,f(z)=Re\,(log\,2+log\,sin\,z+i(z−\pi/2))^2=\color{red}{log^2\,(sin\,z)}+2\,log\,2\,log\,(sin\,z)+log^2\,2−(x−\pi/2)^2.$$

*So $\int_0^{\pi/2} Re\,f(z)\,dz=0$, which you can solve for $log^2\,(sin\,z)$. The only hard part is $\int_0^{\pi/2} log\,(sin\,z)\,dz$, but that can be evaluated more easily.
