Quaternion product I am trying to figure out how to multiply 2 quaternions together. I learned back in school that you use the FOIL method when multiplying 2 binomials together, however when it comes to Quaternions, The FOIL distributive method does not apply:
Qa = [Sa,A]
Qb = [Sb,B]
QaQb = [Sa,A][Sb,B] =
(Sa + Xai + Yaj + ZaK)(Sb + Xbi+ Ybj + Zbk) =
(SaSb - XaXb - YaYb -ZaZb)+
(SaXb + SbXa + YaZb -YbZa)i+
(SaYb + SbYa + ZaXb - ZbXa)j+
(SaZb + SbZa + XaYb - XbYa)k
Is there a standard way of multiplying 2 Quaternions together similar to the FOIL method used for multiplying 2 binomials? 
 A: Not everything is a binomial. Do you know how to multiply $(a+b+c)(x+y)$ for example? It's still just an application of the distributive property, it's just that FOIL is an acronym invented so students could memorize what the terms would be at the end multiplying two binomials.
For instance, with $(a+b+c)(x+y)$ we would have
$$ \begin{array}{ll} (a+b+c)(x+y) & =a(x+y)+b(x+y)+c(x+y) \\
 & = ax+ay+bx+by+cx+xy. \end{array} $$
When there are $4\times 4=16$ terms to multiply out, it becomes cumbersome to keep everything on one line, so if you want you can make a $4\times 4$ array to keep track of it all:
$$ \begin{array}{|c|c|c|c|c|} \hline & a_2 & b_2\mathbf{i} & c_2\mathbf{j} & d_2\mathbf{k} \\ \hline a_1 \\ \hline b_1\mathbf{i} \\ \hline c_1\mathbf{j} \\ \hline d_1\mathbf{k} \\ \hline  \end{array} $$
In each entry, compute $uv$ where $u$ is the term at the left of the row and $v$ is the term at the top of the column. When done filling in the table, add up all of its entries (not including the  terms labelling the rows and columns) to get $(a_1+b_1\mathbf{i}+c_1\mathbf{j}+d_1\mathbf{k})(a_2+b_2\mathbf{i}+c_2\mathbf{j}+d_2\mathbf{k})$.
Another way is to write quaternions in the form $r+\mathbf{u}$, where $r$ is a scalar and $\mathbf{u}$ is a vector; in this case you can multiply two quaternions as if it were a product of binomials, then use the rule $\mathbf{u}\mathbf{v}=-\mathbf{u}\cdot\mathbf{v}+\mathbf{u}\times\mathbf{v}$ (where $\mathbf{u},\mathbf{v}$ are vectors, i.e. pure imaginary quaternions, $\mathbf{u}\cdot\mathbf{v}$ denotes the dot product and $\times$ denotes the cross product) and combine like terms to simplify.
A: Where does the FOIL method come from?  It's from the distributive law, which says that $$x(y+z) = xy+xz.$$
Here the right term $(y+z)$ is a sum and we've distributed the left term $x$ over the right term.   If the left term is a sum, we can do it in the other direction:
$$(y+z)x = yx+zx.$$
How do we get from this to FOIL? When we multiply two binomials, both sides are sums and we can distribute in both directions. The first step is to distribute the left term over the right term as before:
$$(a+b)(c+d) = (a+b)c + (a+b)d$$
Where we took $x = (a+b)$ and $y = c$ and $z=d$.
Then we distribute again, in the other direction, twice:
$$\color{darkred}{(a+b)c} + \color{darkblue}{(a+b)d} =
\color{darkred}{ac + bc} + \color{darkblue}{ad + bd}$$
At this point we might be able to  combine like terms, if there are any.  In this example, which is very general, there aren't any.  But if we had been multiplying $x+2$ and $x+3$ then $bc$ would be $2\cdot x$ and $ad$ would be $x\cdot3$ and we would have been  able to combine them to get $5x$. 
Now let's move on to quaternions.  The idea is the same:
$$(a + bi + cj+ dk)(w+xi+yj+zk) $$
We distribute the left term over the right one:
$$(a + bi + cj+ dk)w \\
+ (a + bi + cj+ dk)xi \\
+ (a + bi + cj+ dk)yj \\
+(a + bi + cj+ dk)zk $$
Can you take it from there?
A: FOIL method is only a mnemonic for the distributive law, that can be useful for the product of two binomial expressions, but for the product of polynomial expressions  I don't know   a similar mnemonic and we simply use distributivity.
In the case of quaternions we have:
$$
(a_0+a_1 \mathbf i+ a_2 \mathbf j+a_3 \mathbf k) (b_0+b_1 \mathbf i+ b_2 \mathbf j+b_3 \mathbf k) =a_0(b_0+b_1 \mathbf i+ b_2 \mathbf j+b_3 \mathbf k)+a_1 \mathbf i (b_0+b_1 \mathbf i+ b_2 \mathbf j+b_3 \mathbf k)+a_2\mathbf j (b_0+b_1 \mathbf i+ b_2 \mathbf j+b_3 \mathbf k)+a_3\mathbf k (b_0+b_1 \mathbf i+ b_2 \mathbf j+b_3 \mathbf k)=
$$
and the distributive law  can be still applied but, since the product is  not commutative, it is also important to respect the order of the factors when we distribute the products over the sum.
