Peeter Joot's (OLD) Blog.

Math, physics, perl, and programming obscurity.

Stokes theorem in Geometric Algebra formalism.

Posted by peeterjoot on July 22, 2009

Obsolete with potential errors.

This post may be in error.  I wrote this before understanding that the gradient used in Stokes Theorem must be projected onto the tangent space of the parameterized surface, as detailed in Alan MacDonald’s Vector and Geometric Calculus.

See the post ‘stokes theorem in geometric algebra‘ [PDF], where this topic has been revisited with this in mind.

Original Post:

[Click here for a PDF of this post with nicer formatting]


Relying on pictorial means and a brute force ugly comparison of left and right hand sides, a verification of Stokes theorem for the vector and bivector cases was performed ([1]). This was more of a confirmation than a derivation, and the technique fails the transition to the trivector case. The trivector case is of particular interest in electromagnetism since that and a duality transformation provides a four-vector divergence theorem.

The fact that the pictorial means of defining the boundary surface doesn’t work well in four vector space is not the only unsatisfactory aspect of the previous treatment. The fact that a coordinate expansion of the hypervolume element and hypersurface element was performed in the LHS and RHS comparisons was required is particularly ugly. It is a lot of work and essentially has to be undone on the opposing side of the equation. Comparing to previous attempts to come to terms with Stokes theorem in ([2]) and ([3]) this more recent attempt at least avoids the requirement for a tensor expansion of the vector or bivector. It should be possible to build on this and minimize the amount of coordinate expansion required and go directly from the volume integral to the expression of the boundary surface.

Do it.

Notation and Setup.

The desire is to relate the curl hypervolume integral to a hypersurface integral on the boundary

\begin{aligned}\int (\nabla \wedge F) \cdot d^k x = \int F \cdot d^{k-1} x\end{aligned} \hspace{\stretch{1}}(2.1)

In order to put meaning to this statement the volume and surface elements need to be properly defined. In order that this be a scalar equation, the object F in the integral is required to be of grade k-1, and k \le n where n is the dimension of the vector space that generates the object F.

Reciprocal frames.

As evident in equation (2.1) a metric is required to define the dot product. If an affine non-metric formulation
of Stokes theorem is possible it will not be attempted here. A reciprocal basis pair will be utilized, defined by

\begin{aligned}\gamma^\mu \cdot \gamma_\nu = {\delta^\mu}_\nu\end{aligned} \hspace{\stretch{1}}(2.2)

Both of the sets \{\gamma_\mu\} and \{\gamma^\mu\} are taken to span the space, but are not required to be orthogonal. The notation is consistent with the Dirac reciprocal basis, and there will not be anything in this treatment that prohibits the Minkowski metric signature required for such a relativistic space.

Vector decomposition in terms of coordinates follows by taking dot products. We write

\begin{aligned}x = x^\mu \gamma_\mu = x_\nu \gamma^\nu\end{aligned} \hspace{\stretch{1}}(2.3)


When working with a non-orthonormal basis, use of the reciprocal frame can be utilized to express the gradient.

\begin{aligned}\nabla \equiv \gamma^\mu \partial_\mu \equiv \sum_\mu \gamma^\mu \frac{\partial {}}{\partial {x^\mu}}\end{aligned} \hspace{\stretch{1}}(2.4)

This contains what may perhaps seem like an odd seeming mix of upper and lower indexes in this definition. This is how the gradient is defined in [4]. Although it is possible to accept this definition and work with it, this form can be justified by require of the gradient consistency with the the definition of directional derivative. A definition of the directional derivative that works for single and multivector functions, in \mathbb{R}^{3} and other more general spaces is

\begin{aligned}a \cdot \nabla F \equiv \lim_{\lambda \rightarrow 0} \frac{F(x + a\lambda) - F(x)}{\lambda} = {\left.\frac{\partial {F(x + a\lambda)}}{\partial {\lambda}} \right\vert}_{\lambda=0}\end{aligned} \hspace{\stretch{1}}(2.5)

Taylor expanding about \lambda=0 in terms of coordinates we have

