Month: December 2023

New version of Geometric Algebra for Electrical Engineers published.

December 9, 2023 Geometric Algebra for Electrical Engineers , , , , , ,

A new version of my book is now published.  The free PDF and the leanpub versions are available now.  The paperback and hardcover versions should be available on Amazon within the week.

What has changed:

  • V0.3.2 (Dec 8, 2023)
    • Add to helpful formulas: Determinant form of triple wedge.
    • Add figure showing the spherical polar conventions picked.
    • Add a problem showing that \( (e^x)’ = x’ e^x \) only when \( x \) and \( x’ \) commute, which is true for scalars and complex numbers, but not necessarily true for abstract entities, such as multivectors and square matrices.
    • Spherical polar coordinates: do not skip steps for \( \mathbf{x}_\phi \) computation.
    • Rewrite the Multivector potentials section. No longer pulling the ideas out of a magic hat, instead trying to motivate them.  Compromised on the strategy to do so, leaving some of the details to problems.

This potentials rewrite I’ve been working on indirectly for the last month, and have published two blog posts about the topic, as well another that I wrote and discarded, but helped me form and sequence some of the ideas.

The exponential derivative topic was also covered on my blog recently.  I’ve reworked that so that it is independent of the specific application to spherical polar coordinates, and set it as a problem for the reader (with solution at the end of chapter I in case I didn’t give enough hints in the problem statement.)

Potentials for multivector Maxwell’s equation (again.)

December 8, 2023 math and physics play , , , , , , , , , , , , , , , , ,

[Click here for the PDF version of this post.]

Motivation.

This revisits my last blog post where I covered this content in a meandering fashion. This is an attempt to re-express this in a more compact form. In particular, in a form that is amenable to include in my book. When I wrote the potential section of my book, I cheated, and didn’t try to motivate the results. My cheat was figuring out the multivector potential representation starting with STA where things are simpler, and then translating it back to a multivector representation, instead of figuring out a reasonable way to motivate things from the foundation already laid.

I’d like to eventually have a less rushed treatment of potentials in my book, where the results are not pulled out of a magic hat. Here is an attempted step in that direction. I’ve opted to put some of the motivational material in problems (with solutions at the chapter end.)

Multivector potentials.

We know from conventional electromagnetism (given no fictitious magnetic sources) that we can represent the six components of the electric and magnetic fields in terms of four scalar fields
\begin{equation}\label{eqn:mvpotentials:80}
\begin{aligned}
\BE &= -\spacegrad \phi – \PD{t}{\BA} \\
\BH &= \inv{\mu} \spacegrad \cross \BA.
\end{aligned}
\end{equation}
The conventional way of constructing these potentials makes use of the identities
\begin{equation}\label{eqn:mvpotentials:60}
\begin{aligned}
\spacegrad \cdot \lr{ \spacegrad \cross \BA } &= 0 \\
\spacegrad \cross \lr{ \spacegrad \phi } &= 0,
\end{aligned}
\end{equation}
applying those to the source free Maxwell’s equations to find representations of \( \BE, \BH \) that automatically satisfy those equations. For that conventional analysis, see section 18-6 [2] (available online), or section 10.1 [3], or section 6.4 [4]. We can also find such a potential representation using geometric algebra methods that are cross product free (problem 1.)

For Maxwell’s equations with fictitious magnetic sources, it can be shown that a potential representation of the field
\begin{equation}\label{eqn:mvpotentials:100}
\begin{aligned}
\BH &= -\spacegrad \phi_m – \PD{t}{\BF} \\
\BE &= -\inv{\epsilon} \spacegrad \cross \BF.
\end{aligned}
\end{equation}
satisfies the source-free grades of Maxwell’s equation.
See [1], and [5] for such derivations. As with the conventional source potentials, we can also apply our geometric algebra toolbox to easily find these results (problem 2.)

