<?xml version="1.0" encoding="UTF-8"?>

<record version="1" id="1115">
 <title>example of quaternion product</title>
 <name>ExampleOfQuaternionProduct</name>
 <created>2026-08-28 15:35:32</created>
 <modified>2026-08-28 15:35:32</modified>
 <type>Example</type>
<parent id="1090">quaternion product</parent>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="02.10.Hh"/>
	<category scheme="pacs" code="02.10.Ud"/>
	<category scheme="pacs" code="02.10.Xm"/>
 </classification>
 <related>
	<object name="QuaternionSeriesOverviewAndArticleGuide"/>
	<object name="NotationQuaternionsForPhysicsAndEngineeringOrientation"/>
	<object name="QuaternionDefinitionAndBasicAlgebra"/>
	<object name="ExampleOfQuaternionDefinitionAndBasicAlgebra"/>
	<object name="QuaternionProduct"/>
 </related>
 <preamble>% this is the default PhysicsLibrary preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics).
% If you use \includegraphics{figure} with no file extension, PhysicsLibrary
% will prefer figure.png before falling back to figure.eps.
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.jpg,.jpeg,.pdf,.eps}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content>\section*{Quaternion Product in Scalar Vector Form:
Examples, Exercises, and Solutions}

This entry is the self study companion to
\emph{Quaternion Product in Scalar Vector Form}.

The emphasis is the Hamilton product itself: how its scalar and vector pieces
arise, why the cross product sign determines the multiplication convention,
and how noncommutativity is encoded geometrically.

All exercises are stated first.  Complete worked solutions follow afterward.

\section{Formula summary}

Write

\[
p=p_w+\mathbf p,
\qquad
q=q_w+\mathbf q,
\]

where $p_w,q_w\in\mathbb R$ and $\mathbf p,\mathbf q$ are pure quaternions
identified with three dimensional vectors.

PhysicsLibrary uses the Hamilton product

\begin{equation}
pq
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q
\right)
+
\left(
p_w\mathbf q
+
q_w\mathbf p
+
\mathbf p\times\mathbf q
\right).
\end{equation}

Equivalently,

\begin{equation}
(p_w,\mathbf p)(q_w,\mathbf q)
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
\right).
\end{equation}

For pure quaternions,

\begin{equation}
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b
+
\mathbf a\times\mathbf b.
\end{equation}

Reversing the factors gives

\begin{equation}
qp
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q
\right)
+
\left(
p_w\mathbf q
+
q_w\mathbf p
-
\mathbf p\times\mathbf q
\right).
\end{equation}

Therefore the commutator is

\begin{equation}
\relax[p,q]
=
pq-qp
=
2\mathbf p\times\mathbf q.
\end{equation}

The symmetric combination is

\begin{equation}
pq+qp
=
2
\left(
p_wq_w-\mathbf p\cdot\mathbf q
\right)
+
2
\left(
p_w\mathbf q+q_w\mathbf p
\right).
\end{equation}

\section{Exercises}

\begin{enumerate}

\item \textbf{Derive the pure quaternion product.}

Let

\[
\mathbf a
=
a_x\mathbf i+a_y\mathbf j+a_z\mathbf k
\]

and

\[
\mathbf b
=
b_x\mathbf i+b_y\mathbf j+b_z\mathbf k.
\]

Starting from Hamilton's basis products, derive

\[
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b
+
\mathbf a\times\mathbf b.
\]

Identify the scalar and vector parts explicitly.

\item \textbf{Product from scalar and vector parts.}

Let

\[
p
=
2+\mathbf i-2\mathbf j+\mathbf k
\]

and

\[
q
=
-1+3\mathbf i+2\mathbf k.
\]

Compute $pq$ using the scalar vector formula rather than a sixteen term
component expansion.

\item \textbf{Reverse the product efficiently.}

For the quaternions in Exercise 2, compute $qp$ without repeating the full
calculation.

Use the symmetry of the dot product and antisymmetry of the cross product.

\item \textbf{Commutator.}

