## Quaternions
This subsection is mostly from [[cite_manchesterQuaternionVariationalIntegrators2016a]] where he says "the exponential of a quaternion having zero scalar part is always a unit quaternion, a varied unit quaternion can be defined as:
$
{^\epsilon}q = qe^{\epsilon \hat{\boldsymbol{\eta}}}
\tag{3a.1}
$
"
In the above equation, ${^\epsilon}q$ denotes a varied quaternion.
> [!seealso] hat notation
> The $\hat{}$ operator was first seen in Equation ($4$) in [[3b Quaternions#Rotations with Unit Quaternions]].
>
One can also compute the time derivative of this varied quaternion as:
$
{^\epsilon}\dot{q} = \dot{q}e^{\epsilon \hat{\boldsymbol{\eta}}} + \epsilon q \dot{\hat{\boldsymbol{\eta}}} e^{\epsilon \hat{\boldsymbol{\eta}}}
\tag{3a.2}
$
### First Variation of quaternion
The first variation of the quaternion is given by (see [[3 What is a varied quantity in variational calculus#The Varied Quantity and The Variation|immediate parent to this note]]):
$
\delta q (t) = \frac{\partial {{^\epsilon}q}}{\partial \epsilon}\Bigr|_{\epsilon=0} \epsilon
\tag{3a.3}
$
which ought to simplify to:
$
\delta q (t) = qe^{\epsilon \hat{\boldsymbol{\eta}}}\hat{\boldsymbol{\eta}}\Bigr|_{\epsilon=0} \epsilon
\tag{3a.4}
$
which, upon setting $\epsilon=0$, results in:
$
\delta q (t) = \epsilon q\hat{\boldsymbol{\eta}}
\tag{3a.5}
$
## Rotation Matrices
This subsection is mostly from [[cite_leeLieGroupVariational2005]], where they say "the configuration space is the rotation group $SO(3)$, the variation should be consistent with the rotation group". The varied rotation matrix is $R^\epsilon \in \mathrm{SO}(3)$ and obtained by:
$
R{^\epsilon} = Re^{\epsilon \eta}
\tag{3a.6}
$
where:
- $R \in \mathrm{SO}(3)$ is the rotation matrix from the body-fixed frame to the inertial frame;
- $\epsilon \in \mathbb{R}$, $\eta \in \mathfrak{so}(3)$ denotes a variation in the Lie algebra of skew symmetric matrices vanishing at $t_0$ and $t_f $.
One can also compute the time derivative of this varied rotation matrix as:
$
\dot{R}{^\epsilon} = \dot{R}e^{\epsilon {\eta}} + \epsilon R e^{\epsilon {\eta}} \dot{\eta}
\tag{3a.7}
$
### First Variation of Rotation Matrices