We have a mix of time partials and curls that is reminiscent of Maxwell’s equation itself. It’s obvious to wonder whether there is a more coherent integrated form for the potential. This is in fact the case.

Lemma 1.1: Multivector potentials.

For Maxwell’s equation with electric sources, the total field \( F \) can be expressed in multivector potential form
\begin{equation}\label{eqn:mvpotentials:520}
F = \gpgrade{ \lr{ \spacegrad – \inv{c} \PD{t}{} } \lr{ -\phi + c \BA } }{1,2}.
\end{equation}
For Maxwell’s equation with only fictitious magnetic sources, the total field \( F \) can be expressed in multivector form
\begin{equation}\label{eqn:mvpotentials:540}
F = \gpgrade{ \lr{ \spacegrad – \inv{c} \PD{t}{} } I \eta \lr{ -\phi_m + c \BF } }{1,2}.
\end{equation}

The reader should try to verify this themselves (problem 3.)

Using superposition, we can form a multivector potential that includes all grades.

Definition 1.1: Multivector potential.

We call \( A \), a multivector with all grades, the multivector potential, defining the total field as
\begin{equation}\label{eqn:mvpotentials:600}
\begin{aligned}
F
&=
\gpgrade{ \lr{ \spacegrad – \inv{c} \PD{t}{} } A }{1,2} \\
&=
\lr{ \spacegrad – \inv{c} \PD{t}{} } A

\gpgrade{ \lr{ \spacegrad – \inv{c} \PD{t}{} } A }{0,3}.
\end{aligned}
\end{equation}
Imposition of the constraint
\begin{equation}\label{eqn:mvpotentials:680}
\gpgrade{ \lr{ \spacegrad – \inv{c} \PD{t}{} } A }{0,3} = 0,
\end{equation}
is called the Lorentz gauge condition, and allows us to express \( F \) in terms of the potential without any grade selection filters.

Lemma 1.2: Conventional multivector potential.

Let
\begin{equation}\label{eqn:mvpotentials:620}
A = -\phi + c \BA + I \eta \lr{ -\phi_m + c \BF }.
\end{equation}
This results in the conventional potential representation of the electric and magnetic fields
\begin{equation}\label{eqn:mvpotentials:640}
\begin{aligned}
\BE &= -\spacegrad \phi – \PD{t}{\BA} – \inv{\epsilon} \spacegrad \cross \BF \\
\BH &= -\spacegrad \phi_m – \PD{t}{\BF} + \inv{\mu} \spacegrad \cross \BA.
\end{aligned}
\end{equation}
In terms of potentials, the Lorentz gauge condition \ref{eqn:mvpotentials:680} takes the form
\begin{equation}\label{eqn:mvpotentials:660}
\begin{aligned}
0 &= \inv{c} \PD{t}{\phi} + \spacegrad \cdot (c \BA) \\
0 &= \inv{c} \PD{t}{\phi_m} + \spacegrad \cdot (c \BF).
\end{aligned}
\end{equation}

Start proof:

See problem 4.

End proof.

Problems.

Problem 1: Potentials for no-fictitious sources.

Starting with Maxwell’s equation with only conventional electric sources
\begin{equation}\label{eqn:mvpotentials:120}
\lr{ \spacegrad + \inv{c}\PD{t}{} } F = \gpgrade{J}{0,1}.
\end{equation}
Show that this may be split by grade into three equations
\begin{equation}\label{eqn:mvpotentials:140}
\begin{aligned}
\gpgrade{ \lr{ \spacegrad + \inv{c}\PD{t}{} } F}{0,1} &= \gpgrade{J}{0,1} \\
\spacegrad \wedge \BE + \inv{c}\PD{t}{} \lr{ I \eta \BH } &= 0 \\
\spacegrad \wedge \lr{ I \eta \BH } &= 0.
\end{aligned}
\end{equation}
Then use the identities \( \spacegrad \wedge \spacegrad \wedge \BA = 0 \), for vector \( \BA \) and \( \spacegrad \wedge \spacegrad \phi = 0 \), for scalar \( \phi \) to find the potential representation.