Using the same $p$ and $q$, compute

\[
[p,q]
=
pq-qp
\]

both from the two products and directly from

\[
[p,q]
=
2\mathbf p\times\mathbf q.
\]

Verify agreement.

\item \textbf{Anticommutator.}

Define

\begin{equation}
\{p,q\}
=
pq+qp.
\end{equation}

Derive the scalar vector formula for $\{p,q\}$ and evaluate it for the
quaternions in Exercise 2.

Which geometric term disappears?

\item \textbf{Pure quaternion square.}

Use the scalar vector product to prove

\[
\mathbf a^2
=
-\lVert\mathbf a\rVert^2
\]

for every pure quaternion $\mathbf a$.

What follows when $\lVert\mathbf a\rVert=1$?

\item \textbf{Perpendicular pure quaternions.}

Suppose

\[
\mathbf a\cdot\mathbf b=0.
\]

Show that

\[
\mathbf a\mathbf b
=
\mathbf a\times\mathbf b
\]

and

\[
\mathbf b\mathbf a
=
-\mathbf a\times\mathbf b.
\]

Use

\[
\mathbf a
=
2\mathbf i+\mathbf j,
\qquad
\mathbf b
=
\mathbf i-2\mathbf j
\]

as a numerical example.

\item \textbf{Parallel pure quaternions.}

Let

\[
\mathbf b=\lambda\mathbf a.
\]

Show that $\mathbf a\mathbf b$ is purely real.

Then evaluate

\[
(2\mathbf i-\mathbf j+2\mathbf k)
(6\mathbf i-3\mathbf j+6\mathbf k).
\]

\item \textbf{Geometric angle encoded in a pure product.}

Let $\mathbf a$ and $\mathbf b$ be unit pure quaternions separated by an angle
$\gamma$.

Show that

\begin{equation}
\mathbf a\mathbf b
=
-\cos\gamma
+
\widehat{\mathbf n}\sin\gamma,
\end{equation}

where $\widehat{\mathbf n}$ points in the direction of
$\mathbf a\times\mathbf b$.

Evaluate the result for $\gamma=60^\circ$ and
$\widehat{\mathbf n}=\mathbf k$.

\item \textbf{When do two quaternions commute?}

Starting from

\[
[p,q]
=
2\mathbf p\times\mathbf q,
\]

prove that

\[
pq=qp
\]

if and only if the vector parts $\mathbf p$ and $\mathbf q$ are parallel,
antiparallel, or one vector part is zero.

\item \textbf{A complex subalgebra.}

Let $\mathbf u$ be a fixed unit pure quaternion, and let

\[
p=a+b\mathbf u,
\qquad
q=c+d\mathbf u.
\]

Show directly that

\[
pq
=
(ac-bd)
+
(ad+bc)\mathbf u.
\]

Then show that $pq=qp$.

Explain why this set is algebraically equivalent to the complex numbers.

\item \textbf{Component formula recovery.}

Starting from

\[
pq
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
\right),
\]

derive the scalar first component formula

\begin{equation}
[pq]_{\mathrm{PL}}
=
\begin{bmatrix}
p_wq_w-p_xq_x-p_yq_y-p_zq_z
\\
p_wq_x+p_xq_w+p_yq_z-p_zq_y
\\
p_wq_y-p_xq_z+p_yq_w+p_zq_x
\\
p_wq_z+p_xq_y-p_yq_x+p_zq_w
\end{bmatrix}.
\end{equation}

\item \textbf{Left multiplication matrix.}

For a fixed quaternion

\[
p
=
p_w+p_x\mathbf i+p_y\mathbf j+p_z\mathbf k,
\]

show that left multiplication can be written

\begin{equation}
[pq]_{\mathrm{PL}}
=
L(p)
[q]_{\mathrm{PL}},
\end{equation}

where

\begin{equation}
L(p)
=
\begin{bmatrix}
p_w&amp;-p_x&amp;-p_y&amp;-p_z\\
p_x&amp;p_w&amp;-p_z&amp;p_y\\
p_y&amp;p_z&amp;p_w&amp;-p_x\\
p_z&amp;-p_y&amp;p_x&amp;p_w
\end{bmatrix}.
\end{equation}

