Quaternion Dynamics, Part 1 Functions, Derivatives, and Integrals Gary D. Simpson gsim1887@aol.com rev 1 Aug 8, 216 Summary Definitions are presented for "quaternion functions" of a quaternion. Polynomial and exponential quaternion functions are presented. Derivatives and integrals of tese quaternion functions are developed. It is sown tat quaternion multiplication can be represented by matrix multiplication provided te matrix as a specific type of structure. It is also sown tat differentiation and integration are similar to teir non-quaternion applications. Preface Knowledge of quaternions and Linear Algebra is required. Page 1 of 21
Discussion In Part II of "Elements of Quaternions", Hamilton develops te Calculus of quaternions. His tinking in tat text seems to ave been restricted to situations were te coefficients of a quaternion are functions of an independent parameter suc as time. It does not appear tat e considered te possibility of a quaternion being a function of anoter quaternion. It also does not appear tat e considered te derivative of a quaternion function taken wit respect to a quaternion. Te objective of tis text is to extend Hamilton s work to include tese possibilities. Development Background: A quaternion is frequently defined as te sum of a scalar and a vector. Tis appears superficially to be true, but it is not entirely correct. Tis will be clarified in te next few paragraps. Quaternions were developed by Hamilton as a metod of expressing te ratio between two vectors. Terefore, let us consider tat application. Let te quaternion Q represent te ratio between vector y and vector x. Te quaternion Q is terefore: ; Here, a quaternion is designated by a bold-faced CAPITAL letter. A vector is designated by a bold-faced lower-case letter. A scalar is designated by a lower-case letter in regular font. Te units of measure for vector x and vector y are lengt. Terefore, quaternion Q as no units of measure since it is lengt divided by lengt. Terefore, "vector" q is not truly a vector. It is more like te gost of a vector. Tis is because it as direction, but it does not ave any pysical dimensions suc as lengt or force. Quaternions are used to describe pysical, tree-dimensional space. Te unit vectors i, j, and k form a tree-dimensional coordinate system. Te values q i, q j, and q k eac represent "distances" in te direction of te respective unit vectors. But wat is te value q? Tis is a subtle idea. A quaternion can ave q values tat are any scalar value. For a quaternion, te scalar value can be zero or it can be nonzero. For a vector, te scalar value must be zero. Terefore, vectors represent a subset of quaternions. Also, te coefficients of a vector can ave pysical dimensions suc as lengt or force. Te coefficients of a quaternion represent direction and rotation. Tey ave geometric meaning but tey do not always ave pysical meaning. A quaternion will only ave pysical units suc as lengt or force if te quaternion is te ratio between two different types of vectors. An example would be dividing a lengt vector by a force vector to produce a strain quaternion. Page 2 of 21
Let us return now to Hamilton's original purpose for quaternions: ; If bot sides are multiplied (on te rigt-and side of Q) by te denominator, te result is: Equation : Wen tis multiplication is performed, te result is te following system of equations: 1 Te objective is to solve for te four terms of Q. Terefore, tis system is expressed as te following matrix multiplication: Equation.1: If te coefficient matrix is pre-multiplied by its transpose, te result is a diagonal matrix as follows: 1 1 1 1 Terefore, te inverse of te coefficient matrix is simply te transpose matrix divided by te sum of te squares of x i, x j, and x k. Tis allows te coefficients of quaternion Q to be determined as follows: Equation.2: 1 Page 3 of 21
Equation.2.1: Equation.2.2: Equation.2.3 Equation.2.: Wat is te meaning of Equation.2.1 since it describes te scalar value q produced by te ratio y/x? Te units of measure (or lack tereof) associated wit Equations.2.1.2. are a clue. Te dimensions of te individual x terms and y terms are all lengt. Terefore, q, q i, q j, and q k are eac dimensionless since tey ave units of lengt 2 /lengt 2. Tis sould not be a surprise since Q is te ratio between two space vectors and te vectors units of measure (lengt) sould cancel wen te ratio is taken. Te meaning of Q is simply to convert between x and y. Pre-multiplication of vector x by quaternion Q maps vector x into vector y. Here, te quaternion Q is an operator. Tere is someting very noteworty regarding te terms of Q. Te sum of te tree xy terms in Equation.2.1 is te dot product of te vector x and te vector y. Te oter xy terms in Equations.2.2 -.2. form te cross product of te vector x and te vector y. Te sum of te squares of te tree terms of x is te square of te lengt of vector x. Terefore, quaternion Q can be expressed as follows: Equation.2.: 1 "; #$% Te subscript R is being used to designate rigt-and side multiplication. Te autor will note tat bot Newton s Law of Gravity and Coulomb s Law of Electrostatics are inversely proportional to te square of te distance. Equation.2. incorporates tis feature wit te added bonus of bot scalar and vector forms. Terefore, Equation.2. could be used to describe - but not explain - bot forces provided te vectors x and y are properly selected and provided consideration is given to te system units of measure and te direction of action. Te autor will also note tat in electro-magnetism, te Lorentz Force is described as F q(e v x B) were F is te resulting force, q is te particle carge, E is te electric field, v Page of 21
is te particle velocity, and B is te magnetic field. It seems clear to te autor tat te quaternion matematics of Hamilton is a tool tat can describe many of te observed pysical laws of nature. Next let us consider te case were Q is te ratio between two quaternions. & ' ' & Repeating te exercise above produces te following system of equations: Equation.3: If te coefficient matrix is pre-multiplied by te transpose, te result is a diagonal matrix as follows: 1 1 1 1 Terefore, te inverse of te coefficient matrix is simply te transpose matrix divided by te sum of te four squares. Tis allows te coefficients of quaternion Q to be determined as follows: Equation.: Equation..1: Equation..2: 1 Page of 21
Equation..3 " Equation..: Terefore, te quaternion Q can be expressed as follows: Equation..: & ' 1 " A consequence of tis analysis is tat te units of measure associated wit te scalar x must be te same as te units of measure associated wit te vector x since te four squares are summed in te denominator. A similar requirement is placed upon te scalar y and te vector y. In Equation, it would ave been equally valid to place te vector x to te left of Q instead of to te rigt of Q. Terefore, tis exercise will be repeated for tat form. Equation.1 becomes: Equation.: Multiplication by te inverse matrix ten produces: Equation.6: 1 Tis ten allows te values for te coefficients of Q to be determined as follows: Equation.6.1: Page 6 of 21
Equation.6.2: Equation.6.3: Equation.6.: A quick comparison between te rigt-and Q and te left-and Q indicates tat tey sare te same scalar term but tat tey ave opposite vector terms. Terefore, Equation.6.: ( 1 "; #$% Te subscript L is being used to designate left-and side multiplication. Te quaternions Q R and Q L are complex conjugates. Continuing te left-and side evaluation for te ratio between two quaternions produces te following: Equation.7: 1 Tis ten allows te values for te coefficients of Q to be determined as follows: Equation.7.1: Equation.7.2: Page 7 of 21
Equation.7.3: " Equation.7.: Terefore, te quaternion Q can be expressed as follows: Equation.7.: ( & ' 1 " It is very tempting to assume tat Equation.7. is te complex conjugate of Equation... However, tis is not te case. Te scalar terms are te same. Te dot product terms (scalar) are te same. Te cross product terms (vector) are opposites. Tese would eac be required of conjugates. But, te x y and y x terms (vector) are te same rater tan opposites in te R form and te L form. Tis prevents te two expressions from being complex conjugates. For te quaternions to be conjugates, tese x y and y x terms would need to sum to zero. Next, let us define a generic quaternion function F(X) suc tat Y F(X). In principle, F(X) could be anyting altoug te autor is primarily considering functions suc as polynomials and exponentials. Te autor will not attempt to develop te sine and cosine functions. Matrices will be used extensively. Te utility of te matrix formulation will become apparent during te discussion of differentiation and integration. Polynomials: In algebra, one of te simplest functions is te line. Tis is usually presented as y mx b. Te quaternion equivalent of tis is: Te multiplication MX is as follows: Te detailed steps are as follows: & )' * )' Page 8 of 21
1 Te next concept is absolutely crucial to understanding all of te material presented ere. Te quaternion multiplication MX can be represented as a matrix multiplication as follows: )', ",, " -.-. Te color coding is included to make it easier to recognize ow te multiplication produces te result. Te scalar and vector terms are te same color wit te scalar terms being a ligter sade and te vector terms being eiter a darker sade or bold. Te quaternion caracteristics (i.e., te values 1, i, j, and k) are contained in te column matrix [x]. Te square matrix [m] contains only scalar values. Formulating te problem is tis manner allows te matrix metods of linear algebra to be combined wit quaternions. Now, te quaternion line can be expressed as follows: Equation 1: & )' * 1 2 2 2 / 2 3 -. -.-. -2. Te autor requests tat te reader carefully examine te x matrix [m] above. It sould be noted tat te matrix [m] consists of four 2x2 matrices as follows: Equation 1.1: Were Equation 1.1.1: -#. -2. -. 6-2. -#. 7 -#. 8 9 ; #$% -2. 6 7 Tis is a special type of symmetry tat appears in Linear Algebra wen dealing wit matrix inversion. Equation 1 can be solved for X as follows: Page 9 of 21
-. :; -. -2." -. were [y], [m], [x], and [b] are as presented in Equation 1. Tis requires te determination of te inverse of matrix [m]. At first glance, tis would appear to be difficult, since it requires solving for te 16 terms of te inverse matrix. Fortunately, te symmetry of te problem (as presented in Equation 1.1) simplifies tis greatly. Multiplication of te coefficient matrix by its transpose produces a diagonal matrix. For ease of reading, te autor will substitute te letters A, B, C, and D for te terms of te coefficient matrix. -. < -. -?. >?? > @ A A @ @ A >? A @? > >? @ A? > A @ @ A 1 A @ 1 >?? > > 1? @ A " 1 Terefore, te inverse matrix is simply te transpose matrix divided by te sum of te four squares. Equation 1.2: -. :; 1 -.< 1 Now let us very briefly consider te complex conjugate of M. Te conjugate is usually denoted using te asterisk symbol (*). Te complex conjugate of M is terefore denoted as M*. Conjugates are defined as follows: Equation 1.2.1: ),; ), Te term m represents te vector portion of M. Te conjugate is noteworty because te transpose matrix [m] T [m*]. For te special case were te transpose matrix is also te inverse matrix, te sum of te four squares must be equal to one. Tis follows directly from Equation 1.2. For quaternions, te order of multiplication is important. Terefore, te reader migt reasonably ask wat would be te result if te order of multiplication in Equation 1 were to be canged from MX to XM instead? Te multiplication XM is as follows: Te detailed steps are as follows: ') Page 1 of 21
1 If te terms are rearranged so as to preserve te MX matrix form of Equation 1, tese detailed steps become: 1 Tis multiplication is ten expressed as a matrix as follows: Tis coefficient matrix does not matc eiter te coefficient matrix from Equation 1 or te transpose of tat matrix. Instead, tis matrix is a curious blend of te two. Column 1 and row 1 are from te original coefficient matrix. Te remainder is from te transpose. Please note tat te symmetry presented in Equation 1.1 as been destroyed. Tis makes te autor curious regarding te possible forms tat te MX multiplication of Equation 1 can take. Tese are MX, M*X, XM, and XM*. It is not necessary to consider te conjugate of X since it is te independent variable. Tese can be represented by te following matrix multiplications: )' ) ' Page 11 of 21
') ') Te autor anticipates tat tese forms will be useful in te future. If te four coefficient matrices are added togeter, te result is a diagonal matrix wit te value m along te diagonal. Next, let us consider a simple quadratic suc as Y X 2. Tis can be tougt of as being Y XX. Terefore, Equation 1 can be used wit M X and B. & ' Now suppose tat Y X 3. Tis can be written as Y XX 2. Tis can ten be combined wit te relation for X 2 to produce: By logical extension, it follows tat: Equation 1.3: & ' C & ' D D:; For N 1, te coefficient matrix becomes te Identity Matrix. For N, te coefficient matrix becomes te Inverse Matrix. Te value of N is restricted to integer values since te (N - 1) term tat is used as an exponent on te coefficient matrix must be an integer. Te above relations make it possible to produce a generic quaternion-based polynomial as follows: Equation 1.: & E D ' D E D:; ' D:; E ; ' E Page 12 of 21
were te various terms can be inferred from Equation 1 and Equation 1.3. As an example, consider te following: & E' *' G # # # # 1 2 2 2 2 H # # # # # # # # 2 2 2 2 H 2 # # # # 2 2 2 / 2 2 2 2 H 3 H Multiplication is associative for matrices and quaternions. Exponentials: Now let us consider exponentials of a quaternion. We will begin wit Euler's Equation. I J cos" N sin" Since cos(-x) cos(x) and sin(-x) -sin(x), Euler's Equation can also be written as: I :J cos" N sin" Te i (italicized i) term used in tis equation is normally tougt to be te complex i wit it being defined by i 2-1. Part of Hamilton's definitions for te unit vectors i, j, and k is tat i 2 j 2 k 2-1 ijk. Given te similarity of tese definitions, would it be correct to substitute one of Hamilton's unit vectors for te complex i in Euler's Equation? Te autor will present several pieces of evidence tat support te affirmative. Te essence of te autor s argument is tat te beavior of Euler s Equation remains true, but te complex i remains distinct from te unit vectors i, j, and k. Te following few paragraps will support tis tinking. Since i 2 i 2, te most tat could be stated would be tat i ±i. If i is substituted into Euler s Equation for i, te ± beavior of te sine and cosine terms considers tis, and Euler s Equation remains valid. Te same reasoning applies for te unit vectors j and k. For te unit vectors, i 2 j 2 k 2-1 ( i 2 ). Despite tis definition, i j k since te unit vectors are in different directions. Te unit vectors are distinct from eac oter despite being defined by te same equality. Tere is no reason to tink tat te complex i is not distinct also, despite being defined by te same equality. Quaternions are composed of four terms wit one term being scalar and te oter tree terms being vectors. It seems reasonable to tink tat te complex i is associated wit te scalar term. Tis would provide some symmetry between te scalar and vector portions. Consider te following: Page 13 of 21
I J -cos" sin". cos" sin" Multiplication of Euler s Equation by one of te unit vectors can produce a vector as sown immediately above. Te dot product of two vectors is equal to te product of teir lengts multiplied by te cosine of te angle between tem. Te cross product of two vectors is equal to te product of teir lengts multiplied by te sine of te angle between tem multiplied by a unit vector perpendicular to te vectors. Terefore, it is possible to construct Euler s Equation using te dot product and cross product of two arbitrary vectors as follows: I J cos" sin" 1 Q R -Q R Q R. ; #, 2 In eac example presented ere, Euler s Equation works equally well weter te complex i is used or a unit vector is used. Terefore, te autor is convinced tat Euler s Equation can be considered to be a quaternion wit a single vector term. Te next step is to extend Euler s Equation to include te unit vectors j and k. Ideally, te autor opes for a relationsip similar to te following: Equation 2: Were: Equation 2.1: I cost " sint " sint sint " Since Euler s Equation does not include a scalar term as part of te exponential, te autor will exclude it for now. A scalar term can easily be incorporated in a later step. If Equation 2 and Equation 2.1 are combined, te result is: Equation 2.2: I I U V W U X W U Y I U VI U XI U Y cost " sint " sint sint " Euler s Equation can be applied individually to te unit vectors as follows: Equation 2.3: I U VI U XI U Y -cos " sin ".Zcos sin [-cos " sin ". Te terms on te rigt-and side of Equation 2 can now be determined by performing te multiplication presented in Equation 2.3. Te results of tis multiplication are as follows: Page 1 of 21
Equation 2..1: cost " cos " cos cos " sin " sin sin " Equation 2..2: sint " sin " cos cos " cos " sin sin " Equation 2..3: sint cos " sin cos " sin " cos sin " Equation 2..: sint " sin " sin cos " cos " cos sin " Tis system of equations can also be represented by te following matrix multiplication (see Polynomials above and apply to Equation 2.3): Equation 2.: cos T cos sin 1 cos sin cos I sin T sin sin T cos cos sin cos sin sin cos sin T sin cos / sin cos 3 sin A generic quaternion exponential is ten produced as follows: Equation 2.6: were: Equation 2.6.1: I I U \W I U \I Terefore, te exponential of q becomes a pre-multiplier for Equation 2. as follows: Equation 2.7: cos T cos sin 1 cos sin cos sin T I I U sin \ sin T IU\ cos cos sin cos sin sin cos sin T sin cos / sin cos 3 sin In te discussion of te complex i, te autor speculated tat te complex i was associated wit te scalar term. Equation 2.7 supports tis. Te complex i could operate upon te q term. Te next Page 1 of 21
question ten is ow to make tis appen? Since Euler's Equation is so central to tis entire discussion, peraps it olds a clue. Let us return to Equation 2.6 above and multiply it by te version of Euler's Equation containing te complex i. Equation 2.8: I ] I I ]WU \W I ] I U \I Written in tis form, te q term can group itself wit te complex term or wit te vector term. It can also break itself into two parts and combine wit bot te complex and te vector parts. Also, wen te left-most portion of tis expression is written using Euler's Equation, it is te sum of two terms multiplied by te sum of four terms. Te result is te sum of 8 terms. Tere is an 8 term algebra named "octonions". It is possible tat Equation 2.8 is a subset of tat group. Te autor restricts tis to a subset because Equation 2.8 only requires five terms. Terefore, te "octonion" coefficients must in some way be restricted to conform to Equation 2.8. It is not presently clear ow te complex i term will interact wit te unit vectors. Tis will be furter developed in Part 2 - Identities. Now let us consider te beavior of Equations 2..1 troug 2... It will be seen tat te resulting quaternion can never be equal to zero. If bot q j and q k are set equal to zero, sin(γ j ) and sin(γ k ) will bot be zero. Tis will also cause cos(γ ) to be equal to cos(q i ) and sin(γ i ) to be equal to sin(q i ). It is not possible for bot cos(q i ) and sin(q i ) to bot be zero simultaneously since te cosine and sine bot operate on te same value q i. Terefore, te quaternion defined by Equations 2..1 troug 2.. can never be zero. Lastly, it must be remembered tat te exponential terms cannot ave units oter tan radians. Tis reiterates comments made above concerning te coefficients of quaternions aving no units. Differentiation: In tis section te autor will discuss and develop a metod of differentiation as it applies to te quaternion functions presented above. Te autor begins wit a classical definition followed by development of te differential operator. Te autor ten presents te derivatives of te functions presented above. Te first objective is to determine a meaning for te 1st derivative dy/dx. Te definition of te 1st derivative is: Equation 3: %& %' lim '" &'" b&' c ' ' Page 16 of 21
Here, te Δ is understood to be a constant increment operator. Te difficulty of tis equation is tat bot X and Y contain four terms. Te autor will present two metods of determining te derivative. Metod 1: Since bot te numerator and te denominator of te rigt-and side of Equation 3 are quaternions, and since te ratio between two quaternions is also a quaternion, te derivative on te left-and side must be a quaternion. Terefore, let us make te following definitions: Equation 3.1: %& %' de '" f f f f % %' 1 f f f / f 3 and Equation 3.2: %' % % % % Multiplying Equation 3.1 by tis definition for dx produces: Equation 3.3: %& d e '"%' f f f f % % % % Tere is some ambiguity ere since te order of multiplication is important for te unit vectors and te autor as cosen to place te dx to te rigt of F'(X). Now let us define dy as follows: Equation 3.: Substituting tis into Equation 3.3 produces: Equation 3.: %& % % % % % % % % f f f f % % % % Wen te multiplication on te rigt-and side is performed, te result is a system of four simultaneous equations tat can be represented in matrix form as follows: Page 17 of 21
Equation 3.6: 1 f f f f f f f f 1 % % f f f f / f f f f % 3 /% 3 1 % % % /% 3 or as Equation 3.7: -f.%' %&; -f. %& %' Equation 3.7 is a compact way of expressing Equation 3.6. Te elements of [f ] are all scalar values. Te quaternion attributes are contained in dx and dy. Te derivative of Y wit respect to X may be tougt of as a quaternion or as a matrix. Te matrix structure ensures tat tis is true. Please note te following: Te coefficient matrix in Equation 3.6 as te same matrix structure as te coefficient matrix in Equation 1 in te discussion of Polynomials. In multi-variable Calculus, tere is a distinction between te total derivative and te various partial derivatives. Te total derivative is defined as follows: Equation 3.8: % ; % ; % i % i Terefore, te coefficient matrix presented in Equation 3.6 can be represented by a system of partial derivatives as follows: Equation 3.8.1: 1 f f f f f f f f f f f f / f f f f 3 1 / 3 Now let us consider again te definition for te derivative presented by Equation 1. %& %' lim '" &'" b&' c ' ' Page 18 of 21
It seems clear tat tis derivative can be determined by individually incrementing eac of te terms of Y by eac of te individual terms of X. Te resulting matrix is a Jacobian Matrix. It also seems clear tat te differential operator d/dx must operate as follows: Equation 3.8.2: %& %' % %' 1 / 3 1 f f f / f 3 or alternately Equation 3.8.2.1: 1 %& % / %' d %' 3 Higer order derivatives are determined by successive substitutions. For example, te 2nd derivative is determined as follows: % & %' % 1 f f %' f / f 3 j '" 1 f f f / f 3 and 1 f f f f f f f f 1 % % f f f f / f f f f % 3 /% 3 1 %f %f %f /%f 3 Metod 2: Tis metod is based upon te definition presented by Equation 3. Page 19 of 21
%& %' lim '" &'" b&' c ' ' Rater tan use te Δ as a difference operator and ten take te limit as it reduces to zero, te autor proposes to multiply te quaternion X by a scalar value λ and ten take te limit as λ goes to zero. Tis will assure tat all of te coefficients of X go to zero togeter. Equation 3 is terefore re-written as follows: Equation 3.9: %& %' lim l'" &'" b&' c ; l n k l' Now let us begin te discussion regarding te differentials of quaternion polynomials and quaternion exponentials as described in te sections Polynomials and Exponentials. It will quickly be seen tat te Equation 3.9 form of te definition is very simple to use. We will begin wit te constant function Y A. Tis is te zero quaternion. Te next function to consider is Y AX. Te next polynomial function is Y AX 2. %& %' lim 6E E k l' 7 lim 6 o k l' 7 o %& %' lim l'" E' be' c lim 6 le' k l' k l' 7 E %& %' lim be' l'" E' c lim b 1 l"p E' E' c lim b 2l l "E' c 2E' k l' k l' k l' Te next function to consider is Y AX 3. %& %' lim be' l'"c E' C c lim b 1 l"c E' C E' C c lim b 3l 3l l C "E' C c 3E' k l' k l' k l' At tis point, it is clear tat quaternion differentials of quaternion polynomials beave exactly te same as teir non-quaternion counterparts. Te next functions to consider are te exponentials. Let Y e X. & I ' %& %' lim I 'Wl' I ' l l' lim l I ' I l' 1" l' I ' lim l I l' 1" l' I ' lim l 'I l' ' Page 2 of 21
%& %' I' Te autor used L' Hôpital's Rule in te above. It seems tat differentiation of a quaternion exponential is also identical to te non-quaternion counterpart. Integration: Given te similar beavior of differentiation for quaternion and non-quaternion functions, integration of a quaternion function is expected to beave like its non-quaternion counterpart. Te only variations tat te autor expects concern te constant of integration and te limits of integration. Wen indefinite integration is used, a constant of integration must be added to te result. For quaternion integration, tis constant of integration must be a quaternion. It is of course possible tat tis constant quaternion as zero for its scalar and/or vector portions. Wen definite integration is used, te limits of integration must satisfy te quaternion function. For example, consider te following: u v ' v s t %u s %' u \ Tis can easily be solved to give V(T 1 - T ) (X 1 - X ). Te puzzling aspect of tis is tat tere are so very many values for T and X tat cannot satisfy tis equation. Tis will be more fully developed in future work. Te next observation concerns te order of multiplication of te integrand. Te usual convention in Calculus would be to write te integrand as V dt rater tan dt V. As was seen in te section on Polynomials, reversing te order of multiplication will cange te result. Te autor anticipates tat tis can be applied to suc concepts as quantum spin and uncertainty. ' \ Acknowledgements Te autor tanks Susan Barlow, Karoly Kerer, and te rest of te WSM user's group on Yaoo.com. Te autor also tanks vixra.org and Wikipedia. Page 21 of 21