Answer

Taking grade(0,1) and (2,3) selections of Maxwell’s equation, we split our equations into source dependent and source free equations
\begin{equation}\label{eqn:mvpotentials:200}
\gpgrade{ \lr{ \spacegrad + \inv{c} \PD{t}{} } F }{0,1} = \gpgrade{J}{0,1},
\end{equation}
\begin{equation}\label{eqn:mvpotentials:220}
\gpgrade{ \lr{ \spacegrad + \inv{c} \PD{t}{} } F }{2,3} = 0.
\end{equation}

In terms of \( F = \BE + I \eta \BH \), the source free equation expands to
\begin{equation}\label{eqn:mvpotentials:240}
\begin{aligned}
0
&=
\gpgrade{
\lr{ \spacegrad + \inv{c} \PD{t}{} } \lr{ \BE + I \eta \BH }
}{2,3} \\
&=
\gpgradetwo{\spacegrad \BE}
+ \gpgradethree{I \eta \spacegrad \BH} + I \eta \inv{c} \PD{t}{\BH} \\
&=
\spacegrad \wedge \BE
+ \spacegrad \wedge \lr{ I \eta \BH }
+ I \eta \inv{c} \PD{t}{\BH},
\end{aligned}
\end{equation}
which can be further split into a bivector and trivector equation
\begin{equation}\label{eqn:mvpotentials:260}
0 = \spacegrad \wedge \BE + I \eta \inv{c} \PD{t}{\BH}
\end{equation}
\begin{equation}\label{eqn:mvpotentials:280}
0 = \spacegrad \wedge \lr{ I \eta \BH }.
\end{equation}
It’s clear that we want to write the magnetic field as a (bivector) curl, so we let
\begin{equation}\label{eqn:mvpotentials:300}
I \eta \BH = I c \BB = c \spacegrad \wedge \BA,
\end{equation}
or
\begin{equation}\label{eqn:mvpotentials:301}
\BH = \inv{\mu} \spacegrad \cross \BA.
\end{equation}

\Cref{eqn:mvpotentials:260} is reduced to
\begin{equation}\label{eqn:mvpotentials:320}
\begin{aligned}
0
&= \spacegrad \wedge \BE + I \eta \inv{c} \PD{t}{\BH} \\
&= \spacegrad \wedge \BE + \inv{c} \PD{t}{} \spacegrad \wedge \lr{ c \BA } \\
&= \spacegrad \wedge \lr{ \BE + \PD{t}{\BA} }.
\end{aligned}
\end{equation}
We can now let
\begin{equation}\label{eqn:mvpotentials:340}
\BE + \PD{t}{\BA} = -\spacegrad \phi.
\end{equation}
We sneakily adjust the sign of the gradient so that the result matches the conventional representation.

Problem 2: Potentials for fictitious sources.

Starting with Maxwell’s equation with only fictitious magnetic sources
\begin{equation}\label{eqn:mvpotentials:160}
\lr{ \spacegrad + \inv{c}\PD{t}{} } F = \gpgrade{J}{2,3},
\end{equation}
show that this may be split by grade into three equations
\begin{equation}\label{eqn:mvpotentials:180}
\begin{aligned}
\gpgrade{ \lr{ \spacegrad + \inv{c}\PD{t}{} } I F}{0,1} &= I \gpgrade{J}{2,3} \\
-\eta \spacegrad \wedge \BH + \inv{c}\PD{t}{(I \BE)} &= 0 \\
\spacegrad \wedge \lr{ I \BE } &= 0.
\end{aligned}
\end{equation}
Then use the identities \( \spacegrad \wedge \spacegrad \wedge \BF = 0 \), for vector \( \BF \) and \( \spacegrad \wedge \spacegrad \phi_m = 0 \), for scalar \( \phi_m \) to find the potential representation \ref{eqn:mvpotentials:100}.