\begin{aligned}{\left.\frac{\partial {F(x + a\lambda)}}{\partial {\lambda}} \right\vert}_{\lambda=0}&= a^\mu \frac{\partial {F}}{\partial {x^\mu}} \\ &= (a^\nu \gamma_\nu) \cdot (\gamma^\mu \partial_\mu) F \\ &= a \cdot \nabla F \quad\quad\quad\square\end{aligned}

The lower index representation of the vector coordinates could also have been used, so using the directional derivative to imply a definition of the gradient, we have an additional alternate representation of the gradient

\begin{aligned}\nabla \equiv \gamma_\mu \partial^\mu \equiv \sum_\mu \gamma_\mu \frac{\partial {}}{\partial {x_\mu}}\end{aligned} \hspace{\stretch{1}}(2.6)

Volume element

We define the hypervolume in terms of parametrized vector displacements x = x(a_1, a_2, ... a_k). For the vector x we can form a pseudoscalar for the subspace spanned by this parametrization by wedging the displacements in each of the directions defined by variation of the parameters. For m \in [1,k] let

\begin{aligned}dx_i = \frac{\partial {x}}{\partial {a_i}} da_i = \gamma_\mu \frac{\partial {x^\mu}}{\partial {a_i}} da_i,\end{aligned} \hspace{\stretch{1}}(2.7)

so the hypervolume element for the subspace in question is

\begin{aligned}d^k x \equiv dx_1 \wedge dx_2 \cdots dx_k\end{aligned} \hspace{\stretch{1}}(2.8)

This can be expanded explicitly in coordinates

\begin{aligned}d^k x &= da_1 da_2 \cdots da_k \left(\frac{\partial {x^{\mu_1}}}{\partial {a_1}} \frac{\partial {x^{\mu_2}}}{\partial {a_2}} \cdots\frac{\partial {x^{\mu_k}}}{\partial {a_k}} \right)( \gamma_{\mu_1} \wedge \gamma_{\mu_2} \wedge \cdots \wedge \gamma_{\mu_k} ) \\ \end{aligned}

Observe that when k is also the dimension of the space, we can employ a pseudoscalar I = \gamma_0 \gamma_1 \cdots \gamma_k and can specify our volume element in terms of the Jacobian determinant.

This is

\begin{aligned}d^k x =I da_1 da_2 \cdots da_k {\left\lvert{\frac{\partial {(x^1, x^2, \cdots, x^k)}}{\partial {(a_1, a_2, \cdots, a_k)}}}\right\rvert}\end{aligned} \hspace{\stretch{1}}(2.9)

However, we won’t have a requirement to express the Stokes result in terms of such Jacobians.

Expansion of the curl and volume element product

We are now prepared to go on to the meat of the issue. The first order of business is the expansion of the curl and volume element product

\begin{aligned}( \nabla \wedge F ) \cdot d^k x&=( \gamma^\mu \wedge \partial_\mu F ) \cdot d^k x \\ &=\left\langle{{ ( \gamma^\mu \wedge \partial_\mu F ) d^k x }}\right\rangle \\ \end{aligned}

The wedge product within the scalar grade selection operator can be expanded in symmetric or antisymmetric sums, but this is a grade dependent operation. For odd grade blades A (vector, trivector, …), and vector a we have for the dot and wedge product respectively

\begin{aligned}a \wedge A = \frac{1}{{2}} (a A - A a) \\ a \cdot A = \frac{1}{{2}} (a A + A a)\end{aligned}

Similarly for even grade blades we have

\begin{aligned}a \wedge A = \frac{1}{{2}} (a A + A a) \\ a \cdot A = \frac{1}{{2}} (a A - A a)\end{aligned}

First treating the odd grade case for F we have

\begin{aligned}( \nabla \wedge F ) \cdot d^k x&=\frac{1}{{2}} \left\langle{{ \gamma^\mu \partial_\mu F d^k x }}\right\rangle - \frac{1}{{2}} \left\langle{{ \partial_\mu F \gamma^\mu d^k x }}\right\rangle \\ \end{aligned}

