The directional derivative of a scalar function f(x), computed in the direction u in Cartesian coordinates, is defined by limit((D(f))(x(t)), t = 0), where x(t) is the vector x evaluated along a line with direction u.

When it exists, it can be evaluated as Nabla(f).u. In Maple, it is easy to implement both the definition and the evaluation, as we show in the ensuing discussion.

However, several identities in vector calculus involve the operator A.VectorCalculus[Nabla] acting on a vector B. The resulting expression Typesetting[delayDotProduct](A.VectorCalculus[Nabla], B, true) is interpreted as the directional derivative of the vector B in the direction of the vector A. This is not easy to implement in Maple's VectorCalculus package. However, this functionality appears to exist in the Physics:-Vectors package, but the correct result is only obtained in Cartesian coordinates. The DifferentialGeometry package, where it is properly called the DirectionalCovariantDerivative, provides a full functionality for this directional derivative. However, both the Vector Calculus and Physics:-Vectors packages use unit basis vectors, so vectors are given with physical components, whereas differential geometry uses the natural (non-normalized) basis vectors, so vectors are given with the "natural" components.

These issues were discussed in a recent Tips and Techniques article in the Maple Reporter. My interest in the question was just renewed by one of Robert Israel's responses in MaplePrimes. In it, he shows that the notation `~`[A.VectorCalculus[Nabla]](B) will map the directional derivative onto each component of B. However, this gives the correct result only in Cartesian coordinates, as we show in the discussions below.

NULL

 

Directional Derivative of a Scalar

 
 

Cartesian Coordinates

 
 

Top Level

 

If U = u*i+v*j is a unit vector in Cartesian coordinates, then the rate of change of the scalar function f(x, y) taken at a, b in the direction U is

 

limit(diff(f(a+t*u, b+t*v), t), t = 0) = (D[1](f))(a, b)*u+(D[2](f))(a, b)*vNULL

``

as computed by Maple. This directional derivative can be written as f[x](a, b)*u+f[y](a, b)*v, or as Nabla(f).U, provided we define Nabla(f) as the vector f[x]*i+f[y]*j.

``

 

VectorCalculus

 

The DirectionalDiff command in the VectorCalculus packages will compute, at a, b, the directional derivative of the scalar function f(x, y) in the direction of the vector V, where V does not have to be a unit vector. We illustrate these calculations for the Student VectorCalculus package because this package is a bit more lenient with respect to defining coordinate systems and the names of coordinate variables.

 

• 

Tools_Load Package: Student Vector Calculus

Loading Student:-VectorCalculus NULL

• 

Define the vector V = u*i+v*j.

V := `<,>`(u, v)

• 

Apply the DirectionalDiff command.
Note that Maple normalizes V.

DirectionalDiff(f(x, y), V)

(diff(f(x, y), x))*u/(u^2+v^2)^(1/2)+(diff(f(x, y), y))*v/(u^2+v^2)^(1/2)

• 

The DirectionalDiff command supports evaluation at a point from within the command itself.

DirectionalDiff(f(x, y), point = [a, b], V)

(diff(f(a, b), a))*u/(u^2+v^2)^(1/2)+(diff(f(a, b), b))*v/(u^2+v^2)^(1/2)

Obtain the directional derivative from first principles

• 

Apply V to obtain the gradient of f.

• 

Apply the Normalize command to V.

Nabla(f(x, y)).Normalize(V)

(diff(f(x, y), x))*u/(u^2+v^2)^(1/2)+(diff(f(x, y), y))*v/(u^2+v^2)^(1/2)

• 

Normalize V by dividing it by its length.

(Nabla(f(x, y)).V)/LinearAlgebra[Norm](V)

(u*(diff(f(x, y), x))+v*(diff(f(x, y), y)))/(u^2+v^2)^(1/2)

 

``

 

Student MultivariateCalculus

 

The Student MultivariateCalculus package has a DirectionalDerivative command that normalizes the direction vector and also has the "evaluation" property.

 

• 

Tools_Load Package:
Student Multivariate Calculus

restart

Loading Student:-MultivariateCalculus

• 

Apply the DirectionalDerivative command.

DirectionalDerivative(f(x, y), [x, y] = [a, b], [u, v])

(diff(f(a, b), a))*u/(u^2+v^2)^(1/2)+(diff(f(a, b), b))*v/(u^2+v^2)^(1/2)

 

``

 

Physics:-Vectors

 

The Physics:-Vectors package also has a DirectionalDiff command that will normalize the direction vector. However, it does not have the "evaluation" property.

 