Answer

We multiply \ref{eqn:mvpotentials:160} by \( I \) to find
\begin{equation}\label{eqn:mvpotentials:360}
\lr{ \spacegrad + \inv{c}\PD{t}{} } I F = I \gpgrade{J}{2,3},
\end{equation}
which can be split into
\begin{equation}\label{eqn:mvpotentials:380}
\begin{aligned}
\gpgrade{ \lr{ \spacegrad + \inv{c}\PD{t}{} } I F }{1,2} &= I \gpgrade{J}{2,3} \\
\gpgrade{ \lr{ \spacegrad + \inv{c}\PD{t}{} } I F }{0,3} &= 0.
\end{aligned}
\end{equation}
We expand the source free equation in terms of \( I F = I \BE – \eta \BH \), to find
\begin{equation}\label{eqn:mvpotentials:400}
\begin{aligned}
0
&= \gpgrade{ \lr{ \spacegrad + \inv{c}\PD{t}{} } \lr{ I \BE – \eta \BH } }{0,3} \\
&= \spacegrad \wedge \lr{ I \BE } + \inv{c} \PD{t}{(I \BE)} – \eta \spacegrad \wedge \BH,
\end{aligned}
\end{equation}
which has the respective bivector and trivector grades
\begin{equation}\label{eqn:mvpotentials:420}
0 = \spacegrad \wedge \lr{ I \BE }
\end{equation}
\begin{equation}\label{eqn:mvpotentials:440}
0 = \inv{c} \PD{t}{(I \BE)} – \eta \spacegrad \wedge \BH.
\end{equation}
We can clearly satisfy \ref{eqn:mvpotentials:420} by setting
\begin{equation}\label{eqn:mvpotentials:460}
I \BE = -\inv{\epsilon} \spacegrad \wedge \BF,
\end{equation}
or
\begin{equation}\label{eqn:mvpotentials:461}
\BE = -\inv{\epsilon} \spacegrad \cross \BF.
\end{equation}
Here, once again, the sneaky inclusion of a constant factor \( -1/\epsilon \) is to make the result match the conventional. Inserting this value for \( I \BE \) into our bivector equation yields
\begin{equation}\label{eqn:mvpotentials:480}
\begin{aligned}
0
&= -\inv{\epsilon} \inv{c} \PD{t}{} (\spacegrad \wedge \BF) – \eta \spacegrad \wedge \BH \\
&= -\eta \spacegrad \wedge \lr{ \PD{t}{\BF} + \BH },
\end{aligned}
\end{equation}
so we set
\begin{equation}\label{eqn:mvpotentials:500}
\PD{t}{\BF} + \BH = -\spacegrad \phi_m,
\end{equation}
and have a field representation that automatically satisfies the source free equations.

Problem 3: Total field in terms of potentials.

Prove lemma 1.1, either by direct expansion, or by trying to discover the multivector form of the field by construction.

Answer

Proof by expansion is straightforward, and left to the reader. We form the respective total electromagnetic fields \( F = \BE + I \eta H \) for each case.

We find
\begin{equation}\label{eqn:mvpotentials:560}
\begin{aligned}
F
&= \BE + I \eta \BH \\
&= -\spacegrad \phi – \PD{t}{\BA} + I \frac{\eta}{\mu} \spacegrad \cross \BA \\
&= -\spacegrad \phi – \inv{c} \PD{t}{(c \BA)} + \spacegrad \wedge (c\BA) \\
&= \gpgrade{ -\spacegrad \phi – \inv{c} \PD{t}{(c \BA)} + \spacegrad \wedge (c\BA) }{1,2} \\
&= \gpgrade{ -\spacegrad \phi – \inv{c} \PD{t}{(c \BA)} + \spacegrad (c\BA) }{1,2} \\
&= \gpgrade{ \spacegrad \lr{ -\phi + c \BA } – \inv{c} \PD{t}{(c \BA)} }{1,2} \\
&= \gpgrade{ \lr{ \spacegrad -\inv{c} \PD{t}{} } \lr{ -\phi + c \BA } }{1,2}.
\end{aligned}
\end{equation}

