Calculus/Vector calculus

From testwiki
Jump to navigation Jump to search

Template:Calculus/Top Nav Vector calculus specifically refers to multi-variable calculus applied to scalar and vector fields. While vector calculus can be generalized to n dimensions (ℝn), this chapter will specifically focus on 3 dimensions (ℝ3)

Fields in vector calculus

A depiction of xyz Cartesian coordinates with the ijk elementary basis vectors.

Scalar fields

A scalar field is a function f:ℝ3ℝ that assigns a real number to each point in space. Scalar fields typically denote densities or potentials at each specific point. For the sake of simplicity, all scalar fields considered by this chapter will be assumed to be defined at all points and differentiable at all points.

Vector fields

A vector field is a function 𝐅:ℝ3ℝ3 that assigns a vector to each point in space. Vector fields typically denote flow densities or potential gradients at each specific point. For the sake of simplicity, all vector fields considered by this chapter will be assumed to be defined at all points and differentiable at all points.

A depiction of cylindrical coordinates and the accompanying orthonormal basis vectors.

Vector fields in cylindrical coordinates

The cylindrical coordinate system used here has the three parameters: (ρ,ϕ,z). The Cartesian coordinate equivalent to the point (ρ,ϕ,z) is

x=ρcosϕ

y=ρsinϕ

z=z

Any vector field in cylindrical coordinates is a linear combination of the following 3 mutually orthogonal unit length basis vectors:

ρ^=cosϕ𝐒+sinϕ𝐣

ϕ^=sinϕ𝐒+cosϕ𝐣

𝐳^=𝐀

Note that these basis vectors are not constant with respect to position. The fact that the basis vectors change from position to position should always be considered. The cylindrical basis vectors change according to the following rates:

ρ ϕ z
ρ^ ρ^ρ=𝟎 ρ^ϕ=ϕ^ ρ^z=𝟎
ϕ^ ϕ^ρ=𝟎 ϕ^ϕ=𝐫^ ϕ^z=𝟎
𝐳^ 𝐳^ρ=𝟎 𝐳^ϕ=𝟎 𝐳^z=𝟎

Any vector field 𝐅 expressed in cylindrical coordinates has the form: 𝐅(πͺ)=Fρ(πͺ)ρ^+Fϕ(πͺ)ϕ^+Fz(πͺ)𝐳^

Given an arbitrary position πͺ=(ρ,ϕ,z) that changes with time, the velocity of the position is:

dπͺdt=dρdtρ^+ρdϕdtϕ^+dzdt𝐳^

The coefficient of ρ for the term ρdϕdtϕ^ originates from the fact that as the azimuth angle ϕ increases, the position πͺ swings around at a speed of ρ.

A depiction of spherical coordinates and the accompanying orthonormal basis vectors.

Vector fields in spherical coordinates

The spherical coordinate system used here has the three parameters: (r,θ,ϕ). The Cartesian coordinate equivalent to the point (r,θ,ϕ) is

x=rsinθcosϕ

y=rsinθsinϕ

z=rcosθ

Any vector field in spherical coordinates is a linear combination of the following 3 mutually orthogonal unit length basis vectors:

𝐫^=sinθcosϕ𝐒+sinθsinϕ𝐣+cosθ𝐀

θ^=cosθcosϕ𝐒+cosθsinϕ𝐣sinθ𝐀

ϕ^=sinϕ𝐒+cosϕ𝐣

Note that these basis vectors are not constant with respect to position. The fact that the basis vectors change from position to position should always be considered. The spherical basis vectors change according to the following rates:

r θ ϕ
𝐫^ 𝐫^r=𝟎 𝐫^θ=θ^ 𝐫^ϕ=sinθϕ^
θ^ θ^r=𝟎 θ^θ=𝐫^ θ^ϕ=cosθϕ^
ϕ^ ϕ^r=𝟎 ϕ^θ=𝟎 ϕ^ϕ=(sinθ𝐫^+cosθθ^)

Any vector field 𝐅 expressed in spherical coordinates has the form: 𝐅(πͺ)=Fr(πͺ)𝐫^+Fθ(πͺ)θ^+Fϕ(πͺ)ϕ^

Given an arbitrary position πͺ=(r,θ,ϕ) that changes with time, the velocity of this position is:

dπͺdt=drdt𝐫^+rdθdtθ^+rsinθdϕdtϕ^

The coefficient of r for the term rdθdtθ^ arises from the fact that as the latitudinal angle θ changes, the position πͺ traverses a great circle at a speed of r.

The coefficient of rsinθ for the term rsinθdϕdtϕ^ arises from the fact that as the longitudinal angle ϕ changes, the position πͺ traverses a latitude circle at a speed of rsinθ.

Volume, path, and surface integrals

Volume Integrals

Volume integrals have already been discussed in the chapter Multivariable calculus, but a brief review is given here for completeness.

Given a scalar field ρ:ℝ3ℝ that denotes a density at each specific point, and an arbitrary volume Ωℝ3, the total "mass" M inside of Ω can be determined by partitioning Ω into infinitesimal volumes. At each position πͺΩ, the volume of the infinitesimal volume is denoted by the infinitesimal dV. This gives rise to the following integral:

M=πͺΩρ(πͺ)dV

Path Integrals

Given any oriented path C (oriented means that there is a preferred direction), the differential dπͺ=dx𝐒+dy𝐣+dz𝐀 denotes an infinitesimal displacement along C in the preferred direction. This differential can be used in various path integrals. Letting f:ℝ3ℝ denote an arbitrary scalar field, and 𝐅:ℝ3ℝ3 denote an arbitrary vector field, various path integrals include:

πͺCf(πͺ)dπͺ, πͺCf(πͺ)|dπͺ|, πͺC𝐅(πͺ)dπͺ, πͺC𝐅(πͺ)|dπͺ|, and many more.

