I am not very familiar with quaternions, I was just doing a programming homework were I had to implement quaternions' arithmetic, however I got puzzled by the multiplication of 2 quaternions.
Let's say I have the following:
$a = \alpha_1 + \beta_1i+\gamma_1j+\delta_1k$
$b = \alpha_2 + \beta_2i+\gamma_2j+\delta_2k$
I have been given the following rules $i^2=j^2=k^2=-1$, $ik=-j$, $ij=k$, $ji=-k$, $jk = i$, $ki = j$, $kj = -i$
Doing the algebra I get the following expression for the product of a and b:
$$\alpha_1\alpha_2 - \beta_1\beta_2 - \gamma_1\gamma_2 - \delta_1\delta_2 \\ +i(\alpha_1\beta_2+\beta_1\alpha_2+\gamma_1\delta_2-\delta_1\gamma_2)\\ +j(\alpha_1\gamma_2-\beta_1\gamma_2+\gamma_1\alpha_2+\delta_1\beta_2)\\ +k(\alpha_1\delta_2+\beta_1\gamma_2-\gamma_1\beta_2+\delta_1\alpha_2)$$
However, when I looked for documentation on this operation in some languages such as matlab, the quaternion product has other definition:
http://www.mathworks.com/help/aerotbx/ug/quatmultiply.html
So, when I test my implementation against the example given the result is different. So, Why is that? What is the correct definition?