For the field for the fictitious source case, we compute the result in the same way, inserting a no-op grade selection to allow us to simplify, finding
\begin{equation}\label{eqn:mvpotentials:580}
\begin{aligned}
F
&= \BE + I \eta \BH \\
&= -\inv{\epsilon} \spacegrad \cross \BF + I \eta \lr{ -\spacegrad \phi_m – \PD{t}{\BF} } \\
&= \inv{\epsilon c} I \lr{ \spacegrad \wedge (c \BF)} + I \eta \lr{ -\spacegrad \phi_m – \inv{c} \PD{t}{(c \BF)} } \\
&= I \eta \lr{ \spacegrad \wedge (c \BF) + \lr{ -\spacegrad \phi_m – \inv{c} \PD{t}{(c \BF)} } } \\
&= I \eta \gpgrade{ \spacegrad \wedge (c \BF) + \lr{ -\spacegrad \phi_m – \inv{c} \PD{t}{(c \BF)} } }{1,2} \\
&= I \eta \gpgrade{ \spacegrad (c \BF) – \spacegrad \phi_m – \inv{c} \PD{t}{(c \BF)} }{1,2} \\
&= I \eta \gpgrade{ \spacegrad (-\phi_m + c \BF) – \inv{c} \PD{t}{(c \BF)} }{1,2} \\
&= I \eta \gpgrade{ \lr{ \spacegrad -\inv{c} \PD{t}{} } (-\phi_m + c \BF) }{1,2}.
\end{aligned}
\end{equation}

Problem 4: Fields in terms of potentials.

Prove lemma 1.2.

Answer

Let’s expand and then group by grade
\begin{equation}\label{eqn:mvpotentials:n}
\begin{aligned}
\lr{ \spacegrad – \inv{c} \PD{t}{} } A
&=
\lr{ \spacegrad – \inv{c} \PD{t}{} } \lr{ -\phi + c \BA + I \eta \lr{ -\phi_m + c \BF }} \\
&=
-\spacegrad \phi + c \spacegrad \BA + I \eta \lr{ -\spacegrad \phi_m + c \spacegrad \BF }
-\inv{c} \PD{t}{\phi} + c \inv{c} \PD{t}{ \BA } + I \eta \lr{ -\inv{c} \PD{t}{\phi_m} + c \inv{c} \PD{t}{\BF} } \\
&=
– \spacegrad \phi
+ I \eta c \spacegrad \wedge \BF
– c \inv{c} \PD{t}{\BA}
\quad + c \spacegrad \wedge \BA
-I \eta \spacegrad \phi_m
– c I \eta \inv{c} \PD{t}{\BF} \\
&\quad + c \spacegrad \cdot \BA
+\inv{c} \PD{t}{\phi}
\quad + I \eta \lr{ c \spacegrad \cdot \BF
+ \inv{c} \PD{t}{\phi_m} } \\
&=
– \spacegrad \phi
– \inv{\epsilon} \spacegrad \cross \BF
– \PD{t}{\BA}
\quad + I \eta \lr{
\inv{\mu} \spacegrad \cross \BA
– \spacegrad \phi_m
– \PD{t}{\BF}
} \\
&\quad + c \spacegrad \cdot \BA
+\inv{c} \PD{t}{\phi}
\quad + I \eta \lr{ c \spacegrad \cdot \BF
+ \inv{c} \PD{t}{\phi_m} }.
\end{aligned}
\end{equation}
Observing that \( F = \gpgrade{ \lr{ \spacegrad -(1/c) \partial_t } A }{1,2} = \BE + I \eta \BH \), completes the problem. If the Lorentz gauge condition is assumed, the scalar and pseudoscalar components above are obliterated, leaving just
\( F = \lr{ \spacegrad -(1/c) \partial_t } A \).