πͺCdπͺ denotes the total displacement along C, and πͺC|dπͺ| denotes the total length of C.

Calculating Path Integrals

To compute a path integral, the continuous oriented curve C must be parameterized. πͺC(t) will denote the point along C indexed by t from the range [t0,t1]. πͺC(t0)=πͺ0 must be the starting point of C and πͺC(t1)=πͺ1 must be the ending point of C. As t increases, πͺC(t) must proceed along C in the preferred direction. An infinitesimal change in t, dt, results in the infinitesimal displacement dπͺ=dπͺCdtdt along C. In the path integral πͺC𝐅(πͺ)dπͺ, the differential dπͺ can be replaced with dπͺCdtdt to get t=t0t1𝐅(πͺC(t))dπͺCdtdt

Template:DropBox

If a vector field 𝐅 denotes a "force field", which returns the force on an object as a function of position, the work performed on a point mass that traverses the oriented curve C is W=πͺC𝐅(πͺ)dπͺ

Template:DropBox


Template:DropBox

Surface Integrals

Given any oriented surface σ (oriented means that the there is a preferred direction to pass through the surface), an infinitesimal portion of the surface is defined by an infinitesimal area |dS|, and a unit length outwards oriented normal vector 𝐧. 𝐧 has a length of 1 and is perpendicular to the surface of σ, while penetrating σ in the preferred direction. The infinitesimal portion of the surface is denoted by the infinitesimal "surface vector": 𝐝𝐒=|dS|𝐧. If a vector field 𝐅:ℝ3ℝ3 denotes a flow density, then the flow through the infinitesimal surface portion in the preferred direction is 𝐅(πͺ)𝐝𝐒.

The infinitesimal "surface vector" 𝐝𝐒=𝐧|dS| describes the infinitesimal surface element in a manner similar to how the infinitesimal displacement dπͺ describes an infinitesimal portion of a path. More specifically, similar to how the interior points on a path do not affect the total displacement, the interior points on a surface to not affect the total surface vector.

The displacement between two points is independent of the path that connects them.

Consider for instance two paths C1 and C2 that both start at point A, and end at point B. The total displacements, πͺC1dπͺ and πͺC2dπͺ, are both equivalent and equal to the displacement between A and B. Note however that the total lengths πͺC1|dπͺ| and πͺC2|dπͺ| are not necessarily equivalent.

Similarly, given two surfaces S1 and S2 that both share the same counter-clockwise oriented boundary C, the total surface vectors πͺS1𝐝𝐒 and πͺS2𝐝𝐒 are both equivalent and are a function of the boundary C. This implies that a surface can be freely deformed within its boundaries without changing the total surface vector. Note however that the surface areas πͺS1|𝐝𝐒| and πͺS2|𝐝𝐒| are not necessarily equivalent.

The fact that the total surface vectors of S1 and S2 are equivalent is not immediately obvious. To prove this fact, let 𝐅 be a constant vector field. S1 and S2 share the same boundary, so the flux/flow of 𝐅 through S1 and S2 is equivalent. The flux through S1 is Φ1=πͺS1𝐅𝐝𝐒=𝐅πͺS1𝐝𝐒, and similarly for S2 is Φ2=πͺS2𝐅𝐝𝐒=𝐅πͺS2𝐝𝐒. Since 𝐅πͺS1𝐝𝐒=𝐅πͺS2𝐝𝐒 for every choice of 𝐅, it follows that πͺS1𝐝𝐒=πͺS2𝐝𝐒.

The geometric significance of the total surface vector is that each component measures the area of the projection of the surface onto the plane formed by the other two dimensions. Let σ be a surface with surface vector 𝐒=Sx𝐒+Sy𝐣+Sz𝐀. It is then the case that: Sx is the area of the projection of σ onto the yz-plane; Sy is the area of the projection of σ onto the xz-plane; and Sz is the area of the projection of σ onto the xy-plane.

The boundary Σ of Σ is counter-clockwise oriented.

Given an oriented surface Σ, another important concept is the oriented boundary. The boundary of Σ is an oriented curve Σ but how is the orientation chosen? If the boundary is "counter-clockwise" oriented, then the boundary must follow a counter-clockwise direction when the oriented surface normal vectors point towards the viewer. The counter-clockwise boundary also obeys the "right-hand rule": If you hold your right hand with your thumb in the direction of the surface normals (penetrating the surface in the "preferred" direction), then your fingers will wrap around in the direction of the counter-clockwise oriented boundary.

Template:DropBox

Template:DropBox


Calculating Surface Integrals

To calculate a surface integral, the oriented surface σ must be parameterized. Let πͺσ(u,v) be a continuous function that maps each point (u,v) from a two-dimensional domain Du,v to a point in σ. πͺσ(u,v) must be continuous and onto. While πͺσ(u,v) does not necessarily have to be one to one, the parameterization should never "fold back" on itself. The infinitesimal increases in u and v are respectively du and dv. These respectively give rise to the displacements πͺσudu and πͺσvdv. Assuming that the surface's orientation follows the right hand rule with respect to the displacements πͺσudu and πͺσvdv, the surface vector that arises is 𝐝𝐒=(πͺσu×πͺσv)dudv.

In the surface integral πͺσ𝐅(πͺ)𝐝𝐒, the differential 𝐝𝐒 can be replaced with (πͺσu×πͺσv)dudv to get (u,v)Du,v𝐅(πͺσ(u,v))(πͺσu×πͺσv)dudv.

Template:DropBox

The Gradient and Directional Derivatives

Given a scalar field ϕ:ℝ3ℝ that denotes a potential, and given a curve C, a commonly sought after quantity is the rate of change in ϕ as C is being traversed. Let t be an arbitrary parameter for C, and let πͺC(t)=(x(t),y(t),z(t)) denote the point indexed by t. Given an arbitrary t=t0 which corresponds to the point πͺC(t0)=πͺ0=(x0,y0,z0), then using the chain rule gives the following expression for the rate of increase of ϕ at t=t0, dϕdt|t0:

dϕdt|t0=ϕx|πͺ0dxdt|t0+ϕy|πͺ0dydt|t0+ϕz|πͺ0dzdt|t0=(ϕ)|πͺ0𝐯|t0

where ϕ=ϕx𝐒+ϕy𝐣+ϕz𝐀 is a vector field that denotes the "gradient" of ϕ, and 𝐯=dxdt𝐒+dydt𝐣+dzdt𝐀 is the unnormalized tangent of C.

If t is an arc-length parameter, i.e. |𝐯|=1, then the direction of the gradient is the direction of maximum gain: Given any unit length tangent 𝐯, the direction 𝐯=ϕ|ϕ| will maximize the rate of increase in ϕ. This maximum rate of increase is |ϕ|.

Calculating total gain

Given the gradient of a scalar field ϕ: ϕ, the difference between ϕ at two different points can be calculated, provided that there is a continuous path that links the two points. Let C denote an arbitrary continuous path that starts at point πͺ0 and ends at point πͺ1. Given an infinitesimal path segment P with endpoints πͺl and πͺu, let πͺcP be an arbitrary point in P. Δπͺ=πͺuπͺl denotes the infinitesimal displacement denoted by P. The increase in ϕ along P is:

ϕ(πͺu)ϕ(πͺl)(ϕ)|πͺcΔπͺ

The relative error in the approximations vanish as Δπͺ𝟎. Adding together the above equation over all infinitesimal path segments of C yields the following path integral equation:

ϕ(πͺ1)ϕ(πͺ0)=πͺC(ϕ)|πͺdπͺ

This is the path integral analog of the fundamental theorem of calculus.

The gradient in cylindrical coordinates

Let f:ℝ3ℝ be a scalar field that denotes a potential and a curve C that is parameterized by t: πͺC(t)=(ρ(t),ϕ(t),z(t)). Let the rate of change in πͺC(t) be quantified by the vector dπͺCdt=dρdtρ^+ρdϕdtϕ^+dzdt𝐳^=vρρ^+vϕϕ^+vz𝐳^. The rate of change in f is:

dfdt=fρdρdt+fϕdϕdt+fzdzdt=fρvρ+fϕvϕρ+fzvz=(fρρ^+1ρfϕϕ^+fz𝐳^)(vρρ^+vϕϕ^+vz𝐳^)=(f)dπͺCdt

Therefore in cylindrical coordinates, the gradient is: f=fρρ^+1ρfϕϕ^+fz𝐳^

The gradient in spherical coordinates

Let f:ℝ3ℝ be a scalar field that denotes a potential and a curve C that is parameterized by t: πͺC(t)=(r(t),θ(t),ϕ(t)). Let the rate of change in πͺC(t) be quantified by the vector dπͺCdt=drdt𝐫^+rdθdtθ^+rsinθdϕdtϕ^=vr𝐫^+vθθ^+vϕϕ^. The rate of change in f is:

dfdt=frdrdt+fθdθdt+fϕdϕdt=frvr+fθvθr+fϕvϕrsinθ=(fr𝐫^+1rfθθ^+1rsinθfϕϕ^)(vr𝐫^+vθθ^+vϕϕ^)=(f)dπͺCdt

Therefore in spherical coordinates, the gradient is: f=fr𝐫^+1rfθθ^+1rsinθfϕϕ^

The Directional Derivative

Given a scalar field f and a vector 𝐯, scalar field g=𝐯(f) computes the rate of change in f at each position πͺ where the velocity of πͺ is dπͺdt=𝐯. Scalar field g can also be expressed as g=(𝐯)f. Velocity 𝐯 can also be a vector field 𝐕 so dπͺdt depends on the position πͺ. Scalar field g becomes g=(𝐕)f.

In Cartesian coordinates where 𝐕=vx𝐒+vy𝐣+vz𝐀 the directional derivative is:

(𝐕)f=vxfx+vyfy+vzfz

In cylindrical coordinates where 𝐕=vρρ^+vϕϕ^+vz𝐳^ the directional derivative is:

(𝐕)f=vρfρ+vϕρfϕ+vzfz

In spherical coordinates where 𝐕=vr𝐫^+vθθ^+vϕϕ^ the directional derivative is:

(𝐕)f=vrfr+vθrfθ+vϕrsinθfϕ

What makes the discussion of directional derivatives nontrivial is the fact that f can instead be a vector field 𝐅. Vector field 𝐆=(𝐕)𝐅 computes d𝐅dt at each position πͺ where dπͺdt=𝐕(πͺ).

In cylindrical coordinates, basis vectors ρ^ and ϕ^ are not fixed, and in spherical coordinates, all of the basis vectors 𝐫^, θ^, and ϕ^ are not fixed. This makes determining the directional derivative of a vector field that is expressed using the cylindrical or spherical basis vectors non-trivial. To directly compute the directional derivative, the rates of change of each basis vector with respect to each coordinate should be used. Alternatively, the following identities related to the directional derivative can be used (proofs can be found here):

Given vector fields 𝐕, 𝐅, and 𝐆, then (𝐕)(𝐅+𝐆)=(𝐕)𝐅+(𝐕)𝐆

Given vector fields 𝐕 and 𝐆, and scalar field f, then (𝐕)(f𝐆)=((𝐕)f)𝐆+f((𝐕)𝐆)

In cylindrical coordinates, ((vρρ^+vϕϕ^+vz𝐳^))ρ^=vϕρϕ^ and ((vρρ^+vϕϕ^+vz𝐳^))ϕ^=vϕρρ^