Employing cyclic scalar reordering within the scalar product for the first term

\begin{aligned}\left\langle{{a b c}}\right\rangle = \left\langle{{b c a}}\right\rangle\end{aligned} \hspace{\stretch{1}}(2.10)

we have

\begin{aligned}( \nabla \wedge F ) \cdot d^k x&=\frac{1}{{2}} \left\langle{{ \partial_\mu F (d^k x \gamma^\mu - \gamma^\mu d^k x)}}\right\rangle \\ &=\frac{1}{{2}} \left\langle{{ \partial_\mu F (d^k x \cdot \gamma^\mu - \gamma^\mu d^k x)}}\right\rangle \\ &=\left\langle{{ \partial_\mu F (d^k x \cdot \gamma^\mu)}}\right\rangle \\ \end{aligned}

The end result is

\begin{aligned}( \nabla \wedge F ) \cdot d^k x &= \partial_\mu F \cdot (d^k x \cdot \gamma^\mu) \end{aligned} \hspace{\stretch{1}}(2.11)

For even grade F (and thus odd grade d^k x) it is straightforward to show that (2.11) also holds.

Expanding the volume dot product

We want to expand the volume integral dot product

\begin{aligned}d^k x \cdot \gamma^\mu\end{aligned} \hspace{\stretch{1}}(2.12)

Picking k = 4 will serve to illustrate the pattern, and the generalization (or degeneralization to lower grades) will be clear. We have

\begin{aligned}d^4 x \cdot \gamma^\mu&=( dx_1 \wedge dx_2 \wedge dx_3 \wedge dx_4 ) \cdot \gamma^\mu \\ &= ( dx_1 \wedge dx_2 \wedge dx_3 ) dx_4 \cdot \gamma^\mu \\ &-( dx_1 \wedge dx_2 \wedge dx_4 ) dx_3 \cdot \gamma^\mu \\ &+( dx_1 \wedge dx_3 \wedge dx_4 ) dx_2 \cdot \gamma^\mu \\ &-( dx_2 \wedge dx_3 \wedge dx_4 ) dx_1 \cdot \gamma^\mu \\ \end{aligned}

This avoids the requirement to do the entire Jacobian expansion of (2.9). The dot product of the differential displacement dx_m with \gamma^\mu can now be made explicit without as much mess.

\begin{aligned}dx_m \cdot \gamma^\mu &=da_m \frac{\partial {x^\nu}}{\partial {a_m}} \gamma_\nu \cdot \gamma^\mu \\ &=da_m \frac{\partial {x^\mu}}{\partial {a_m}} \\ \end{aligned}

We now have products of the form

\begin{aligned}\partial_\mu F da_m \frac{\partial {x^\mu}}{\partial {a_m}} &=da_m \frac{\partial {x^\mu}}{\partial {a_m}} \frac{\partial {F}}{\partial {x^\mu}} \\ &=da_m \frac{\partial {F}}{\partial {a_m}} \\ \end{aligned}

Now we see that the differential form of (2.11) for this k=4 example is reduced to

\begin{aligned}( \nabla \wedge F ) \cdot d^4 x &= da_4 \frac{\partial {F}}{\partial {a_4}} \cdot ( dx_1 \wedge dx_2 \wedge dx_3 ) \\ &- da_3 \frac{\partial {F}}{\partial {a_3}} \cdot ( dx_1 \wedge dx_2 \wedge dx_4 ) \\ &+ da_2 \frac{\partial {F}}{\partial {a_2}} \cdot ( dx_1 \wedge dx_3 \wedge dx_4 ) \\ &- da_1 \frac{\partial {F}}{\partial {a_1}} \cdot ( dx_2 \wedge dx_3 \wedge dx_4 ) \\ \end{aligned}

While 2.11 was a statement of Stokes theorem in this Geometric Algebra formulation, it was really incomplete without this explicit expansion of (\partial_\mu F) \cdot (d^k x \cdot \gamma^\mu). This expansion for the k=4 case serves to illustrate that we would write Stokes theorem as