References

[1] Constantine A Balanis. Antenna theory: analysis and design. John Wiley & Sons, 3rd edition, 2005.

[2] R.P. Feynman, R.B. Leighton, and M.L. Sands. Feynman lectures on physics, Volume II.[Lectures on physics], chapter The Maxwell Equations. Addison-Wesley Publishing Company. Reading, Massachusetts, 1963. URL https://www.feynmanlectures.caltech.edu/II_18.html.

[3] David Jeffrey Griffiths and Reed College. Introduction to electrodynamics. Prentice hall Upper Saddle River, NJ, 3rd edition, 1999.

[4] JD Jackson. Classical Electrodynamics. John Wiley and Sons, 2nd edition, 1975.

[5] David M Pozar. Microwave engineering. John Wiley & Sons, 2009.

Letting a gdb controlled program read from stdin.

December 8, 2023 C/C++ development and debugging. , , ,

I was asked how to let a gdb controlled slave read from stdin, and couldn’t remember how it was done, so I wrote the following little test program, figuring that muscle memory would remind me once I had gdb running.

#include <stdio.h>

int main()
{
   size_t rc = 0;
   char buf[2];

   do {
      rc = fread( buf, 1, 1, stdin );
      if ( rc == 1 ) {
         printf( "%c\n", buf[0] );
      }
   } while ( rc );

   return 0;
}

Turns out the answer is just the gdb run command, which can specify stdin for the program. Here’s a demo session that shows this in action

(gdb) b main
Breakpoint 1 at 0x40061e: file x.c, line 5.
(gdb) run < x.c
Starting program: /home/pjoot/tmp/readit/a.out < x.c

