Multiplication of quaternion vectors Upon watching a lecture on quaternions (Youtube link), I came across the following math:
$$(a,\vec{v})(a,- \vec{v})=(a^2+(\vec{v}\cdot \vec{v}),-a\vec{v}+a\vec{v}+(\vec{v}\times \vec{v}))$$
where $a$ is scalar and $\vec{v}$ is a quaternion vector.
Perhaps I am missing something obvious, but how did he make that equality? He's not using "matrix multiplication" as the vectors are not the right dimensions and neither is this a situation where FOIL would apply.
I am confused since it seems to me that I have missed something obvious.
 A: Just as complex numbers have a "real part" and an "imaginary part", quaternions (which can be thought of as elements of $\Bbb R^4$ with a "special multiplication") can also be separated into a "real part" and a "vector part" (that is, as an element of $\Bbb R \times \Bbb R^3$):
$q = a + bi + cj + dk \to (a,(b,c,d))$.
The quaternion product is given so:
$qq' = (a + bi + cj + dk)(a'+b'i + c'j + d'k)$
$=  (aa' - bb' - cc' - dd') + (ab' + a'b + cd' - c'd)i + (ac' + a'c + b'd - bd')j + (ad' + a'd + bc' - b'c)k.$
Writing this as $q = (a,\vec{v})$ and $q' = (a',\vec{w})$, some tedious algebra gives:
$qq' = (aa' - \vec{v}\cdot\vec{w}, a\vec{v} + a'\vec{w} + \vec{v} \times \vec{w})$.
It is common for $q = (a,\vec{v})$ to call $\overline{q} = (a,-\vec{v})$ the quaternion conjugate of $q$, and in this case we see that:
$q\overline{q} = (a^2 +\|\vec{v}\|^2,0)$, which can be considered as a real number, and that $\sqrt{q\overline{q}}$ is thus the same as the length of the vector $q$ seen as an element of $\Bbb R^4$. This number is called the norm of $q$, $\|q\|$.
Of particular interest are the quaternions of the form $q = (0,\vec{v})$ where $\|\vec{v}\|$ (and thus $\|q\|$) equals $1$-these can be identified with vectors on the unit sphere in $\Bbb R^3$. In fact, for such quaternions $p,q$, the map:
$p \mapsto qpq^{-1}$
can be identified with a rotation of the sphere in $3$-space.
All of this is in analogy with the complex numbers, complex-conjugation, and regarding purely imaginary numbers of norm $1$ as rotations acting on complex numbers with $|z| = 1$ (the unit circle).
A: You seem to have missed that the definition of quaternion multiplication is
$$(a_1+b_1i+c_1j+d_1k)\cdot (a_2+b_2i+c_2j+d_2k)=$$
$$(a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2)\\
{}+ (a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2)i\\
{}+ (a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2)j\\
{}+ (a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2)k$$
(look at time 11:30).
You can choose to express a quaternion $a+bi+cj+dk$ as the pair $(a,\vec{v})$ where $\vec{v}=\langle b,c,d\rangle$ (look at time 12:30).
Thus, going directly from the definition, if we use this alternative way of expressing quaternions,
$$(a_1,\vec{v}_1)\cdot (a_2,\vec{v}_2)=(z,\vec{w})$$
where $z$ is the scalar
$$z=a_1a_2 - b_1b_2 - c_1c_2 - d_1d_2$$
and $\vec{w}$ is the vector
$$\vec{w}=\Bigl\langle a_1b_2 + b_1a_2 + c_1d_2 - d_1c_2,\;\;
a_1c_2 - b_1d_2 + c_1a_2 + d_1b_2,\;\;
a_1d_2 + b_1c_2 - c_1b_2 + d_1a_2\Bigr\rangle$$
You can check that
$$z=a_1a_2-(\vec{v}_1\cdot \vec{v}_2)\\
\vec{w}=a_1\vec{v}_2+a_2\vec{v}_1+(\vec{v}_1\times\vec{v}_2)$$
which is exactly what's written on the board at time 14:25.
Therefore
$$(a,\vec{v})\cdot (a,-\vec{v})=(a^2+(\vec{v}\cdot\vec{v}),-a\vec{v}+a\vec{v}+(\vec{v}\times\vec{v})).$$
A: It seems the person in this youtube video likes to take any quaternion $q = a + bi + cj + dk$ and write it as $(a,\overrightarrow{v})$ where $\overrightarrow{v} = b\hat{i} + c\hat{j} + d\hat{k}$ holds all of the information for the imaginary part of the quaternion. I personally do not see the necessity for such notation so I will not bother with it. But what you are looking for is this:
$$qq^* = (a + bi + cj + dk)(a - bi - cj - dk) = a^2 + b^2 + c^2 + d^2 = \|q\|^2$$
where $q^*$ denotes the quaternion conjugate. If you want you can actually take the last step and rewrite it:
$$\|q\|^2 = a^2 + b^2 + c^2 + d^2 = a^2 + \|\overrightarrow{v}\|^2 = a^2 + \overrightarrow{v} \cdot \overrightarrow{v}$$ 
The above calculations are a special case, specifically for the multiplication of a quaternion and its conjugate. To generalize though:
$$q_1q_2 = (a_1 + b_1i + c_1j + d_1k)(a_2 + b_2i + c_2j + d_2k)$$
$$= a_1a_2 + a_1b_2i + a_1c_2j + a_1d_2k + a_2b_1i - b_1b_2 + b_1c_2k - b_1d_2j + a_2c_1j - b_2c_1k - c_1c_2 + c_1d_2i + a_2d_1k + b_2d_1j - c_2d_1i - d_1d_1$$
$$= (a_1a_2 - b_1b_2 - c_1c_2 - d_1d_1) + (a_1b_2 + a_2b_1 + c_1d_2 - c_2d_1)i + (a_1c_2 - b_1d_2 + a_2c_1 + b_2d_1)j + (a_1d_2 + b_1c_2 - b_2c_1 + a_2d_1)k$$
$$= (a_1a_2 - b_1b_2 - c_1c_2 - d_1d_1) + \Big[ a_1b_2i + a_1c_2j + a_1d_2k \Big] + \Big[ a_2b_1i + a_2c_1j + a_2d_1k \Big] + \Big[ (c_1d_2 - c_2d_1)i + (b_2d_1 - b_1d_2)j + (b_1c_2 - b_2c_1)k \Big]$$
$$= a_1a_2 - \overrightarrow{v}_1 \cdot \overrightarrow{v_2} + a_1\overrightarrow{v}_2 + a_2\overrightarrow{v}_1 + \overrightarrow{v}_1 \times \overrightarrow{v}_2$$
Now if you really want you can write this in the other notation as:
$$(a_1,\overrightarrow{v}_1)(a_2,\overrightarrow{v}_2) = (a_1a_2 - \overrightarrow{v}_1 \cdot \overrightarrow{v}_2, a_1\overrightarrow{v}_2 + a_2\overrightarrow{v}_1 + \overrightarrow{v}_1 \times \overrightarrow{v}_2)$$
Now to check the first result using this definition, let $q_2 = q_1^*$:
$$(a,\overrightarrow{v})(a,-\overrightarrow{v}) = (a^2 + \overrightarrow{v} \cdot \overrightarrow{v}, -a\overrightarrow{v} + a\overrightarrow{v} + \overrightarrow{v} \times \overrightarrow{v}) = (a^2 + \|\overrightarrow{v}\|^2,0)$$