\begin{aligned}\boxed{\int( \nabla \wedge F ) \cdot d^k x =\frac{1}{{(k-1)!}} \epsilon^{ r s \cdots t u } \int da_u \frac{\partial {F}}{\partial {a_{u}}} \cdot (dx_r \wedge dx_s \wedge \cdots \wedge dx_t)}\end{aligned} \hspace{\stretch{1}}(2.13)

Here the indexes have the range \{r, s, \cdots, t, u\} \in \{1, 2, \cdots k\}. This with the definitions 2.7, and 2.8 is really Stokes theorem in its full glory.

Observe that in this Geometric algebra form, the one forms dx_i = da_i {\partial {x}}/{\partial {a_i}}, i \in [1,k] are nothing more abstract that plain old vector differential elements. In the formalism of differential forms, this would be vectors, and (\nabla \wedge F) \cdot d^k x would be a k form. In a context where we are working with vectors, or blades already, the Geometric Algebra statement of the theorem avoids a requirement to translate to the language of forms.

With a statement of the general theorem complete, let’s return to our k=4 case where we can now integrate over each of the a_1, a_2, \cdots, a_k parameters. That is

\begin{aligned}\int ( \nabla \wedge F ) \cdot d^4 x &= \int (F(a_4(1)) - F(a_4(0))) \cdot ( dx_1 \wedge dx_2 \wedge dx_3 ) \\ &- \int (F(a_3(1)) - F(a_3(0))) \cdot ( dx_1 \wedge dx_2 \wedge dx_4 ) \\ &+ \int (F(a_2(1)) - F(a_2(0))) \cdot ( dx_1 \wedge dx_3 \wedge dx_4 ) \\ &- \int (F(a_1(1)) - F(a_1(0))) \cdot ( dx_2 \wedge dx_3 \wedge dx_4 ) \\ \end{aligned}

This is precisely Stokes theorem for the trivector case and makes the enumeration of the boundary surfaces explicit. As derived there was no requirement for an orthonormal basis, nor a Euclidean metric, nor a parametrization along the basis directions. The only requirement of the parametrization is that the associated volume element is non-trivial (i.e. none of dx_q \wedge dx_r = 0).

For completeness, note that our boundary surface and associated Stokes statement for the bivector and vector cases is, by inspection respectively

\begin{aligned}\int ( \nabla \wedge F ) \cdot d^3 x &= \int (F(a_3(1)) - F(a_3(0))) \cdot ( dx_1 \wedge dx_2 ) \\ &- \int (F(a_2(1)) - F(a_2(0))) \cdot ( dx_1 \wedge dx_3 ) \\ &+ \int (F(a_1(1)) - F(a_1(0))) \cdot ( dx_2 \wedge dx_3 ) \\ \end{aligned}


\begin{aligned}\int ( \nabla \wedge F ) \cdot d^2 x &= \int (F(a_2(1)) - F(a_2(0))) \cdot dx_1 \\ &- \int (F(a_1(1)) - F(a_1(0))) \cdot dx_2 \\ \end{aligned}

These three expansions can be summarized by the original single statement of (2.1), which repeating for reference, is

\begin{aligned}\int ( \nabla \wedge F ) \cdot d^k x = \int F \cdot d^{k-1} x \end{aligned}

Where it is implied that the blade F is evaluated on the boundaries and dotted with the associated hypersurface boundary element. However, having expanded this we now have an explicit statement of exactly what that surface element is now for any desired parametrization.

Duality relations and special cases.

Some special (and more recognizable) cases of (2.1) are possible considering specific grades of F, and in some cases employing duality relations.

curl surface integral

One important case is the \mathbb{R}^{3} vector result, which can be expressed in terms of the cross product.

Write \hat{\mathbf{n}} d^2 x = -i dA. Then we have