\item \textbf{Right multiplication matrix.}

For fixed $q$, derive a matrix $R(q)$ satisfying

\begin{equation}
[pq]_{\mathrm{PL}}
=
R(q)
[p]_{\mathrm{PL}}.
\end{equation}

Compare the signs in $R(q)$ with those in $L(q)$.

\item \textbf{Associativity as a matrix identity.}

Use the left multiplication matrix to explain why associativity implies

\begin{equation}
L(pq)
=
L(p)L(q).
\end{equation}

Verify this identity numerically for

\[
p=1+\mathbf i,
\qquad
q=1+\mathbf j.
\]

\item \textbf{Hamilton versus flipped multiplication diagnostic.}

A source defines

\begin{equation}
(p_w,\mathbf p)\star(q_w,\mathbf q)
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q
\right).
\end{equation}

Does $\star$ agree with PhysicsLibrary Hamilton multiplication?

Show that

\[
p\star q
=
qp
\]

when the right hand side uses Hamilton multiplication.

\item \textbf{Passive attitude does not change Hamilton multiplication.}

PhysicsLibrary later represents a positive passive frame rotation about
$+z$ by

\[
q_P
=
\frac{1-\mathbf k}{\sqrt2}.
\]

A student argues that because the attitude convention is passive,
PhysicsLibrary should replace the $+\mathbf p\times\mathbf q$ term in the
Hamilton product by a minus sign.

Explain why this reasoning is incorrect.

Use the basis check

\[
\mathbf i\mathbf j
\]

to show what would break if the multiplication law were changed.

\end{enumerate}

\section{Solutions}

\subsection*{Solution 1: derive the pure quaternion product}

Expand without changing factor order:

\[
\begin{aligned}
\mathbf a\mathbf b
={}&amp;
a_xb_x\mathbf i^2
+
a_xb_y\mathbf i\mathbf j
+
a_xb_z\mathbf i\mathbf k
\\
&amp;
+
a_yb_x\mathbf j\mathbf i
+
a_yb_y\mathbf j^2
+
a_yb_z\mathbf j\mathbf k
\\
&amp;
+
a_zb_x\mathbf k\mathbf i
+
a_zb_y\mathbf k\mathbf j
+
a_zb_z\mathbf k^2.
\end{aligned}
\]

Use

\[
\mathbf i^2=\mathbf j^2=\mathbf k^2=-1,
\]

\[
\mathbf i\mathbf j=\mathbf k,
\qquad
\mathbf j\mathbf k=\mathbf i,
\qquad
\mathbf k\mathbf i=\mathbf j,
\]

and the reversed negative products.

The scalar terms are

\[
-a_xb_x-a_yb_y-a_zb_z
=
-\mathbf a\cdot\mathbf b.
\]

The $\mathbf i$ coefficient is

\[
a_yb_z-a_zb_y.
\]

The $\mathbf j$ coefficient is

\[
a_zb_x-a_xb_z.
\]

The $\mathbf k$ coefficient is

\[
a_xb_y-a_yb_x.
\]

These are exactly the components of $\mathbf a\times\mathbf b$.

Therefore

\begin{equation}
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b
+
\mathbf a\times\mathbf b.
\end{equation}

The scalar part is $-\mathbf a\cdot\mathbf b$ and the vector part is
$\mathbf a\times\mathbf b$.

\subsection*{Solution 2: product from scalar and vector parts}

Write

\[
p_w=2,
\qquad
\mathbf p
=
\begin{bmatrix}
1\\-2\\1
\end{bmatrix},
\]

and

\[
q_w=-1,
\qquad
\mathbf q
=
\begin{bmatrix}
3\\0\\2
\end{bmatrix}.
\]

The dot product is

\[
\mathbf p\cdot\mathbf q
=
1(3)+(-2)(0)+1(2)
=
5.
\]

The cross product is

