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?
 A: You are right to say that $e^{-x}$ is a real value for all real inputs. But you seem to assume that $\sin(ix)$ is also a real value for all real inputs. Maybe this assumption is hasty...
A: 
$$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$.

That does not follow unless you know that $\sin(ix)$ is real, and there's no reason to think that.
$$
\sin(ix) = \frac{e^{i(ix)} - e^{-i(ix)}}{2i} = \frac{e^{-x} - e^x}{2i}.
$$
A: You assumed $\sin(ix)=0$, but according to the formula
\begin{equation}
\sin(x)=\mathrm{i}\frac{e^{-\mathrm{i}x}-e^{\mathrm{i}x}}{2},
\end{equation}
($\sin(x)$ is sometimes defined this way for all $x\in\mathbf{C}$),
\begin{equation}
\sin(\mathrm{i}x)=\mathrm{i}\frac{e^x-e^{-x}}{2},
\end{equation}
and thus this is true if and only if $x=0$ (if $x=0$, $\cos(ix)=1$ and there is no contradiction).
I guess you assumed this because you know that a complex number is real if and only if its imaginary part is zero, but $\sin(\mathrm{i}x)$ is not the imaginary part of $\cos(\mathrm{i}x)+\mathrm{i}\sin(\mathrm{i}x)$.
A: 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$.