• 

Restart Maple.

• 

Load the Physics:-Vectors package.

• 

Allow notational enhancements.

restart

with(Physics[Vectors])

Setup(mathematicalnotation = true)

• 

Define the direction vector V.
The basis vector i can be entered as _i or as `#mover(mi(.

V := _i*u+_j*v

_i*u+_j*v

• 

Apply the DirectionalDiff command.
The vector V is normalized by DirectionalDiff.

DirectionalDiff(f(x, y), V)

((diff(f(x, y), x))*u+(diff(f(x, y), y))*v)/(u^2+v^2)^(1/2)

 

``

 

Polar Coordinates

 

In Cartesian coordinates, the defining calculation

 

limit(diff(f(a+t*u, b+t*v), t), t = 0) = (D[1](f))(a, b)*u+(D[2](f))(a, b)*v

 

suggests that when the limit of this derivative exists, it can be more easily calculated as Nabla(f).U. The paradigm extends to other coordinate systems.

 

 

VectorCalculus

 

``

• 

Restart Maple.

• 

Tools_Load Package: Student Vector Calculus

restart

Loading Student:-VectorCalculus NULL

• 

Define the direction vector V as a vector field in polar coordinates.

V := VectorField(`<,>`(u, v), coords = polar[r, theta])

• 

Apply the DirectionalDiff command to f(r,theta).
The third argument indicates the system in which to interpret f.

• 

Simplify: sqrt(r^2 (cos(t))^2+r^2 (sin(t))^2)->r, and arctan(r sin(theta),r cos(theta))->theta 

• 

Change (D[1](f))(r, theta) to (∂f)/(∂r), etc.

q[1] := DirectionalDiff(f(r, theta), V, polar[r, theta]); q[2] := `assuming`([simplify(q[1])], [r > 0, theta > 0, theta < (1/2)*Pi]); q[3] := convert(q[2], diff); expand(q[3])

(diff(f(r, theta), r))*u/(u^2+v^2)^(1/2)+(diff(f(r, theta), theta))*v/(r*(u^2+v^2)^(1/2))

 

 

Maple obtains this result by mapping the whole calculation back to Cartesian coordinates, applying the paradigm Nabla(f).U, then mapping back to polar coordinates. Note that Maple also normalizes the vector V.

``

 

Physics:-Vectors

 

Like the Student VectorCalculus package, the Physics:-Vectors package can work in Cartesian real^2 and real^3, as well as spherical and cylindrical coordinates. For polar coordinates, Physics:-Vectors uses the cylindrical system with basis vectors `#mover(mi( and `#mover(mi(. The VectorCalculus package itself works with all of the orthogonal coordinate systems known to Maple. (See help( for the complete list.)

 

• 

Restart Maple.

• 

Load the Physics:-Vectors package.

• 

Allow notational enhancements.

restart

with(Physics[Vectors])

Setup(mathematicalnotation = true)

• 

Define the direction vector V in polar coordinates.
The basis vector `#mover(mi( can be entered as _rho or as `#mover(mi(.

