This is a question out of my own curiousity.
We know that by Euler $$e^{ix}=\cos x+i\sin x$$ $$e^{-ix}=\cos x-i\sin x$$ .Adding $$\cos x=\frac{e^{ix}+e^{-ix}}{2}$$ if $x=i$:$$\cos (i)=\frac{e+\frac{1}{e}}{2} \tag!$$.Now this result is surprising.Indeed by taking cos of complex number i was expecting something more strange on RHS,but here we get a real number.Is such an operation even defined or is it that euler's formula is applicable only when $x$ is real This result is confusing me a bit as i never expected a real number on RHS.What would be an intuitive explanation on this result
Thank you!(i apologise if this is a stupid question)