\[
\mathbf p\times\mathbf q
=
\begin{bmatrix}
-4\\
1\\
6
\end{bmatrix}.
\]

The scalar part is

\[
p_wq_w-\mathbf p\cdot\mathbf q
=
2(-1)-5
=
-7.
\]

The vector part is

\[
\begin{aligned}
p_w\mathbf q
+
q_w\mathbf p
+
\mathbf p\times\mathbf q
&amp;=
2
\begin{bmatrix}
3\\0\\2
\end{bmatrix}
-
\begin{bmatrix}
1\\-2\\1
\end{bmatrix}
+
\begin{bmatrix}
-4\\1\\6
\end{bmatrix}
\\
&amp;=
\begin{bmatrix}
1\\3\\9
\end{bmatrix}.
\end{aligned}
\]

Hence

\begin{equation}
pq
=
-7+\mathbf i+3\mathbf j+9\mathbf k.
\end{equation}

\subsection*{Solution 3: reverse the product efficiently}

The scalar part remains unchanged because

\[
\mathbf q\cdot\mathbf p
=
\mathbf p\cdot\mathbf q.
\]

The scalar multiplication terms in the vector part are also unchanged:

\[
q_w\mathbf p+p_w\mathbf q
=
p_w\mathbf q+q_w\mathbf p.
\]

Only the cross product changes sign:

\[
\mathbf q\times\mathbf p
=
-\mathbf p\times\mathbf q
=
\begin{bmatrix}
4\\-1\\-6
\end{bmatrix}.
\]

Thus the vector part of $qp$ is

\[
\begin{aligned}
q_w\mathbf p
+
p_w\mathbf q
+
\mathbf q\times\mathbf p
&amp;=
-
\begin{bmatrix}
1\\-2\\1
\end{bmatrix}
+
2
\begin{bmatrix}
3\\0\\2
\end{bmatrix}
+
\begin{bmatrix}
4\\-1\\-6
\end{bmatrix}
\\
&amp;=
\begin{bmatrix}
9\\1\\-3
\end{bmatrix}.
\end{aligned}
\]

Therefore

\begin{equation}
qp
=
-7+9\mathbf i+\mathbf j-3\mathbf k.
\end{equation}

\subsection*{Solution 4: commutator}

From Solutions 2 and 3,

\[
\begin{aligned}
[p,q]
&amp;=
pq-qp\\
&amp;=
(-7+\mathbf i+3\mathbf j+9\mathbf k)
-
(-7+9\mathbf i+\mathbf j-3\mathbf k).
\end{aligned}
\]

Thus

\begin{equation}
\relax[p,q]
=
-8\mathbf i+2\mathbf j+12\mathbf k.
\end{equation}

Directly,

\[
2\mathbf p\times\mathbf q
=
2
\begin{bmatrix}
-4\\1\\6
\end{bmatrix}
=
\begin{bmatrix}
-8\\2\\12
\end{bmatrix},
\]

which gives the same pure quaternion.

\subsection*{Solution 5: anticommutator}

Add the general products:

\[
pq
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
\right)
\]

and

\[
qp
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q
\right).
\]

The cross products cancel.

Therefore

\begin{equation}
\{p,q\}
=
2
\left(
p_wq_w-\mathbf p\cdot\mathbf q
\right)
+
2
\left(
p_w\mathbf q+q_w\mathbf p
\right).
\end{equation}

For Exercise 2,

\[
pq
=
-7+\mathbf i+3\mathbf j+9\mathbf k
\]

and

\[
qp
=
-7+9\mathbf i+\mathbf j-3\mathbf k.
\]

Thus

\begin{equation}
\{p,q\}
=
-14+10\mathbf i+4\mathbf j+6\mathbf k.
\end{equation}

The oriented cross product term disappears from the symmetric combination.

\subsection*{Solution 6: pure quaternion square}

Set $\mathbf b=\mathbf a$ in

\[
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b
+
\mathbf a\times\mathbf b.
\]

Then