V := u*`#mover(mi(

u*_rho+v*_phi

• 

Apply the DirectionalDiff command.
The vector V is normalized by DirectionalDiff.

DirectionalDiff(f(rho, phi), V)

((diff(f(rho, phi), rho))*u+(diff(f(rho, phi), phi))*v/rho)/(u^2+v^2)^(1/2)

 

 

This result is equivalent to the result produced by the DirectionalDiff command in the VectorCalculus packages.

``

 

Directional Derivative of a Vector

 

The operator A.VectorCalculus[Nabla] acting on a vector B appears in the vector identities for the gradient of a dot product, and for the curl of a cross product. In particular, the operator appears in the identities

 

VectorCalculus[Nabla](u.v) = Typesetting[delayDotProduct](u.VectorCalculus[Nabla], v, true)+Typesetting[delayDotProduct](v.VectorCalculus[Nabla], u, true)+`&x`(u, `&x`(VectorCalculus[Nabla], v))+`&x`(v, `&x`(VectorCalculus[Nabla], u))

and

`&x`(VectorCalculus[Nabla], `&x`(u, v)) = Typesetting[delayDotProduct](v.VectorCalculus[Nabla], u, true)-Typesetting[delayDotProduct](u.VectorCalculus[Nabla], v, true)+u*VectorCalculus[Nabla].v-v*VectorCalculus[Nabla].u 

 

and is generally interpreted as the directional derivative of one vector taken in the direction of the other vector. Indeed, it is a form of the directional covariant derivative of differential geometry. Just as the directional derivative of a scalar leads to the definition of the gradient vector, so too does the directional derivative of a vector lead to the covariant derivative, a rank-two tensor.

 

Implementing this directional derivative of a vector in the confines of the VectorCalculus packages pushes these packages to their limits. In effect, the calculation can only be done in Cartesian coordinates, and that, by an artifact. Outside its DifferentialGeometry package, Maple cannot form the operator A*∇ =a[1](∂)/(∂x)+a[2](∂)/(∂y) +a[3](∂)/(∂z), so must first compute the gradients of each component of B, and then dot A with each such gradient.

 

The Physics:-Vectors package extends the applicability of its DirectionalDiff command, but unfortunately normalizes the direction vector when applied to a scalar (correct) and also when applied to a vector (problematic).

``

 

Cartesian Coordinates

 
 

VectorCalculus

 

``

• 

Restart Maple.

• 

Tools_Load Package: Student Vector Calculus

• 

Set display format for vectors.

restart

Loading Student:-VectorCalculus

BasisFormat(false)

• 

Define vector fields F and V.

F := VectorField(`<,>`(f(x, y), g(x, y))); V := VectorField(`<,>`(u, v))

• 

Compute Typesetting[delayDotProduct](V.VectorCalculus[Nabla], F, true) by mapping the gradient onto the components of F, then mapping the dot product with V onto each component of that "vector."

map(DotProduct, map(VectorCalculus[Nabla], F), V)

Vector(2, {(1) = (diff(f(x, y), x))*u+(diff(f(x, y), y))*v, (2) = (diff(g(x, y), x))*u+(diff(g(x, y), y))*v})

• 

Compute Typesetting[delayDotProduct](V.VectorCalculus[Nabla], F, true) by mapping DirectionalDiff onto the components of F. This then requires multiplying by LinearAlgebra[Norm](V) because DirectionalDiff normalizes the direction vector V.

simplify(map(DirectionalDiff, F, V)*(LinearAlgebra[Norm](V))(`<,>`(u, v)))

Vector(2, {(1) = (diff(f(x, y), x))*u+(diff(f(x, y), y))*v, (2) = (diff(g(x, y), x))*u+(diff(g(x, y), y))*v})

 

The syntax for mapping the DirectionalDiff command onto the components of F is far more complex than that required for mapping both the gradient and the dot product. This is for two reasons. First, the DirectionalDiff command normalized the direction vector (here, V); and second, because the Norm command in the VectorCalculus packages produces a function whose value at a point is the norm of the given vector.

 

A proposal to modify DirectionalDiff in the VectorCalculus packages has already been made. Under this proposal, application of the command to a vector field would be allowed, and when so applied, the direction vector would not be normalized. Maplesoft has given serious consideration to this modification, and if implemented, would allow the (2-D) Math notation (A.VectorCalculus[Nabla])(B) to stand for DirectionalDiff(B, A).

``

 

Physics:-Vectors

 

Although the DirectionalDiff command in the Physics:-Vectors package automatically maps onto the components of a vector, the direction vector is normalized.

Unlike the VectorCalculus packages, the Physics:-Vectors package lets the syntax A.VectorCalculus[Nabla] to form a valid operator that can be applied to a vector B. Hence, the notation (A.VectorCalculus[Nabla])(B) will compute the directional derivative of B in the direction of A.

 

• 

Restart Maple.

• 

Load the Physics:-Vectors package.

• 

Allow notational enhancements.

restart

with(Physics[Vectors])

Setup(mathematicalnotation = true)

• 

Define the vector F.
The basis vector i can be entered as _i or as `#mover(mi(.

F := f(x, y)*`#mover(mi(

f(x, y)*_i+g(x, y)*_j

• 

Define the direction vector V.
The basis vector i can be entered as _i or as `#mover(mi(.

V := u*`#mover(mi(

u*_i+v*_j

• 

Apply the DirectionalDiff command, organizing the result by components.

collect(DirectionalDiff(F, V), [`#mover(mi(

(u*(diff(f(x, y), x))+v*(diff(f(x, y), y)))*_i/(u^2+v^2)^(1/2)+(u*(diff(g(x, y), x))+v*(diff(g(x, y), y)))*_j/(u^2+v^2)^(1/2)

• 

Implement the notation A.VectorCalculus[Nabla](B), again organizing the result by components.

