What is $sin(\pi/2 +iln2)$

The first is correct. In the second, you are using that $\sin(x)=\text{im}(e^{ix}),$ but that only applies if $x$ is real, which is not the case here. We know that $e^{ix}=\cos(x)+i\sin(x)$, which makes it look like $\sin(x)$ is the imaginary part of $e^{ix}$, but what if $\cos(x)$ and $\sin(x)$ themselves are not real?


My guess is that $\sin(x)=\mathrm{Im}(e^{ix})$ only works for $x\in \mathbb{R}$. Take for example the series representation of $$\sin(x)=\sum_{n=0}^\infty (-1)^n \frac{x^{2n+1}}{(2n+1)!}$$ Now if we insert $\sin(ix)$ with real $x$, then we see that $\sin(ix)\in\mathbb{C}$. On the other hand we see that $\sin(ix)=\mathrm{Im}(e^{i(ix)}) = \mathrm{Im}(e^{-x})=0$ which clearly contradicts our earlier finding. Only valid solution for complex $x$ would be $$\sin(x)=\frac{1}{2i}(e^{ix}-e^{-ix})$$