Got $e^{-x}=\cos(ix)$ from Euler's formula. Where is my mistake? When I was messing around with Euler's formula, I came across this: $$e^{ix}=\cos(x)+\sin(x)i$$ Then, let $x$ be an imaginary value, $ix$, so then: $$e^{i(ix)}=\cos(ix)+\sin(ix)i$$ which we can simplify to $$e^{-x}=\cos(ix)+\sin(ix)i,$$ but since $e^{-x}$ is a real value for all real inputs, then $\sin(ix)i$ must be equal to $0$. so that means that $$e^{-x}=\cos(ix)$$ This doesn't seem right, so could someone please point out where I made a mistake?

If $a+bi=\lambda\in\Bbb R$, with $a,b\in\Bbb R$ then, indeed, you must have $a=\lambda$ and $b=0$. But, in the equality$$e^{-x}=\cos(ix)+\sin(ix)i,$$you have no reason to assume that $\cos(ix),\sin(ix)\in\Bbb R$.