collect((V.VectorCalculus[Nabla])(F), [`#mover(mi(

(u*(diff(f(x, y), x))+v*(diff(f(x, y), y)))*_i+(u*(diff(g(x, y), x))+v*(diff(g(x, y), y)))*_j

 

Since the DirectionalDiff command again normalizes the direction vector, the best implementation of the directional derivative of a vector is via the notation (A.VectorCalculus[Nabla])(B) in the Physics:-Vectors package, at least in Cartesian coordinates.

 

 

Polar Coordinates

 

As earlier, polar coordinates are used as an example of nonCartesian coordinates.

 

 

VectorCalculus

 

In the VectorCalculus packages, the mapping artifact that works in Cartesian coordinates does not work in polar coordinates. A wrong answer results. Therefore, to obtain the directional derivative of a vector in polar coordinates, the calculation must be implemented in Cartesian coordinates.

NULL

• 

Restart Maple.

• 

Tools_Load Package: Student Vector Calculus

• 

Set display format for vectors.

restart

Loading Student:-VectorCalculus

BasisFormat(false)

• 

Define, in polar coordinates, the vector fields F and V.

F := VectorField(`<,>`(f(r, theta), g(r, theta)), polar[r, theta]); V := VectorField(`<,>`(u(r, theta), v(r, theta)), polar[r, theta])

• 

Apply the MapToBasis command to convert F and V to vector fields in Cartesian coordinates.

Fc := MapToBasis(F, cartesian[x, y]); Vc := MapToBasis(V, cartesian[x, y])

• 

Obtain the directional derivative.

• 

Map the result back to polar coordinates.

• 

Simplify: sqrt(r^2 cos(theta)^2+r^2 sin(theta)^2)->r, and arctan(r sin(theta),r cos(theta))->theta 

• 

Change (D[1](f))(r, theta) to (∂f)/(∂r), etc.

q[1] := map(DotProduct, map(VectorCalculus[Nabla], Fc), Vc); q[2] := MapToBasis(q[1], polar[r, theta]); q[3] := `assuming`([simplify(q[2])], [r > 0, theta > 0, theta < (1/2)*Pi]); q[4] := map(convert, q[3], diff)

• 

Display the directional derivative, after having grouped the result by components.

map(collect, q[4], [u(r, theta), v(r, theta)])

Vector(2, {(1) = (diff(f(r, theta), r))*u(r, theta)+(diff(f(r, theta), theta)-g(r, theta))*v(r, theta)/r, (2) = (diff(g(r, theta), r))*u(r, theta)+(f(r, theta)+diff(g(r, theta), theta))*v(r, theta)/r})

 

In this directional derivative, the terms -g*v/r and f*v/r in the first and second components respectively, imply that V.VectorCalculus[Nabla] cannot be represented in nonCartesian coordinates as an operator acting componentwise on F. This is because ultimately, derivatives have to be taken of the varying basis vectors e[r] and e[theta]. Indeed, let x(s) = a+alpha*s, y(s) = b+beta*s, define a line through the Cartesian point a, b in the direction alpha*i+beta*j. The polar vector F evaluated along this line is

 

F(s) = f(sqrt(x(s)^2+y(s)^2), arctan(y(s), x(s)))*e[r]+g(sqrt(x(s)^2+y(s)^2), arctan(y(s), x(s)))*e[theta]

 

The directional derivative is given by limit((D(F))(s), s = 0), in which the basis vectors e[r] and e[theta] vary along the line described by x(s), y(s). Thus, computing (D(F))(s) requires differentiating the products f*e[r] and g*e[theta], a process that would generate the Christoffel symbols of covariant differentiation. It is this differentiation process that is responsible for the non-differentiated terms in the directional derivative, and therefore the need to carry out the calculation in Cartesian coordinates.

NULL

 

Physics:-Vectors

 

As pointed out earlier, the Physics:-Vectors package uses cylindrical coordinates to implement polar coordinates. The basis vectors are `#mover(mi( and `#mover(mi(.

 

Unfortunately, none of DirectionalDiff(F,(V*∇)(F), or V.VectorCalculus[Nabla](F) give the correct directional derivative for vectors F and V in polar coordinates. The calculation must still be carried out in Cartesian coordinates, even in the Physics:-Vectors package.

 

• 

Restart Maple.

• 

Load the Physics:-Vectors package.

• 

Allow notational enhancements.

restart

with(Physics[Vectors])

Setup(mathematicalnotation = true)

• 

Define, in polar coordinates, the vector fields F and V.

F := f(rho, phi)*`#mover(mi(

• 

The following three results are not correct. The first two are missing the non-differentiated terms. The third, using syntax that worked for the scalar case, has incorrect and missing terms.

collect(DirectionalDiff(F, V), [`#mover(mi(

(u*(diff(f(rho, phi), rho))+v*(diff(f(rho, phi), phi))/rho)*_rho/(u^2+v^2)^(1/2)+(u*(diff(g(rho, phi), rho))+v*(diff(g(rho, phi), phi))/rho)*_phi/(u^2+v^2)^(1/2)

collect((V.VectorCalculus[Nabla])(F), [`#mover(mi(

(u*(diff(f(rho, phi), rho))+v*(diff(f(rho, phi), phi))/rho)*_rho+(u*(diff(g(rho, phi), rho))+v*(diff(g(rho, phi), phi))/rho)*_phi

collect(V.VectorCalculus[Nabla](F), [`#mover(mi(

(diff(f(rho, phi), rho)+f(rho, phi)/rho+(diff(g(rho, phi), phi))/rho)*u*_rho+(diff(f(rho, phi), rho)+f(rho, phi)/rho+(diff(g(rho, phi), phi))/rho)*v*_phi

 

The correct result can be obtained by the same process used with polar coordinates in the VectorCalculus package. The following calculations bring the vectors to Cartesian coordinates, compute the directional derivative, and return the results to polar coordinates.

 

Apply the ChangeBasis command to convert F and V to vectors in Cartesian coordinates.

Fc := ChangeBasis(F, cartesian, alsocomponents); Vc := ChangeBasis(V, cartesian, alsocomponents)

• 

Obtain the directional derivative and simplify:
sqrt(rho^2 cos(phi)^2+rho^2 sin(phi)^2)->rho

• 

Map the result back to polar coordinates.

• 

Force arctan((rho sin(phi))/(rho cos(phi)))->phi 

• 

Change (D[1](f))(rho, phi) to (∂f)/(∂rho), etc.

Q[1] := simplify((Vc.VectorCalculus[Nabla])(Fc)); Q[2] := ChangeBasis(Q[1], cylindrical, alsocomponents); Q[3] := subs(arctan(sin(phi)/cos(phi)) = phi, Q[2]); Q[4] := convert(Q[3], diff)

• 

Display the directional derivative, after having grouped the result by components.

collect(Q[4], [`#mover(mi(

(u*(diff(f(rho, phi), rho))-v*g(rho, phi)/rho+v*(diff(f(rho, phi), phi))/rho)*_rho+(v*(diff(g(rho, phi), phi))/rho+u*(diff(g(rho, phi), rho))+v*f(rho, phi)/rho)*_phi

 

NULL

 

DifferentialGeometry

 

There is considerable overhead in setting up a calculation of the directional derivative in the DifferentialGeometry package. Moreover, the notation is ill-adapted for math-mode entry or display of the basic objects of the subject, as demonstrated in greater detail in the earlier Reporter article Tensor Calculus with the Differential Geometry Package, available in the Maple Application Center.

 

If v^k and alpha^k are the contravariant components of the vectors F, and V, respectively, then the directional covariant derivative is given by (∇)[j]v^(k)alpha^(j), where (∇)[j]v^(k) is the covariant derivative of F. The following manipulations leading to the invocation of the DirectionalCovariantDerivative command generate the directional covariant derivative of F in the direction of V.

 

• 

Restart Maple.

• 

Load the package and the necessary subpackages.

• 

Avail of notational compression.

restart

with(DifferentialGeometry); with(Tensor); with(Tools); PDEtools[declare](A(r, theta), B(r, theta), quiet)

• 

Define R2 as a Cartesian frame.

• 

Define P as a polar frame.

DGsetup([x, y], R2); DGsetup([r, theta], P)

• 

Define the covariant (tangent) basis vectors e[x], e[y].

B1 := [D_x, D_y]

[_DG([[

• 

Define the contravariant (gradient) basis vectors e^x, e^y.

B2 := DualBasis(B1)

[_DG([[

• 

Define the metric tensor g[ij] for the Euclidean frame.``

gE := evalDG(`&t`(dx, dx)+`&t`(dy, dy))

_DG([[

The metric tensor for the polar frame is obtained by transforming the Cartesian one

• 

Equations defining the inverse map from polar to Cartesian.

X := r*cos(theta); Y := r*sin(theta)

• 

Define the inverse map as a DifferentialGeometry object.

Phi_inv := Transformation(P, R2, [x = X, y = Y])

_DG([[

• 

Obtain the metric tensor g[ij] for polar coordinates.

g := Pullback(Phi_inv, gE)

_DG([[

• 

Connection for polar coordinates.

C := Christoffel(g)

_DG([[

• 

GAMMA[ij]^k, Christoffel symbols (second kind)NULLfor polar coordinates:
GAMMA[11] = GAMMA[21] and GAMMA[21] = GAMMA[11]^2 and GAMMA[11]^2 = GAMMA[12] and GAMMA[12] = GAMMA[22]^2 and GAMMA[22]^2 = 0, GAMMA[21]^2 = GAMMA[12]^2 and GAMMA[12]^2 = 1/r; GAMMA[22] = -r

• 

List the nonzero Christoffel symbols: GAMMA[ij]^(k)->[i,j,k]

DGinfo(C,

[[[1, 2, 2], 1/r], [[2, 1, 2], -r], [[2, 2, 1], 1/r]]

• 

Define the contravariant vector F.

F := DGzip([A(r, theta), B(r, theta)], [D_r, D_theta],

_DG([[

• 

Define the contravariant vector V.

V := DGzip([u, v], [D_r, D_theta],

_DG([[

• 

Apply the DirectionalCovariantDerivative command to obtain the directional derivative of F along V.

DCD := DirectionalCovariantDerivative(V, F, C)

_DG([[

• 

Write the directional covariant derivative as a column vector.

convert(collect(convert(DCD, DGArray), [u, v], expand), Vector[column])

Vector(2, {(1) = u*(diff(A(r, theta), r))+(-r*B(r, theta)+diff(A(r, theta), theta))*v, (2) = (B(r, theta)/r+diff(B(r, theta), r))*u+(A(r, theta)/r+diff(B(r, theta), theta))*v})

• 

Write the covariant derivative of F as an array.

map(expand, convert(CovariantDerivative(F, C), DGArray))

Matrix(2, 2, {(1, 1) = diff(A(r, theta), r), (1, 2) = -r*B(r, theta)+diff(A(r, theta), theta), (2, 1) = B(r, theta)/r+diff(B(r, theta), r), (2, 2) = A(r, theta)/r+diff(B(r, theta), theta)})

 

At first glance, the result produced by the DirectionalCovariantDerivative does not agree with the earlier result

 

[f[r]*u+(f[theta]-g)*v/r]*`#mover(mi(

``

This is because the VectorCalculus and Physics:-Vectors packages use unit basis vectors, so components of vectors are the so-called physical components. The DifferentialGeometry package uses the natural basis vectors, which are not necessarily of unit length. Consequently, to make the results agree, consider the following.

 

• 

Let R be the position vector for polar coordinates.

R = r*cos(theta)*i+r*sin(theta)*j ``

• 

Natural basis vectors: e[r], e[theta]

• 

Unit basis vectors: `#mover(mi(

 

e[r]=(∂R)/(∂r)=cos(theta) i+sin(theta) j       =   `#mover(mi( ``

e[theta]=(∂R)/(∂theta)=-r sin(theta) i+r cos(theta) j  =  r*`#mover(mi(``

• 

Express F = A*e[r]+B*e[theta] with unit vectors `#mover(mi(

• 

Express V = U*e[r]+V*e[theta] with unit vectors `#mover(mi(

A*e[r]+B*e[theta] = A*`#mover(mi(
 ``

U*e[r]+V*e[theta] = U*`#mover(mi(

• 

Match physical components with "natural" components.

f[r] = A[r]

f[theta] = A[theta] 

g[r] = r*B[r]+B 

`#msub(mi(

• 

Replace physical components and unit basis vectors with natural components and natural basis vectors.

[f[r] u+(f[theta]-g)/(r) v] r+[g[r] u+(g[theta]+f)/(r) v] theta=

[A[r] U+(A[theta]-B r)/(r) V r] e[r]+[(r B[r]+B)U+(r B[theta]+A)/(r) V r] (e[theta])/(r)=

[A[r]*U+(A[theta]-B*r)*V]*e[r]+[(B[r]+B/r)*U+(B[theta]+A/r)*V]*e[theta]

 
 

 Thus, using either the VectorCalculus or Physics:-Vectors packages to compute Typesetting[delayDotProduct](A.VectorCalculus[Nabla], B, true) in polar coordinates by mapping back to Cartesian coordinates produces the same result as computing the directional covariant derivative in the DifferentialGeometry package. Perhaps one day these Maple packages will become more interconnected.````

 

Download Directional_Derivati.mw

Please Wait...