VectorCalculus
diff
computes the derivative of a Vector
Calling Sequence
Parameters
Description
Examples
diff(f, v)
f
-
Vector(algebraic); Vector or algebraic expression
v
name; specify the variables of differentiation
The diff(f,v) command is an extension of the top-level diff command which understands free Vectors, position Vectors, rooted Vectors and VectorFields in the different coordinate systems of the VectorCalculus package. If f is not a Vector, the arguments are passed to the top-level diff command.
If f is a free Vector, f is differentiated component-wise independent of the coordinate system. The output is a free Vector.
If f is a position Vector representing a curve or surface, the Vector is differentiated component-wise since it is in Cartesian coordinates (see Position Vector). The output is a Vector rooted at the point with the same components as the position Vector.
If f is a rooted Vector in non-Cartesian coordinates, f is mapped back to Cartesian coordinates where the differentiation takes place. The output is a Vector rooted at the same point as f.
If f is a VectorField in non-Cartesian coordinates, the unit vectors of the coordinate system of the field are expressed in terms of the standard Cartesian unit vectors to perform the differentiation. The result is mapped back to the original coordinate system and a field is returned.
Differentiating a free Vector.
with⁡VectorCalculus:
v1≔t,t2,t3
v1≔tex+t2ey+t3ez
diff⁡v1,t
1ex+2⁢tey+3⁢t2ez
v2≔1,2,3
v2≔1ex+2ey+3ez
diff⁡v2,t
0ex+0ey+0ez
Differentiating a position Vector that represents a curve. The result is a vector rooted at the curve.
pv≔PositionVector⁡p,p,polarr,t
pv≔p⁢cos⁡pp⁢sin⁡p
dpv≔diff⁡pv,p
dpv≔cos⁡p−p⁢sin⁡psin⁡p+p⁢cos⁡p
GetRootPoint⁡dpv
p⁢cos⁡pex+p⁢sin⁡pey
Differentiating a rooted Vector gives a Vector rooted at the same root as the original Vector.
rv≔RootedVector⁡1,p,root=p,p,polarr,t
rv≔1p
drv≔diff⁡rv,p
drv≔p⁢cos⁡p⁢−2⁢sin⁡p−p⁢cos⁡p+p⁢sin⁡p⁢2⁢cos⁡p−p⁢sin⁡pp2⁢sin⁡p2+p2⁢cos⁡p2p⁢cos⁡p⁢2⁢cos⁡p−p⁢sin⁡p−p⁢sin⁡p⁢−2⁢sin⁡p−p⁢cos⁡pp2⁢sin⁡p2+p2⁢cos⁡p2
simplify⁡drvassuming0<p
−p2
GetRootPoint⁡rv
per+pet
pv≔PositionVector⁡1,t,t2,cartesianx,y,z
pv≔1tt2
tv≔diff⁡pv,t
tv≔012⁢t
dtv≔diff⁡tv,t
dtv≔002
GetRootPoint⁡dtv
1ex+tey+t2ez
Differentiating a VectorField gives another VectorField.
F≔VectorField⁡a⁢r,0,0,sphericalr,φ,θ
F≔a⁢re_r+0e_φ+0e_θ
diff⁡F,φ
a⁢r⁢cos⁡φ⁢cos⁡θ2⁢sin⁡φ+a⁢r⁢cos⁡φ⁢sin⁡θ2⁢sin⁡φ−a⁢r⁢sin⁡φ⁢cos⁡φe_r+a⁢r⁢cos⁡φ2⁢cos⁡θ2+a⁢r⁢cos⁡φ2⁢sin⁡θ2+a⁢r⁢sin⁡φ2e_φ+0e_θ
W≔VectorField⁡f⁡r,t,g⁡r,t,polarr,t
W≔f⁡r,te_r+g⁡r,te_t
simplify⁡diff⁡W,r
∂∂rf⁡r,te_r+∂∂rg⁡r,te_t
simplify⁡diff⁡W,t
∂∂tf⁡r,t−g⁡r,te_r+f⁡r,t+∂∂tg⁡r,te_t
See Also
VectorCalculus[PositionVector]
VectorCalculus[RootedVector]
VectorCalculus[TangentVector]
VectorCalculus[Vector]
VectorCalculus[VectorField]
Download Help Document
What kind of issue would you like to report? (Optional)