I am new to SE Mathematica, and search gives no answer; so here is my problem:
During the testing of my numerical library for quaternions with Mathematica (package Quaternions) I observed the following behavior:
<<Quaternions` a = Quaternion[1, 2, 3, 4] (* Quaternion[1, 2, 3, 4] *) b = N[ArcCos[a]] (* Quaternion[1.390115947, -0.8918751006, -1.337812651, -1.783750201] *) Cos[b] (* Quaternion[1., -2., -3., -4.] *)
i.e. the vector part is negated. I can reproduce the result for
but my code gives
Cos[b] = [1, 2, 3, 4] (also given by the quaternion postfix calculator). This is not a rounding problem, and not limited to this specific quaternion. The same happened for e.g.
Cot[ArcCot[a], where as the following is as I would expect:
b = N[ArcSin[a]] (* Quaternion[0.1806803802, 0.8918751006, 1.337812651, 1.783750201] *) Sin[b] (* Quaternion[1., 2., 3., 4.] *)
My first guess was that it is related to branch cuts, but the analog complex functions give the expected result
Cos[ArcCos[1 + 2*I]] = 1 + 2*I.
Question: What is the explanation for the negated vector part for some trigonometric quaternion functions like $\cos$, $\cot$, etc.?