Multiplying Quaternions the Easy Way

doug  <sweetser@world.com>

Multiplying two complex numbers a + b I and c + d I is straightforward.

{a, b} * {c, d}  ==  {ac  -  bd,  ad  +  bc}

(a, b) (c, d)  =  (ac  -  bd,  ad  +  bc)

For two quaternions, b I and d I become the 3-vectors B and D, where    B = x I + y J + z K and similarly for D.  Multiplication of quaternions is like complex numbers, but with the addition of the cross product.

{a, (Overscript[B, ⇀])} * {c, (Overscript[D, ⇀])}  == 
       {ac  -  (Overscript[B, ⇀]).(Overscript[D, ⇀]),  
        a  (Overscript[D, ⇀])  +  (Overscript[B, ⇀]) c  +  
          (Overscript[B, ⇀]) x (Overscript[D, ⇀])}

(a, (Overscript[B, ⇀])) (c, (Overscript[D, ⇀]))  =  
      (ac  -  (Overscript[B, ⇀]).(Overscript[D, ⇀]),  
        a  (Overscript[D, ⇀])  +  (Overscript[B, ⇀]) c  +  
          (Overscript[B, ⇀]) x (Overscript[D, ⇀]))

Note that the last term, the cross product, would change its sign if the order of multiplication were reversed (unlike all the other terms).  That is why quaternions in general do not commute.

If a is the operator d/dt, and B is the del operator, or d/dx I + d/dy J + d/dz K (all partial derivatives), then these operators act on the scalar function c and the 3-vector function D in the following manner:

{(d/dt), (Overscript[▽, ⇀])}*{c, (Overscript[D, ⇀])}
           == {(dc/dt)  -  
          (Overscript[▽, ⇀]).(Overscript[D, ⇀]), 
        ((d  (Overscript[D, ⇀]))/dt) + 
          (Overscript[▽, ⇀]) c + 
          (Overscript[▽, ⇀]) x (Overscript[D, ⇀])}

((d/dt), (Overscript[▽, ⇀])) 
        (c, (Overscript[D, ⇀])) = 
      ((dc/dt)  -  (Overscript[▽, ⇀]).(Overscript[D, ⇀]), 
        ((d  (Overscript[D, ⇀]))/dt) + 
          (Overscript[▽, ⇀]) c + 
          (Overscript[▽, ⇀]) x (Overscript[D, ⇀]))

This one quaternion contains the time derivatives of the scalar and 3-vector functions, along with the divergence, the gradient and the curl.  Dense notation :-)