\begin{aligned}( \boldsymbol{\nabla} \wedge \mathbf{f} ) \cdot d^2 x&=\left\langle{{ i (\boldsymbol{\nabla} \times \mathbf{f}) (- \hat{\mathbf{n}} i dA) }}\right\rangle \\ &=(\boldsymbol{\nabla} \times \mathbf{f}) \cdot \hat{\mathbf{n}} dA\end{aligned}

This recovers the familiar cross product form of Stokes law.

\begin{aligned}\int (\boldsymbol{\nabla} \times \mathbf{f}) \cdot \hat{\mathbf{n}} dA = \oint \mathbf{f} \cdot d\mathbf{x}\end{aligned} \hspace{\stretch{1}}(3.14)

3D divergence theorem

Duality applied to the bivector Stokes result provides the divergence theorem in \mathbb{R}^{3}. For bivector B, let iB = \mathbf{f}, d^3 x = i dV, and d^2 x = i \hat{\mathbf{n}} dA. We then have

\begin{aligned}( \boldsymbol{\nabla} \wedge B ) \cdot d^3 x&=\left\langle{{ ( \boldsymbol{\nabla} \wedge B ) \cdot d^3 x }}\right\rangle \\ &=\frac{1}{{2}} \left\langle{{ ( \boldsymbol{\nabla} B + B \boldsymbol{\nabla} ) i dV }}\right\rangle \\ &=\boldsymbol{\nabla} \cdot \mathbf{f} dV \\ \end{aligned}


\begin{aligned}B \cdot d^2 x&=\left\langle{{ -i\mathbf{f} i \hat{\mathbf{n}} dA}}\right\rangle \\ &=(\mathbf{f} \cdot \hat{\mathbf{n}}) dA \\ \end{aligned}

This recovers the \mathbb{R}^{3} divergence equation

\begin{aligned}\int \boldsymbol{\nabla} \cdot \mathbf{f} dV = \int (\mathbf{f} \cdot \hat{\mathbf{n}}) dA\end{aligned} \hspace{\stretch{1}}(3.15)

4D divergence theorem

How about the four dimensional spacetime divergence? Write, express a trivector as a dual four-vector T = if, and the four volume element d^4 x = i dQ. This gives

\begin{aligned}(\nabla \wedge T) \cdot d^4 x&=\frac{1}{{2}} \left\langle{{ (\nabla T - T \nabla) i }}\right\rangle dQ \\ &=\frac{1}{{2}} \left\langle{{ (\nabla i f - if \nabla) i }}\right\rangle dQ \\ &=\frac{1}{2} \left\langle{{ (\nabla f + f \nabla) }}\right\rangle dQ \\ &=(\nabla \cdot f) dQ\end{aligned}

For the boundary volume integral write d^3 x = n i dV, for

\begin{aligned}T \cdot d^3 x &= \left\langle{{ (if) ( n i ) }}\right\rangle dV \\ &= \left\langle{{ f n }}\right\rangle dV \\ &= (f \cdot n) dV\end{aligned}

So we have

\begin{aligned}\int \partial_\mu f^\mu dQ = \int f^\nu n_\nu dV\end{aligned}

the orientation of the fourspace volume element and the boundary normal is defined in terms of the parametrization, the duality relations and our explicit expansion of the 4D stokes boundary integral above.

4D divergence theorem, continued.

The basic idea of using duality to express the 4D divergence integral as a stokes boundary surface integral has been explored. Lets consider this in more detail picking a specific parametrization, namely rectangular four vector coordinates. For the volume element write

\begin{aligned}d^4 x &= ( \gamma_0 dx^0 ) \wedge ( \gamma_1 dx^1 ) \wedge ( \gamma_2 dx^2 ) \wedge ( \gamma_3 dx^3 ) \\ &= \gamma_0 \gamma_1 \gamma_2 \gamma_3 dx^0 dx^1 dx^2 dx^3 \\ &= i dx^0 dx^1 dx^2 dx^3 \\ \end{aligned}

As seen previously (but not separately), the divergence can be expressed as the dual of the curl