In spherical coordinates, ((vr𝐫^+vθθ^+vϕϕ^))𝐫^=1r(vθθ^+vϕϕ^), and ((vr𝐫^+vθθ^+vϕϕ^))θ^=1r(vθ𝐫^+cotθvϕϕ^), and ((vr𝐫^+vθθ^+vϕϕ^))ϕ^=vϕrsinθ(sinθ𝐫^+cosθθ^)

Template:DropBox

The Divergence and Gauss's Divergence Theorem

Let 𝐅=Fx𝐒+Fy𝐣+Fz𝐀 denote a vector field that denotes "flow density". For any infinitesimal surface vector 𝐝𝐒=dSx𝐒+dSy𝐣+dSz𝐀 at position πͺ, the flow through 𝐝𝐒 in the preferred direction is 𝐅(πͺ)𝐝𝐒=Fx(πͺ)dSx+Fy(πͺ)dSy+Fz(πͺ)dSz. Fx is the flow density parallel to the x-axis etc.

Given a volume Ω with a closed surface boundary Ω with an outwards orientation, the total outwards flow/flux through Ω is given by the surface integral πͺΩ𝐅(πͺ)𝐝𝐒. This outwards flow is equal to the total flow that is being generated in the interior of Ω.

For an infinitesimal rectangular prism R=[xl,xu]×[yl,yu]×[zl,zu] (Δx=xuxl, Δy=yuyl, and Δz=zuzl) that is centered on position (xc,yc,zc), the outwards flow through the surface R is:

πͺR𝐅(πͺ)𝐝𝐒 𝐅(xu,yc,zc)(ΔyΔz𝐒)+𝐅(xl,yc,zc)(ΔyΔz𝐒)+ 𝐅(xc,yu,zc)(ΔxΔz𝐣)+𝐅(xc,yl,zc)(ΔxΔz𝐣)+ 𝐅(xc,yc,zu)(ΔxΔy𝐀)+𝐅(xc,yc,zl)(ΔxΔy𝐀)=

Fx(xu,yc,zc)Fx(xl,yc,zc)Δx(ΔxΔyΔz)+ Fy(xc,yu,zc)Fy(xc,yl,zc)Δy(ΔxΔyΔz)+ Fz(xc,yc,zu)Fz(xc,yc,zl)Δz(ΔxΔyΔz)

(Fxx|(xc,yc,zc)+Fyy|(xc,yc,zc)+Fzz|(xc,yc,zc))ΔxΔyΔz

πͺR(Fxx+Fyy+Fzz)dV

All relative errors vanish as Δx,Δy,Δz0+.

𝐅=Fxx+Fyy+Fzz is the "divergence" of 𝐅 and is the density of "flow generation" at (xc,yc,zc). As noted above, the total outwards flow through Ω is the total flow generated inside of Ω, which gives Gauss's divergence theorem:

πͺΩ𝐅(πͺ)𝐝𝐒=πͺΩ(𝐅)|πͺdV

This image depicts an example of the total flow across a closed boundary being the total flow generated inside the boundary.

In the image to the right, an example of the total flow across a closed boundary being the total flow generated in the interior of the boundary is given. The direction of the flow across each edge is denoted by the direction of the arrows, and the rate is denoted by the number of arrows. Each node inside the boundary is labelled with the rate of flow generation at the current node. It can be checked that a net total of 2 units of flow is being drawn into the boundary, and the total rate of flow generation across all interior nodes is a net consumption of 2 units.


The divergence in cylindrical coordinates

Let 𝐅=Fρρ^+Fϕϕ^+Fz𝐳^ denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of 𝐅, consider an infinitesimal volume R defined by all points (ρ,ϕ,z) where ρ[ρl,ρu], ϕ[ϕl,ϕu], and z[zl,zu]. Note that R is not a rectangular prism. Let Δρ=ρuρl, Δϕ=ϕuϕl, and Δz=zuzl. Let (ρc,ϕc,zc)R be an arbitrary point from R.

The volume of R is approximately ΔρρcΔϕΔz. The 6 surfaces bounding R are described in the following table:

Surface approximate area direction approximate flow density
ρ=ρu, ϕ[ϕl,ϕu], z[zl,zu] ρuΔϕΔz +ρ^ 𝐅(ρu,ϕc,zc)
ρ=ρl, ϕ[ϕl,ϕu], z[zl,zu] ρlΔϕΔz ρ^ 𝐅(ρl,ϕc,zc)
ρ[ρl,ρu], ϕ=ϕu, z[zl,zu] ΔρΔz +ϕ^ 𝐅(ρc,ϕu,zc)
ρ[ρl,ρu], ϕ=ϕl, z[zl,zu] ΔρΔz ϕ^ 𝐅(ρc,ϕl,zc)
ρ[ρl,ρu], ϕ[ϕl,ϕu], z=zu ΔρρcΔϕ +𝐳^ 𝐅(ρc,ϕc,zu)
ρ[ρl,ρu], ϕ[ϕl,ϕu], z=zl ΔρρcΔϕ 𝐳^ 𝐅(ρc,ϕc,zl)

The total outwards flow through the surface R of R is:

πͺR𝐅(πͺ)𝐝𝐒 𝐅(ρu,ϕc,zc)(ρuΔϕΔzρ^)+𝐅(ρl,ϕc,zc)(ρlΔϕΔzρ^)+ 𝐅(ρc,ϕu,zc)(ΔρΔzϕ^)+𝐅(ρc,ϕl,zc)(ΔρΔzϕ^)+ 𝐅(ρc,ϕc,zu)(ΔρρcΔϕ𝐳^)+𝐅(ρc,ϕc,zl)(ΔρρcΔϕ𝐳^)=

ρuFρ(ρu,ϕc,zc)ρlFρ(ρl,ϕc,zc)Δρ(ΔρΔϕΔz)+ Fϕ(ρc,ϕu,zc)Fϕ(ρc,ϕl,zc)Δϕ(ΔρΔϕΔz)+ ρcFz(ρc,ϕc,zu)Fz(ρc,ϕc,zl)Δz(ΔρΔϕΔz)

(ρ(ρFρ)|(ρc,ϕc,zc)+ϕ(Fϕ)|(ρc,ϕc,zc)+ρcz(Fz)|(ρc,ϕc,zc))(ΔρΔϕΔz)=

(1ρcρ(ρFρ)|(ρc,ϕc,zc)+1ρcϕ(Fϕ)|(ρc,ϕc,zc)+z(Fz)|(ρc,ϕc,zc))(ΔρρcΔϕΔz)

πͺR(1ρρ(ρFρ)+1ρϕ(Fϕ)+z(Fz))dV

All relative errors vanish as Δρ,Δϕ,Δz0+.

The divergence (flow generation density) is therefore:

𝐅=1ρρ(ρFρ)+1ρϕ(Fϕ)+z(Fz)

Template:DropBox

The divergence in spherical coordinates

Let 𝐅=Fr𝐫^+Fθθ^+Fϕϕ^ denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of 𝐅, consider an infinitesimal volume R defined by all points (r,θ,ϕ) where r[rl,ru], θ[θl,θu], and ϕ[ϕl,ϕu]. Note that R is not a rectangular prism. Let Δr=rurl, Δθ=θuθl, and Δϕ=ϕuϕl. Let (rc,θc,ϕc)R be an arbitrary point from R.

The volume of R is approximately ΔrrcΔθrcsinθcΔϕ. The 6 surfaces bounding R are shown in the following table:

Surface approximate area direction approximate flow density
r=ru, θ[θl,θu], ϕ[ϕl,ϕu] ruΔθrusinθcΔϕ +𝐫^ 𝐅(ru,θc,ϕc)
r=rl, θ[θl,θu], ϕ[ϕl,ϕu] rlΔθrlsinθcΔϕ 𝐫^ 𝐅(rl,θc,ϕc)
r[rl,ru], θ=θu, ϕ[ϕl,ϕu] ΔrrcsinθuΔϕ +θ^ 𝐅(rc,θu,ϕc)
r[rl,ru], θ=θl, ϕ[ϕl,ϕu] ΔrrcsinθlΔϕ θ^ 𝐅(rc,θl,ϕc)
r[rl,ru], θ[θl,θu], ϕ=ϕu ΔrrcΔθ +ϕ^ 𝐅(rc,θc,ϕu)
r[rl,ru], θ[θl,θu], ϕ=ϕl ΔrrcΔθ ϕ^ 𝐅(rc,θc,ϕl)

The total outwards flow through the surface R of R is:

πͺR𝐅(πͺ)𝐝𝐒

𝐅(ru,θc,ϕc)(ruΔθrusinθcΔϕ𝐫^)+𝐅(rl,θc,ϕc)(rlΔθrlsinθcΔϕ𝐫^)+

𝐅(rc,θu,ϕc)(ΔrrcsinθuΔϕθ^)+𝐅(rc,θl,ϕc)(ΔrrcsinθlΔϕθ^)+

𝐅(rc,θc,ϕu)(ΔrrcΔθϕ^)+𝐅(rc,θc,ϕl)(ΔrrcΔθϕ^)=

(sinθcru2Fr(ru,θc,ϕc)rl2Fr(rl,θc,ϕc)Δr+rcsinθuFθ(rc,θu,ϕc)sinθlFθ(rc,θl,ϕc)Δθ+rcFϕ(rc,θc,ϕu)Fϕ(rc,θc,ϕl)Δϕ)ΔrΔθΔϕ

(sinθcr(r2Fr)|(rc,θc,ϕc)+rcθ(sinθFθ)|(rc,θc,ϕc)+rcϕ(Fϕ)|(rc,θc,ϕc))(ΔrΔθΔϕ)=

(1rc2r(r2Fr)|(rc,θc,ϕc)+1rcsinθcθ(sinθFθ)|(rc,θc,ϕc)+1rcsinθcϕ(Fϕ)|(rc,θc,ϕc))(ΔrrcΔθrcsinθcΔϕ)

πͺR(1r2r(r2Fr)+1rsinθθ(sinθFθ)+1rsinθϕ(Fϕ))dV

All relative errors vanish as Δr,Δθ,Δϕ0+

The divergence (flow generation density) is therefore:

𝐅=1r2r(r2Fr)+1rsinθθ(sinθFθ)+1rsinθϕ(Fϕ)


Divergence free vector fields

A vector field 𝐅 for which 𝐅=0 is a "divergence free" vector field. 𝐅 can also be referred to as "incompressible" (since the flow density of an incompressible fluid is divergence free) or "solenoidal" (since magnetic fields are divergence free).

A key property of a divergence free vector field 𝐅 is that the flux of 𝐅 through a surface is purely a function of the surface's boundary. If σ1 and σ2 are two surfaces which share the same counterclockwise oriented boundary C, then πͺσ1𝐅(πͺ)𝐝𝐒=πͺσ2𝐅(πͺ)𝐝𝐒. In other words, the flux is purely a function of C. This property can be derived from Gauss's divergence theorem as follows:

To begin, it will be assumed that σ1 and σ2 do not intersect each other, except for at the common boundary C. The argument presented here easily generalizes to cases where σ1 and σ2 do intersect each other. Invert the orientation of σ2 to get σ2 and combine σ1 and σ2 to get a closed surface σ3=σ1σ2, stitching the surfaces together along the seam C. Let Ω denote the volume which is the interior of σ3, and it will also be assumed that σ3 is oriented outwards (which is the case if σ1 is "in front" of σ2).

