<s>[INST] Quaternion exponential problem I have problem with Euler´s form of quaternion. My quaternion $q=\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j,$ so $q^2=-1$, because $$q^2=(\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j)(\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j)=-\frac{1}{2}+\frac{1}{2}k-\frac{1}{2}k-\frac{1}{2}=-1.$$ Thus I can write $q$ in Euler´s form as $q=e^{q\frac{\pi}{2}}=\cos\frac{\pi}{2}+q \sin\frac{\pi}{2}=q.$ However, I can also write $$q=e^{q\frac{\pi}{2}}=e^{(\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j)\frac{\pi}{2}}=e^{\frac{\pi}{2\sqrt{2}}i+\frac{\pi}{2\sqrt{2}}j}=e^{\frac{\pi}{2\sqrt{2}}i}e^{\frac{\pi}{2\sqrt{2}}j}=\\=(\cos\frac{\pi}{2\sqrt{2}}+i \sin\frac{\pi}{2\sqrt{2}})(\cos\frac{\pi}{2\sqrt{2}}+j \sin\frac{\pi}{2\sqrt{2}})=\\=\cos^2\frac{\pi}{2\sqrt{2}}+(i+j) \sin\frac{\pi}{2\sqrt{2}}\cos\frac{\pi}{2\sqrt{2}}+k\sin^2\frac{\pi}{2\sqrt{2}},$$ but this is not $q$. Please can you somebody say me where is the mistake? 
 [/INST] For a quaternion $z=a+b\mathbf{i}+c\mathbf{j}+d\mathbf{k} = a+\mathbf{v}$ the exponential is defined as:
$$
e^z = e^{a+\mathbf{v}}=e^a \left(  \cos  |\mathbf{v}| +\dfrac{\mathbf{v}}{|\mathbf{v}|} \,\sin |\mathbf{v}| \right)
$$
(see :Exponential Function of Quaternion - Derivation)
and in general, since quaternions are not commutative, we have:
$$
e^xe^y \ne e^ye^x \ne e^{x+y}
$$
In your case: $q=\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j,$ is a pure imaginary quaternion $\mathbf {v} =q$
and $|q|=1$, so  we have:
$$
e^q= e^{\mathbf{v}}=\left(  \cos  (1) +\mathbf{v}\sin (1) \right)=\cos  (1)+ \sin(1)\left(\frac{1}{\sqrt{2}}i+\frac{1}{\sqrt{2}}j \right)
$$
</s>