\begin{aligned}\nabla \cdot f&=\left\langle{{ \nabla f }}\right\rangle \\ &=-\left\langle{{ \nabla i (\underbrace{i f}_{\text{grade 3}}) }}\right\rangle \\ &=\left\langle{{ i \nabla (i f) }}\right\rangle \\ &=\left\langle{{ i ( \underbrace{\nabla \cdot (i f)}_{\text{grade 2}} + \underbrace{\nabla \wedge (i f)}_{\text{grade 4}} ) }}\right\rangle \\ &=i (\nabla \wedge (i f)) \\ \end{aligned}

So we have \nabla \wedge (i f) = -i (\nabla \cdot f). Putting things together, and writing i f = -f i we have

\begin{aligned}\int (\nabla \wedge (i f)) \cdot d^4 x&= \int (\nabla \cdot f) dx^0 dx^1 dx^2 dx^3 \\ &=\int dx^0 \partial_0 (f i) \cdot \gamma_{123} dx^1 dx^2 dx^3 \\ &-\int dx^1 \partial_1 (f i) \cdot \gamma_{023} dx^0 dx^2 dx^3 \\ &+\int dx^2 \partial_2 (f i) \cdot \gamma_{013} dx^0 dx^1 dx^3 \\ &-\int dx^3 \partial_3 (f i) \cdot \gamma_{012} dx^0 dx^1 dx^2 \\ \end{aligned}

It is straightforward to reduce each of these dot products. For example

\begin{aligned}\partial_2 (f i) \cdot \gamma_{013}&=\left\langle{{ \partial_2 f \gamma_{0123013} }}\right\rangle \\ &=-\left\langle{{ \partial_2 f \gamma_{2} }}\right\rangle \\ &=- \gamma_2 \partial_2 \cdot f \\ &=\gamma^2 \partial_2 \cdot f \end{aligned}

The rest proceed the same and rather anticlimactically we end up coming full circle

\begin{aligned}\int (\nabla \cdot f) dx^0 dx^1 dx^2 dx^3 &=\int dx^0 \gamma^0 \partial_0 \cdot f dx^1 dx^2 dx^3 \\ &+\int dx^1 \gamma^1 \partial_1 \cdot f dx^0 dx^2 dx^3 \\ &+\int dx^2 \gamma^2 \partial_2 \cdot f dx^0 dx^1 dx^3 \\ &+\int dx^3 \gamma^3 \partial_3 \cdot f dx^0 dx^1 dx^2 \\ \end{aligned}

This is however nothing more than the definition of the divergence itself and no need to resort to Stokes theorem is required. However, if we are integrating over a rectangle and perform each of the four integrals, we have (with c=1) from the dual Stokes equation the perhaps less obvious result

\begin{aligned}\int \partial_\mu f^\mu dt dx dy dz&=\int (f^0(t_1) - f^0(t_0)) dx dy dz \\ &+\int (f^1(x_1) - f^1(x_0)) dt dy dz \\ &+\int (f^2(y_1) - f^2(y_0)) dt dx dz \\ &+\int (f^3(z_1) - f^3(z_0)) dt dx dy \\ \end{aligned}

When stated this way one sees that this could have just as easily have followed directly from the left hand side. What’s the point then of the divergence theorem or Stokes theorem? I think that the value must really be the fact that the Stokes formulation naturally builds the volume element in a fashion independent of any specific parametrization. Here in rectangular coordinates the result seems obvious, but would the equivalent result seem obvious if non-rectangular spacetime coordinates were employed? Probably not.


[1] Peeter Joot. Stokes theorem applied to vector and bivector fields [online].

[2] Peeter Joot. Stokes law in wedge product form [online].

[3] Peeter Joot. Stokes Law revisited with algebraic enumeration of boundary [online].

[4] C. Doran and A.N. Lasenby. Geometric algebra for physicists. Cambridge University Press New York, Cambridge, UK, 1st edition, 2003.

One Response to “Stokes theorem in Geometric Algebra formalism.”

  1. […] electrodynamics), I went back and reviewed my old notes where I blundered through a derivation of Stokes Theorem in Geometric Algebra. I spotted some errors in the original, as well as the fact that a summary of the final result was […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: