Exterior Derivative and $d^2=0$¶
The exterior derivative sends a $k$-form to a $(k+1)$-form. On a scalar function it is the gradient one-form,
$$df=\frac{\partial f}{\partial x^i},dx^i,$$
and on all differential forms it satisfies the fundamental identity $d^2=0$.
A coordinate-free implementation pattern¶
Egison's tensor derivative can map the partial-derivative operator across the coordinate vector. The polymorphic definition below works for a scalar or a tensor-valued expression.
declare symbol x, y, z : MathValue
def params : Vector MathValue := [| x, y, z |]
def d {a} (X : a) : DiffForm a := !(flip ∂/∂) params X
def f : MathValue := x ^ 2 + y ^ 2 + z ^ 2
For $f=x^2+y^2+z^2$, the first exterior derivative is the radial gradient one-form $2x\,dx+2y\,dy+2z\,dz$.
d f
Applying the tensor derivative a second time first produces the raw Hessian. This intermediate object has not yet been projected onto its alternating differential-form part.
d (d f)
The Hessian of a smooth scalar is symmetric, while a two-form is antisymmetric. Their alternating projection therefore vanishes.
dfNormalize (d (d f))
This computation is the coordinate expression of $d^2f=0$: mixed partial derivatives cancel pairwise after antisymmetrization. Showing both the Hessian and its normalized form separates ordinary tensor differentiation from the geometric exterior derivative.