\[
\mathbf a^2
=
-\mathbf a\cdot\mathbf a
+
\mathbf a\times\mathbf a.
\]

Since

\[
\mathbf a\cdot\mathbf a
=
\lVert\mathbf a\rVert^2
\]

and

\[
\mathbf a\times\mathbf a=\mathbf 0,
\]

we obtain

\begin{equation}
\mathbf a^2
=
-\lVert\mathbf a\rVert^2.
\end{equation}

If $\lVert\mathbf a\rVert=1$, then

\begin{equation}
\mathbf a^2=-1.
\end{equation}

\subsection*{Solution 7: perpendicular pure quaternions}

If

\[
\mathbf a\cdot\mathbf b=0,
\]

then

\[
\mathbf a\mathbf b
=
\mathbf a\times\mathbf b.
\]

Reversing the order gives

\[
\mathbf b\mathbf a
=
\mathbf b\times\mathbf a
=
-\mathbf a\times\mathbf b.
\]

For

\[
\mathbf a=
\begin{bmatrix}
2\\1\\0
\end{bmatrix},
\qquad
\mathbf b=
\begin{bmatrix}
1\\-2\\0
\end{bmatrix},
\]

the dot product is

\[
2(1)+1(-2)=0.
\]

The cross product is

\[
\mathbf a\times\mathbf b
=
\begin{bmatrix}
0\\0\\-5
\end{bmatrix}.
\]

Therefore

\begin{equation}
\mathbf a\mathbf b
=
-5\mathbf k,
\qquad
\mathbf b\mathbf a
=
5\mathbf k.
\end{equation}

\subsection*{Solution 8: parallel pure quaternions}

If

\[
\mathbf b=\lambda\mathbf a,
\]

then

\[
\mathbf a\times\mathbf b
=
\lambda
\mathbf a\times\mathbf a
=
0.
\]

Thus

\[
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b,
\]

which is purely real.

For

\[
\mathbf a
=
2\mathbf i-\mathbf j+2\mathbf k
\]

and

\[
\mathbf b
=
6\mathbf i-3\mathbf j+6\mathbf k
=
3\mathbf a,
\]

we have

\[
\mathbf a\cdot\mathbf b
=
2(6)+(-1)(-3)+2(6)
=
27.
\]

Therefore

\begin{equation}
\mathbf a\mathbf b=-27.
\end{equation}

\subsection*{Solution 9: geometric angle encoded in a pure product}

For unit vectors,

\[
\mathbf a\cdot\mathbf b
=
\cos\gamma.
\]

Also,

\[
\lVert
\mathbf a\times\mathbf b
\rVert
=
\sin\gamma.
\]

If $\widehat{\mathbf n}$ is the unit vector in the direction of the cross
product,

\[
\mathbf a\times\mathbf b
=
\widehat{\mathbf n}\sin\gamma.
\]

Therefore

\begin{equation}
\mathbf a\mathbf b
=
-\cos\gamma
+
\widehat{\mathbf n}\sin\gamma.
\end{equation}

For

\[
\gamma=60^\circ,
\qquad
\widehat{\mathbf n}=\mathbf k,
\]

we get

\begin{equation}
\mathbf a\mathbf b
=
-\frac12
+
\frac{\sqrt3}{2}\mathbf k.
\end{equation}

\subsection*{Solution 10: when do two quaternions commute?}

The commutator is

\[
[p,q]
=
2\mathbf p\times\mathbf q.
\]

Therefore

\[
pq=qp
\]

if and only if

\[
\mathbf p\times\mathbf q=0.
\]

In three dimensional Euclidean space, a cross product is zero exactly when
the vectors are linearly dependent or one is zero.

Thus the vector parts must be parallel, antiparallel, or one vector part must
vanish.

Hence

\begin{equation}
pq=qp
\quad\Longleftrightarrow\quad
\mathbf p\times\mathbf q=0.
\end{equation}

\subsection*{Solution 11: a complex subalgebra}

Let

\[
p=a+b\mathbf u,
\qquad
q=c+d\mathbf u,
\]

with

\[
\mathbf u^2=-1.
\]

Multiply:

\[
\begin{aligned}
pq
&amp;=
ac
+
ad\mathbf u
+
bc\mathbf u
+
bd\mathbf u^2\\
&amp;=
(ac-bd)
+
(ad+bc)\mathbf u.
\end{aligned}
\]

Therefore

\begin{equation}
pq
=
(ac-bd)
+
(ad+bc)\mathbf u.
\end{equation}

Reversing the factors gives

\[
qp
=
(ca-db)
+
(cb+da)\mathbf u.
\]

Real coefficients commute, so

\[
qp=pq.
\]

The map

\[
a+b\mathbf u
\longleftrightarrow
a+b\,\mathrm i_{\mathbb C}
\]

preserves addition and multiplication because both imaginary units square to
$-1$.

Thus this two dimensional quaternion subalgebra is isomorphic to the complex
numbers.

\subsection*{Solution 12: component formula recovery}

The scalar part is

\[
p_wq_w
-
(p_xq_x+p_yq_y+p_zq_z),
\]

so the first component is

\[
p_wq_w-p_xq_x-p_yq_y-p_zq_z.
\]

For the vector part,

\[
p_w\mathbf q
+
q_w\mathbf p
+
\mathbf p\times\mathbf q,
\]

the cross product is

\[
\mathbf p\times\mathbf q
=
\begin{bmatrix}
p_yq_z-p_zq_y\\
p_zq_x-p_xq_z\\
p_xq_y-p_yq_x
\end{bmatrix}.
\]

Add the scalar multiple terms componentwise.

The $\mathbf i$ component becomes

\[
p_wq_x+p_xq_w+p_yq_z-p_zq_y.
\]

The $\mathbf j$ component becomes

\[
p_wq_y-p_xq_z+p_yq_w+p_zq_x.
\]

The $\mathbf k$ component becomes

\[
p_wq_z+p_xq_y-p_yq_x+p_zq_w.
\]

Therefore

\begin{equation}
[pq]_{\mathrm{PL}}
=
\begin{bmatrix}
p_wq_w-p_xq_x-p_yq_y-p_zq_z
\\
p_wq_x+p_xq_w+p_yq_z-p_zq_y
\\
p_wq_y-p_xq_z+p_yq_w+p_zq_x
\\
p_wq_z+p_xq_y-p_yq_x+p_zq_w
\end{bmatrix}.
\end{equation}

\subsection*{Solution 13: left multiplication matrix}

Start from the component formula for $pq$ and collect coefficients multiplying

\[
q_w,
\quad
q_x,
\quad
q_y,
\quad
q_z.
\]

The scalar component is

\[
p_wq_w-p_xq_x-p_yq_y-p_zq_z.
\]

The $\mathbf i$ component is

\[
p_xq_w+p_wq_x-p_zq_y+p_yq_z.
\]

The $\mathbf j$ component is

\[
p_yq_w+p_zq_x+p_wq_y-p_xq_z.
\]

The $\mathbf k$ component is

\[
p_zq_w-p_yq_x+p_xq_y+p_wq_z.
\]

Hence

\begin{equation}
[pq]_{\mathrm{PL}}
=
\begin{bmatrix}
p_w&amp;-p_x&amp;-p_y&amp;-p_z\\
p_x&amp;p_w&amp;-p_z&amp;p_y\\
p_y&amp;p_z&amp;p_w&amp;-p_x\\
p_z&amp;-p_y&amp;p_x&amp;p_w
\end{bmatrix}
[q]_{\mathrm{PL}}.
\end{equation}

Thus

\begin{equation}
L(p)
=
\begin{bmatrix}
p_w&amp;-p_x&amp;-p_y&amp;-p_z\\
p_x&amp;p_w&amp;-p_z&amp;p_y\\
p_y&amp;p_z&amp;p_w&amp;-p_x\\
p_z&amp;-p_y&amp;p_x&amp;p_w
\end{bmatrix}.
\end{equation}

\subsection*{Solution 14: right multiplication matrix}

Now collect the component formula for $pq$ by coefficients of the components
of $p$.

The result is

\begin{equation}
R(q)
=
\begin{bmatrix}
q_w&amp;-q_x&amp;-q_y&amp;-q_z\\
q_x&amp;q_w&amp;q_z&amp;-q_y\\
q_y&amp;-q_z&amp;q_w&amp;q_x\\
q_z&amp;q_y&amp;-q_x&amp;q_w
\end{bmatrix},
\end{equation}

so that

\begin{equation}
[pq]_{\mathrm{PL}}
=
R(q)
[p]_{\mathrm{PL}}.
\end{equation}

Compare $R(q)$ with

\[
L(q)
=
\begin{bmatrix}
q_w&amp;-q_x&amp;-q_y&amp;-q_z\\
q_x&amp;q_w&amp;-q_z&amp;q_y\\
q_y&amp;q_z&amp;q_w&amp;-q_x\\
q_z&amp;-q_y&amp;q_x&amp;q_w
\end{bmatrix}.
\]

The scalar row is identical, but the signs associated with the cross product
structure differ.  This is the matrix manifestation of left versus right
Hamilton multiplication.

\subsection*{Solution 15: associativity as a matrix identity}

For any quaternion $r$,

\[
L(pq)[r]_{\mathrm{PL}}
=
[(pq)r]_{\mathrm{PL}}.
\]

Associativity gives

\[
(pq)r
=
p(qr).
\]

Therefore

\[
[(pq)r]_{\mathrm{PL}}
=
L(p)L(q)[r]_{\mathrm{PL}}.
\]

Since this holds for every $r$,

\begin{equation}
L(pq)
=
L(p)L(q).
\end{equation}

For

\[
p=1+\mathbf i,
\qquad
q=1+\mathbf j,
\]

the Hamilton product is

\[
pq
=
1+\mathbf i+\mathbf j+\mathbf k.
\]

Thus

\[
L(pq)
=
\begin{bmatrix}
1&amp;-1&amp;-1&amp;-1\\
1&amp;1&amp;-1&amp;1\\
1&amp;1&amp;1&amp;-1\\
1&amp;-1&amp;1&amp;1
\end{bmatrix}.
\]

Also,

\[
L(p)
=
\begin{bmatrix}
1&amp;-1&amp;0&amp;0\\
1&amp;1&amp;0&amp;0\\
0&amp;0&amp;1&amp;-1\\
0&amp;0&amp;1&amp;1
\end{bmatrix},
\]

and

\[
L(q)
=
\begin{bmatrix}
1&amp;0&amp;-1&amp;0\\
0&amp;1&amp;0&amp;1\\
1&amp;0&amp;1&amp;0\\
0&amp;-1&amp;0&amp;1
\end{bmatrix}.
\]

Direct matrix multiplication gives

\begin{equation}
L(p)L(q)
=
\begin{bmatrix}
1&amp;-1&amp;-1&amp;-1\\
1&amp;1&amp;-1&amp;1\\
1&amp;1&amp;1&amp;-1\\
1&amp;-1&amp;1&amp;1
\end{bmatrix}
=
L(pq).
\end{equation}

\subsection*{Solution 16: Hamilton versus flipped multiplication diagnostic}

PhysicsLibrary Hamilton multiplication uses

\[
+\mathbf p\times\mathbf q
\]

in the vector part.

The proposed operation $\star$ uses

\[
-\mathbf p\times\mathbf q.
\]

Therefore it does not agree with PhysicsLibrary Hamilton multiplication.

Under Hamilton multiplication,

\[
qp
=
\left(
q_wp_w-\mathbf q\cdot\mathbf p,\;
q_w\mathbf p+p_w\mathbf q+\mathbf q\times\mathbf p
\right).
\]

Use

\[
\mathbf q\cdot\mathbf p
=
\mathbf p\cdot\mathbf q
\]

and

\[
\mathbf q\times\mathbf p
=
-\mathbf p\times\mathbf q.
\]

Then

\[
qp
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p-\mathbf p\times\mathbf q
\right).
\]

Hence

\begin{equation}
p\star q
=
qp.
\end{equation}

The proposed operation is the reversed Hamilton product.

\subsection*{Solution 17: passive attitude does not change Hamilton multiplication}

The passive attitude convention specifies how a quaternion is interpreted as a
frame transformation.

Hamilton multiplication specifies the algebra used to multiply quaternion
elements.

These are separate choices.

PhysicsLibrary retains

\[
\mathbf i\mathbf j=\mathbf k
\]

whether the quaternion is being used as a passive attitude map, an algebraic
quantity, or a pure quaternion encoding a vector.

If the cross product sign were changed merely because an attitude convention
was passive, then the pure product rule would become

\[
\mathbf i\mathbf j
=
-\mathbf i\times\mathbf j
=
-\mathbf k.
\]

That would contradict the declared Hamilton basis relation

\[
\mathbf i\mathbf j=\mathbf k.
\]

Thus the later passive attitude quaternion

\[
q_P
=
\frac{1-\mathbf k}{\sqrt2}
\]

changes the interpretation of the quaternion's vector sign for a positive
frame rotation.  It does not change the multiplication law.

\section{Compact review}

The multiplication companion can be summarized by four identities:

\begin{equation}
pq
=
\left(
p_wq_w-\mathbf p\cdot\mathbf q,\;
p_w\mathbf q+q_w\mathbf p+\mathbf p\times\mathbf q
\right),
\end{equation}

\begin{equation}
\mathbf a\mathbf b
=
-\mathbf a\cdot\mathbf b
+
\mathbf a\times\mathbf b,
\end{equation}

\begin{equation}
\relax[p,q]
=
2\mathbf p\times\mathbf q,
\end{equation}

and

\begin{equation}
pq=qp
\quad\Longleftrightarrow\quad
\mathbf p\times\mathbf q=0.
\end{equation}

The cross product sign is a direct multiplication convention diagnostic:
PhysicsLibrary Hamilton multiplication uses the positive sign.

\section{Sources and exercise provenance}

The exercises and solutions in this companion are newly written or expanded
for PhysicsLibrary from the algebra developed in
\emph{Quaternion Product in Scalar Vector Form}.

Hamilton is the foundational source for the quaternion product.  Joly and
Kelland--Tait provide classical systematic treatments and examples.  Sommer
and coauthors provide a modern discussion of Hamilton versus reversed
quaternion multiplication in engineering applications.

\begin{thebibliography}{9}

\bibitem{Hamilton1899}
W. R. Hamilton,
\emph{Elements of Quaternions},
2nd ed.,
edited by C. J. Joly,
Longmans, Green, and Co.,
1899.
Public domain historical source.
\PMlinkexternal{Internet Archive scan}
{https://archive.org/details/elementsofquater01hamiuoft}

\bibitem{Joly1905}
C. J. Joly,
\emph{A Manual of Quaternions},
Macmillan and Co.,
London,
1905.
Public domain historical source.
\PMlinkexternal{Internet Archive search}
{https://archive.org/search?query=A+Manual+of+Quaternions+Joly}

\bibitem{KellandTait1882}
P. Kelland and P. G. Tait,
\emph{Introduction to Quaternions, with Numerous Examples},
2nd ed.,
Macmillan and Co.,
London,
1882.
Public domain historical source.
\PMlinkexternal{Internet Archive search}
{https://archive.org/search?query=Introduction+to+Quaternions+Kelland+Tait}

\bibitem{Sommer2018}
H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto,
``Why and How to Avoid the Flipped Quaternion Multiplication,''
\emph{Aerospace},
vol. 5,
no. 3,
article 72,
2018.
Published under CC BY 4.0.
\PMlinkexternal{Publisher article}
{https://www.mdpi.com/2226-4310/5/3/72}

\end{thebibliography}

\section*{License}

Unless otherwise noted, this PhysicsLibrary entry is intended for release
under the Creative Commons Attribution ShareAlike 4.0 International license.</content>
</record>