Gauss's divergence theorem states that πͺσ3𝐅(πͺ)𝐝𝐒=πͺΩ(𝐅)|πͺdV=0. The flux through σ3 is the flux through σ1 minus the flux through σ2: πͺσ3𝐅(πͺ)𝐝𝐒=πͺσ1𝐅(πͺ)𝐝𝐒+πͺσ2𝐅(πͺ)𝐝𝐒 =πͺσ1𝐅(πͺ)𝐝𝐒πͺσ2𝐅(πͺ)𝐝𝐒. Therefore:

πͺσ3𝐅(πͺ)𝐝𝐒=0 πͺσ1𝐅(πͺ)𝐝𝐒=πͺσ2𝐅(πͺ)𝐝𝐒

The Laplacian Operator

Given a scalar field f, if the gradient f is interpreted as denoting flow density, the rate of flow generation at each point is (f) which is referred to as the "Laplacian" of f and is denoted by 2f (or alternately Δf).

The laplacian 2f is effectively a measure of the "convexity" of f at each point πͺ. When there is a net flow of the gradient away from πͺ, this means that f(πͺ) is "low" compared to its neighboring points and that the convexity (2f)|πͺ is positive. When there is a net flow of the gradient towards πͺ, this means that f(πͺ) is "high" compared to its neighboring points and that the convexity (2f)|πͺ is negative.

In Cartesian coordinates, the Laplacian is:

2f=(f)=(fx𝐒+fy𝐣+fz𝐀)=2fx2+2fy2+2fz2

In cylindrical coordinates, the Laplacian is:

2f=(f)=(fρρ^+1ρfϕϕ^+fz𝐳^)=1ρρ(ρfρ)+1ρ22fϕ2+2fz2

In spherical coordinates, the Laplacian is:

2f=(f)=(fr𝐫^+1rfθθ^+1rsinθfϕϕ^)=1r2r(r2fr)+1r2sinθθ(sinθfθ)+1r2sin2θ2fϕ2

The Laplacian and Vector fields

Occasionally, the Laplacian operator is applied to a vector field as opposed to a scalar field. Other than for Cartesian coordinates, the Laplacian cannot be applied directly to each component, as in non-Cartesian coordinate systems, the basis vectors are subject to change. In cylindrical coordinates, basis vectors ρ^ and ϕ^ are not fixed, and in spherical coordinates, all of the basis vectors 𝐫^, θ^, and ϕ^ are not fixed. This makes determining the Laplacian of a vector field that is expressed using the cylindrical or spherical basis vectors non-trivial. To directly compute the Laplacian, the rates of change of each basis vector with respect to each coordinate should be used. Alternatively, the following identities related to the Laplacian can be used (proofs can be found here):

Given vector fields 𝐅 and 𝐆, then 2(𝐅+𝐆)=2𝐅+2𝐆

Given scalar field f and vector field 𝐆, then 2(f𝐆)=(2f)𝐆+2((f))𝐆+f(2𝐆)

In cylindrical coordinates, 2ρ^=1ρ2ρ^ and 2ϕ^=1ρ2ϕ^

In spherical coordinates, 2𝐫^=2r2𝐫^, and 2θ^=1r2sin2θ(sin(2θ)𝐫^+θ^), and 2ϕ^=1r2sin2θϕ^

Template:DropBox

The Curl and Stokes' Theorem

Given a scalar field f:ℝ3ℝ and a curve C with endpoints πͺ0 and πͺ1, the difference between f(πͺ1) and f(πͺ0) is given by the following path integral involving the gradient field 𝐅=f: f(πͺ1)f(πͺ0)=πͺC𝐅(πͺ)dπͺ. If C is closed (πͺ1=πͺ0), then πͺC𝐅(πͺ)dπͺ=0. In other words, the "gain" of 𝐅=f around a closed curve C is always 0. Most vector fields 𝐅:ℝ3ℝ3 are not the gradient of any scalar field however, and the gain of 𝐅 around a closed curve C may not always be 0. This gives rise to the notion of circulation or "curl".

The path integral πͺC𝐅(πͺ)dπͺ for a closed curve C is the "circulation" of 𝐅 around C. Stokes' theorem will show that the circulation around C is the total circulation accumulated in the interior of C.

Green's Theorem

A demonstration of how a large loop can be decomposed into a family of infinitesimal loops.

Quantifying "circulation density" is best introduced in 2 dimensions. Given a large counter-clockwise oriented loop C that is confined to 2 dimensions, C can be decomposed into a family of infinitesimal loops as shown on the right. Boundaries that are common to adjacent loops cancel each other out due to their opposite orientations, so the total circulation around C is the sum of the circulations around each infinitesimal loop.

An infinitesimal rectangular loop.

Consider the infinitesimal rectangle R=[xl,xu]×[yl,yu]. Let (xc,yc)R be an arbitrary point inside the rectangle, let Δx=xuxl and Δy=yuyl, and let R be the counterclockwise boundary of R.

The circulation around R is approximately (the relative error vanishes as Δx,Δy0+):

πͺR𝐅(πͺ)dπͺ𝐅(xu,yc)(+Δy𝐣)+𝐅(xc,yu)(Δx𝐒)+𝐅(xl,yc)(Δy𝐣)+𝐅(xc,yl)(+Δx𝐒) =Fy(xu,yc)ΔyFx(xc,yu)ΔxFy(xl,yc)Δy+Fx(xc,yl)Δx =(Fy(xu,yc)Fy(xl,yc)ΔxFx(xc,yu)Fx(xc,yl)Δy)ΔxΔy (Fyx|(xc,yc)Fxy|(xc,yc))ΔxΔy R(FyxFxy)dxdy

As Δx,Δy0+, the relative errors present in the approximations vanish, and therefore, for an infinitesimal rectangle, πͺR𝐅(πͺ)dπͺ=πͺR(FyxFxy)dxdy

FyxFxy is the "circulation density" at (xc,yc). Let C be a counter-clockwise oriented loop with interior D. The circulation around loop C is the total circulation contained by D: πͺC𝐅(πͺ)dπͺ=πͺD(FyxFxy)dxdy. This is Green's theorem.