Breakpoint 1, main () at x.c:5
5          size_t rc = 0;
Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-225.0.4.el8_8.6.x86_64
(gdb) n
9             rc = fread( buf, 1, 1, stdin );
(gdb) n
10            if ( rc == 1 ) {
(gdb) p rc
$1 = 1
(gdb) p buf[0]
$2 = 35 '#'
(gdb) n
11               printf( "%c\n", buf[0] );
(gdb) 
#
13         } while ( rc );
(gdb) 
9             rc = fread( buf, 1, 1, stdin );
(gdb) 
10            if ( rc == 1 ) {
(gdb) p rc
$3 = 1
(gdb) p buf[0]
$4 = 105 'i'

The x.c input that I passed to run, was the source of the program that I debugging.

The evil of COBOL: everything is in global variables

December 7, 2023 COBOL , , , , , , ,

COBOL does not have stack variables.  Everything is a global variable.  There is a loose equivalent of a function, called a paragraph, which can be called using a PERFORM statement, but a paragraph does not have any input or output variables, and no return code, so if you want it to behave like a function, you have to construct some sort of complicated naming convention using your global variables.

I’ve seen real customer COBOL programs with many thousands of global variables.  A production COBOL program is usually a giant sequence of MOVEs, MOVE A TO B, MOVE B TO C, MOVE C TO D, MOVE D TO E, … with various PERFORMs or GOTOs, or other things in between.  If you find that your variable has a bad value in it, that is probably because it has been copied from something that was copied from something, that was copied from something, that’s the output of something else, that was copied from something, 9 or 10 times.

I was toying around with the idea of coding up a COBOL implementation of 2D Euclidean geometric algebra, just as a joke, as it is surely the worst language in the world.  Yes, I work on a COBOL compiler project. The project is a lot of fun, and the people I work with are awesome, but I don’t have to like the language.

If I was to implement this simplest geometric algebra in COBOL, the logical starting place for that would be to implement complex numbers in COBOL first.  That is because we can use a pair of complex numbers to implement a 2D multivector, with one complex number for the vector part, and a complex number for the scalar and pseudoscalar parts.  That technique has been detailed on this blog previously, and also in a Mathematica module Cl20.m.

Trying to implement a couple of complex number operations in COBOL got absurd really fast.  Here’s an example.  First step was to create some complex number types.  I did that with a copybook (include file), like so:

This can be included multiple times, each time with a different name, like so:

The way that I structured all my helper functions, was with one set of global variables for input (at least one), and if appropriate, one output global variable.  Here’s an example:

So, if I want to compute and display a value, I have a whole pile of stupid MOVEs to do in and out of the appropriate global variables for each of the helper routines in question:

I wrote enough of this little complex number library that I could do conjugate, real, imaginary, multiply, inverse, and divide operations.  I can run that little program with the following JCL

//COMPLEX JOB
//A EXEC PGM=COMPLEX
//SYSOUT   DD SYSOUT=*
//STEPLIB  DD DSN=PJOOT.SAMPLE.COMPLEX,
//  DISP=SHR

and get this SYSOUT:

STEP A SYSOUT:
A                    =  .10000000000000000E 01 + ( .20000000000000000E 01) I
B                    =  .30000000000000000E 01 + ( .40000000000000000E 01) I
CONJ(A)              =  .10000000000000000E 01 + (-.20000000000000000E 01) I
RE(A)                =  .10000000000000000E 01
IM(A)                =  .20000000000000000E 01
A * B                = -.50000000000000000E 01 + ( .10000000000000000E 02) I
1/A                  =  .20000000000000000E 00 + (-.40000000000000000E 00) I
A/B                  =  .44000000000000000E 00 + ( .80000000000000000E-01) I

If you would like your eyes burned further, you can access the full program on github here. It takes almost 200 lines of code to do almost nothing.

Derivatives of spherical polar vector representation.

December 6, 2023 math and physics play , , , , ,

[Click here for a PDF version of this post]

On discord, on the bivector server, ‘stationaryactionprinciple’ asked a question that I really liked.
It’s a question that nagged me before too, but I hadn’t taken the time to puzzle through it properly.

The main character in this question is the spherical polar form of a radial vector, which has the form
\begin{equation}\label{eqn:dexpquestion:20}
\begin{aligned}
i &= \Be_{12} \\
j &= \Be_{31} e^{i\phi} \\
\Bx(r,\theta,\phi) &= r \Be_3 e^{j \theta},
\end{aligned}
\end{equation}
as illustrated in Fig. 1

Fig. 1. Spherical polar conventions.

Notice that all the \( \phi \) dependence comes from the bivector \( j = j(\phi) \), which makes life a bit tricky. We can take \( r, \theta \) or \( \phi \) partials of \( \Bx \), but need to be particularly careful how we do this for the \( \phi \) partials of the exponential factor.

One correct way to compute such a partial is to first expand the exponential in its trig constituents, as
\begin{equation}\label{eqn:dexpquestion:120}
e^{j \theta} = \cos\theta + j \sin\theta,
\end{equation}
and then take the derivative with respect to \(\phi\). If we do so, we get
\begin{equation}\label{eqn:dexpquestion:140}
\PD{\phi}{} e^{j\theta} = \PD{\phi}{j} \sin\theta.
\end{equation}
On the other hand, should we just directly take derivatives of the exponential, one might think that the result is
\begin{equation}\label{eqn:dexpquestion:160}
\PD{\phi}{} e^{j\theta} = \PD{\phi}{(j\theta)} e^{j\theta} = \theta \PD{\phi}{j} e^{j\theta}.
\end{equation}
but this is not correct, for a subtle reason. To understand why, we can step back to the power series representation of the exponential, and compute
\begin{equation}\label{eqn:dexpquestion:60}
\begin{aligned}
\PD{\phi}{e^{j\theta}}
&= \sum_{k = 0}^\infty \PD{\phi}{} \frac{ (j \theta)^k }{k!} \\
&= \sum_{k = 1}^\infty \PD{\phi}{j^k} \frac{ \theta^k }{k!}.
\end{aligned}
\end{equation}
If you treat \( j \) as a complex number, this then reduces to
\begin{equation}\label{eqn:dexpquestion:80}
\begin{aligned}
\PD{\phi}{e^{j\theta}}
&= \sum_{k = 1}^\infty k \PD{\phi}{j} j^{k-1} \frac{ \theta^k }{k!} \\
&=
\theta \PD{\phi}{j} \sum_{k = 1}^\infty \frac{ (j\theta)^{k-1} }{(k-1)!} \\
&=
\theta \PD{\phi}{j} e^{j\theta}.
\end{aligned}
\end{equation}
But, as we have said, this is wrong. The reason that this is wrong is because \( \PDi{\phi}{j} \) does not commute with \( j \), so
\begin{equation}\label{eqn:dexpquestion:100}
\PD{\phi}{j^k} = \PD{\phi}{j} j^{k-1} + j \PD{\phi}{j} j^{k-2} + \cdots,
\end{equation}
not \( k (\PDi{\phi}{j}) j^{k-1} \).

This non-commutativity, sneakily hiding in the power series for the exponential, messes us up. If we are careful, though, we should still be able to compute the correct result using the power series representation of the exponential. To do so, we need to understand the commutation relations for \( j \) and \( j’ \). Writing \( j’ = \PDi{\phi}{j} \), those two bivectors are
\begin{equation}\label{eqn:dexpquestion:180}
\begin{aligned}
j &= \Be_{31} e^{i\phi} \\
j’ &= \Be_{32} e^{i\phi},
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:dexpquestion:200}
\begin{aligned}
j j’
&= \Be_{31} e^{i\phi} \Be_{32} e^{i\phi} \\
&= \Be_{3132} e^{-i\phi} e^{i\phi} \\
&= -\Be_{12},
\end{aligned}
\end{equation}
and
\begin{equation}\label{eqn:dexpquestion:220}
\begin{aligned}
j’ j
&= \Be_{32} e^{i\phi} \Be_{31} e^{i\phi} \\
&= \Be_{3231} e^{-i\phi} e^{i\phi} \\
&= \Be_{12}.
\end{aligned}
\end{equation}
We find that \( j \) and \( j’ \), in this case, anticommute
\begin{equation}\label{eqn:dexpquestion:240}
j j’ = -j’ j.
\end{equation}
We can now compute
\begin{equation}\label{eqn:dexpquestion:260}
\begin{aligned}
\PD{\phi}{j^k}
&= j’ j^{k-1} + j j’ j^{k-2} + j^2 j’ j^{k-3} \cdots \\
&= j’ j^{k-1} – j’ j^{k-1} + (-1)^2 j’ j^{k-1} \cdots
\end{aligned}
\end{equation}
This is zero for any even \( k \) and \( j’ j^{k-1} \) for odd \( k \).

Plugging this back into our Taylor series for the derivative (before we messed it up), we find
\begin{equation}\label{eqn:dexpquestion:280}
\begin{aligned}
\PD{\phi}{e^{j\theta}}
&= \sum_{k = 1, k \in \mathrm{odd}}^\infty j’ j^{k-1} \frac{ \theta^k }{k!} \\
&= j’ \inv{j}
\sum_{k = 1,\, k \in \mathrm{odd}}^\infty \frac{ (j\theta)^k }{k!} \\
&= j’ \inv{j} \sinh( j \theta ) \\
&= j’ \inv{j} j \sin( \theta ) \\
&= j’ \sin( \theta ).
\end{aligned}
\end{equation}
This is exactly the result that we had when we expanded \( e^{j\theta} \) in it’s cis form, and then took derivatives, so we have now reconciled the two different approaches.

Observe that, as a side effect of this exploration, we know also know how to compute the derivative of \( e^{j\theta} \) for the special case where \( j j’ = -j’ j \), which will be the case for any \( j \) where \( j^2 = \mathrm{constant} \).