Stokes' Theorem

Stokes' Theorem is effectively a generalization of Green's theorem to 3 dimensions, and the "curl" is a generalization of the quantity FyxFxy to 3 dimensions. An arbitrary oriented surface σ can be articulated into a family of infinitesimal surfaces, some parallel to the xy-plane, others parallel to the zx-plane, and the remainder parallel to the yz-plane. Let 𝐅 denote an arbitrary vector field.

Let σ be a surface that is parallel to the yz-plane with counter-clockwise oriented boundary C. Green's theorem gives:

πͺC𝐅(πͺ)dπͺ=πͺσ(FzyFyz)(𝐝𝐒𝐒)=πͺσ((FzyFyz)𝐒)𝐝𝐒

𝐝𝐒𝐒 is positive if the normal direction to σ points in the positive x direction and is negative if otherwise. If the normal direction to σ points in the negative x direction, then C is oriented clockwise instead of counter-clockwise in the yz-plane.

Decomposing a 3D loop into an ensemble of infinitesimal loops that are parallel to the yz, zx, or xy planes.

Repeating this argument for σ being parallel to the zx-plane and xy-plane respectively gives:

πͺC𝐅(πͺ)dπͺ=πͺσ(FxzFzx)(𝐝𝐒𝐣)=πͺσ((FxzFzx)𝐣)𝐝𝐒

and

πͺC𝐅(πͺ)dπͺ=πͺσ(FyxFxy)(𝐝𝐒𝐀)=πͺσ((FyxFxy)𝐀)𝐝𝐒

Treating σ as an ensemble of infinitesimal surfaces parallel to the yz-plane, zx-plane, or xy-plane gives:

πͺC𝐅(πͺ)dπͺ=πͺσ((FzyFyz)𝐒+(FxzFzx)𝐣+(FyxFxy)𝐀)𝐝𝐒

This is Stokes' theorem, and ×𝐅=(FzyFyz)𝐒+(FxzFzx)𝐣+(FyxFxy)𝐀 is the "curl" of 𝐅 which generalizes the "circulation density" to 3 dimensions.

The direction of ×𝐅 at πͺ is effectively an "axis of rotation" around which the counterclockwise circulation density in a plane whose normal is parallel to ×𝐅 is |×𝐅|. Out of all planes that pass through πͺ, the plane whose normal is parallel to ×𝐅 has the largest counterclockwise circulation density at πͺ which is |×𝐅|.

An arbitrary vector field 𝐅 that is differentiable everywhere is considered to be "irrotational" or "conservative" if ×𝐅=𝟎 everywhere, or equivalently that πͺC𝐅(πͺ)dπͺ=0 for all continuous closed curves C.

The curl in cylindrical coordinates

Let 𝐅=Fρρ^+Fϕϕ^+Fz𝐳^ denote an arbitrary vector field in cylindrical coordinates. By calculating the circulation densities in surfaces perpendicular to ρ^, ϕ^, and 𝐳^, the curl can be computed:

×𝐅=1ρ(ϕ(Fz)z(ρFϕ))ρ^+(z(Fρ)ρ(Fz))ϕ^+1ρ(ρ(ρFϕ)ϕ(Fρ))𝐳^ =(1ρϕ(Fz)z(Fϕ))ρ^+(z(Fρ)ρ(Fz))ϕ^+1ρ(ρ(ρFϕ)ϕ(Fρ))𝐳^

The curl in spherical coordinates

Let 𝐅=Fr𝐫^+Fθθ^+Fϕϕ^ denote an arbitrary vector field in spherical coordinates. By calculating circulation densities in surfaces perpendicular to 𝐫^, θ^, and ϕ^, the curl can be computed:

×𝐅=1r2sinθ(θ(rsinθFϕ)ϕ(rFθ))𝐫^+1rsinθ(ϕ(Fr)r(rsinθFϕ))θ^+1r(r(rFθ)θ(Fr))ϕ^

=1rsinθ(θ(sinθFϕ)ϕ(Fθ))𝐫^+1r(1sinθϕ(Fr)r(rFϕ))θ^+1r(r(rFθ)θ(Fr))ϕ^


Irrotational vector fields

A vector field 𝐅 for which ×𝐅=𝟎 at all points is an "irrotational" vector field. 𝐅 can also be referred to as being "conservative" since the gain around any closed curve is always 0.

A key property of an irrotational vector field 𝐅 is that the gain of 𝐅 along a continuous curve is purely a function of the curve's end points. If C1 and C2 are two continuous curves which share the same starting point πͺ0 and end point πͺ1, then πͺC1𝐅(πͺ)dπͺ=πͺC2𝐅(πͺ)dπͺ. In other words, the gain is purely a function of πͺ0 and πͺ1. This property can be derived from Stokes' theorem as follows:

Invert the orientation of C2 to get C2 and combine C1 and C2 to get a continuous closed curve C3=C1C2, linking the curves together at the endpoints πͺ0 and πͺ1. Let σ denote a surface for which C3 is the counterclockwise oriented boundary.

Stokes' theorem states that πͺC3𝐅(πͺ)dπͺ=πͺσ(×𝐅)|πͺ𝐝𝐒=0. The gain around C3 is the gain along C1 minus the gain along C2: πͺC3𝐅(πͺ)dπͺ=πͺC1𝐅(πͺ)dπͺ+πͺC2𝐅(πͺ)dπͺ =πͺC1𝐅(πͺ)dπͺπͺC2𝐅(πͺ)dπͺ. Therefore:

πͺC3𝐅(πͺ)dπͺ=0 πͺC1𝐅(πͺ)dπͺ=πͺC2𝐅(πͺ)dπͺ

Summary and Extensions

In summary:

The gradient of a scalar field f is f=fx𝐒+fy𝐣+fz𝐀 which denotes the rate of change in f in each direction, at each point.
Given an oriented curve C which starts at πͺ0 and ends at πͺ1, the increase in f along C is: f(πͺ1)f(πͺ0)=πͺC(f)|πͺdπͺ (the gradient theorem)
If a vector field 𝐅=Fx𝐒+Fy𝐣+Fz𝐀 denotes "flow density", then the divergence is 𝐅=Fxx+Fyy+Fzz which denotes the density of "flow generation" at each point.
Given a volume Ω with outwards oriented surface Ω, the total flow being generated inside Ω is: πͺΩ𝐅(πͺ)𝐝𝐒=πͺΩ(𝐅)|πͺdV (Gauss's divergence theorem)
The curl of a vector field 𝐅=Fx𝐒+Fy𝐣+Fz𝐀 is ×𝐅=(FzyFyz)𝐒+(FxzFzx)𝐣+(FyxFxy)𝐀 which denotes the "circulation density" at each point.
Given an oriented surface σ with a counter-clockwise oriented boundary σ, the total circulation present in σ is: πͺσ𝐅(πͺ)dπͺ=πͺσ(×𝐅)|πͺ𝐝𝐒 (Stokes' theorem)


Extending the gradient theorem

The gradient theorem states that given an everywhere differentiable scalar field f and a continuous oriented curve C with endpoints πͺ0 and πͺ1, that f(πͺ1)f(πͺ0)=πͺC(f)|πͺdπͺ. This theorem can be extended to equate a surface integral with a volume integral, as opposed to equating a difference with a path integral.

Let Ω be an arbitrary volume with outwards oriented surface Ω. Let L=(xl,y,z)(xu,y,z) be an arbitrary line segment parallel to the x-axis that is completely contained by Ω and that starts and ends on the surface of Ω. Let this line segment have an infinitesimal cross-sectional area of t. The volume integral of fx over L is: πͺLfxdV=tx=xlxufxdx=t(f(xu,y,z)f(xl,y,z)). Let 𝐝𝐒l and 𝐝𝐒u be the infinitesimal surface portions of Ω formed when L intersects Ω at (xl,y,z) and (xu,y,z) respectively. The x-component of 𝐝𝐒l and 𝐝𝐒u is t and t respectively. Adding up all possible line segments L gives:

πͺΩfxdV=πͺΩf(πͺ)dSx where dSx is the x-component of the differential 𝐝𝐒.

Repeating for the y-axis and z-axis gives:

πͺΩfydV=πͺΩf(πͺ)dSy where dSy is the y-component of the differential 𝐝𝐒.

πͺΩfzdV=πͺΩf(πͺ)dSz where dSz is the z-component of the differential 𝐝𝐒.

This yields:

πͺΩ(fx𝐒+fy𝐣+fz𝐀)dV=πͺΩf(πͺ)(dSx𝐒+dSy𝐣+dSz𝐀)

and hence:

πͺΩf(πͺ)𝐝𝐒=πͺΩ(f)|πͺdV

The above integral equation is effectively a generalization of the gradient theorem.


Extending Stokes' Theorem

Stokes' theorem states that given an everywhere differentiable vector field 𝐅=Fx𝐒+Fy𝐣+Fz𝐀 and an oriented surface σ with counterclockwise boundary σ, that πͺσ𝐅(πͺ)dπͺ=πͺσ(×𝐅)|πͺ𝐝𝐒. This theorem can be extended to equate a surface integral with a volume integral, as opposed to equating a path integral with a surface integral.

Let Ω be an arbitrary volume with outwards oriented surface Ω. Let xcℝ be arbitrary, and let D be the cross-section of Ω in the plane x=xc. Let D be the counter-clockwise boundary of D (the surface normal vectors of D point in the positive x-direction). Green's theorem gives:

πͺD𝐅(πͺ)dπͺ=πͺD(FzyFyz)dydz

Now let the cross-section D have an infinitesimal thickness dx, forming the volume slice D. Let E denote the infinitesimal strip of Ω that wraps the cross-section (E is similar to D except that E is a surface with a non-zero infinitesimal width). Let 𝐝𝐒 be an infinitesimal portion of E. Ignoring the component of 𝐝𝐒 that is parallel to D, dSy𝐣+dSz𝐀 denotes a thin strip of surface that wraps around D, and is parallel to the x-axis. The counterclockwise displacement dπͺ along the boundary of D manifested by dSy𝐣+dSz𝐀 is dπͺ=dSzdx𝐣+dSydx𝐀. Substituting into the path integral around D gives:

πͺE(Fz(πͺ)dSydxFy(πͺ)dSzdx)=πͺD(FzyFyz)dydz

πͺE(Fz(πͺ)dSyFy(πͺ)dSz)=πͺD(FzyFyz)dV

Integrating over all cross-sections gives:

πͺΩ(Fz(πͺ)dSyFy(πͺ)dSz)=πͺΩ(FzyFyz)dV

Repeating the above argument for the y-axis and z-axis gives:

πͺΩ(Fx(πͺ)dSzFz(πͺ)dSx)=πͺΩ(FxzFzx)dV

πͺΩ(Fy(πͺ)dSxFx(πͺ)dSy)=πͺΩ(FyxFxy)dV

This yields:

πͺΩ((Fz(πͺ)dSyFy(πͺ)dSz)𝐒+(Fx(πͺ)dSzFz(πͺ)dSx)𝐣+(Fy(πͺ)dSxFx(πͺ)dSy)𝐀) =πͺΩ((FzyFyz)𝐒+(FxzFzx)𝐣+(FyxFxy)𝐀)dV

πͺΩ𝐝𝐒×𝐅(πͺ)=πͺΩ(×𝐅)|πͺdV

The above integral equation is effectively a generalization of Stokes' theorem.

Template:BookCat