Calculus/Vector calculus

← Inverse function theorem, implicit function theorem Calculus Vector calculus identities →
Vector calculus

Vector calculus specifically refers to multi-variable calculus applied to scalar and vector fields. While vector calculus can be generalized to dimensions (), this chapter will specifically focus on 3 dimensions ()

Fields in vector calculus

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

Scalar fields

edit

A scalar field is a function   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

edit

A vector field is a function   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

edit

The cylindrical coordinate system used here has the three parameters:  . The Cartesian coordinate equivalent to the point   is

 

 

 

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

 

 

 

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:

     
       
       
       

Any vector field   expressed in cylindrical coordinates has the form:  

Given an arbitrary position   that changes with time, the velocity of the position is:

 

The coefficient of   for the term   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

edit

The spherical coordinate system used here has the three parameters:  . The Cartesian coordinate equivalent to the point   is

 

 

 

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

 

 

 

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:

     
       
       
       

Any vector field   expressed in spherical coordinates has the form:  

Given an arbitrary position   that changes with time, the velocity of this position is:

 

The coefficient of   for the term   arises from the fact that as the latitudinal angle   changes, the position   traverses a great circle at a speed of  .

The coefficient of   for the term   arises from the fact that as the longitudinal angle   changes, the position   traverses a latitude circle at a speed of  .

Volume, path, and surface integrals

edit

Volume Integrals

edit

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

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

 

Path Integrals

edit

Given any oriented path   (oriented means that there is a preferred direction), the differential   denotes an infinitesimal displacement along   in the preferred direction. This differential can be used in various path integrals. Letting   denote an arbitrary scalar field, and   denote an arbitrary vector field, various path integrals include:

 ,  ,  ,  , and many more.

  denotes the total displacement along  , and   denotes the total length of  .

Calculating Path Integrals

edit

To compute a path integral, the continuous oriented curve   must be parameterized.   will denote the point along   indexed by   from the range  .   must be the starting point of   and   must be the ending point of  . As   increases,   must proceed along   in the preferred direction. An infinitesimal change in  ,  , results in the infinitesimal displacement   along  . In the path integral  , the differential   can be replaced with   to get  

Example 1

As an example, consider the vector field   and the straight line curve   that starts at   and ends at  .   can be parameterized by   where  .  . We can then evaluate the path integral   as follows:

 

 


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   is  

Example 2

Consider the gravitational field that surrounds a point mass of   located at the origin:   using Newton's inverse square law. The force acting on a point mass of   at position   is  . In spherical coordinates the force is   (note that   are the unit length mutually orthogonal basis vectors for spherical coordinates).

Consider an arbitrary path   that   traverses that starts at an altitude of   and ends at an altitude of  . The work done by the gravitational field is:

 

The infinitesimal displacement   is equivalent to the displacement expressed in spherical coordinates:  .

 

The work is equal to the amount of gravitational potential energy lost, so one possible function for the gravitational potential energy is   or equivalently,  .


Example 3

Consider the spiral   parameterized with respect to   in cylindrical coordinates by  . Consider the problem of determining the spiral's length with   restricted to the range  . An infinitesimal change of   in   results in the infinitesimal displacement:

 

The length of the infinitesimal displacement is  .

The length of the spiral is therefore:  



Surface Integrals

edit

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  , 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":  . If a vector field   denotes a flow density, then the flow through the infinitesimal surface portion in the preferred direction is  .

The infinitesimal "surface vector"   describes the infinitesimal surface element in a manner similar to how the infinitesimal displacement   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   and   that both start at point  , and end at point  . The total displacements,   and  , are both equivalent and equal to the displacement between   and  . Note however that the total lengths   and   are not necessarily equivalent.

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

The fact that the total surface vectors of   and   are equivalent is not immediately obvious. To prove this fact, let   be a constant vector field.   and   share the same boundary, so the flux/flow of   through   and   is equivalent. The flux through   is  , and similarly for   is  . Since   for every choice of  , it follows that  .

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  . It is then the case that:   is the area of the projection of   onto the yz-plane;   is the area of the projection of   onto the xz-plane; and   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.

Example 1

Consider the Cartesian points  ;  ;  ; and  .

Let   be the surface formed by the triangular planes  ;  ; and   where the vertices are listed in a counterclockwise direction relative to the surface normal directions. The surface vectors of each plane are respectively  ;  ; and   respectively which add to a total surface vector of  .

Let   be the surface formed by the single triangular plane   where the vertices are listed in a counterclockwise direction relative to the normal direction. It can be seen that   and   share a the common counter clockwise boundary  The surface vector is   which is equivalent to  .


Example 2

This example will show how moving a point that is in the interior of a "triangular mesh" does not affect the total surface vector. Consider the points   where  . Let the closed path   be defined by the cycle  . For simplicity,  . For each  ,   will denote the displacement of   relative to  . Like with  ,  .

Let   denote a surface that is a "triangular mesh" comprised of the closed fan of triangles:  ;  ; ...;  ;   where the vertices of each triangle are listed in a counterclockwise direction. It can be seen that the counterclockwise boundary of   is   and does not depend on the location of  . The total surface vector for   is:

 

Now displace   by   to get  . The displacement vector of   relative to   becomes  . The counterclockwise boundary is unaffected. The total surface vector is:

 

 

Therefore moving the interior point   neither affects the boundary, nor the total surface vector.



Calculating Surface Integrals

edit

To calculate a surface integral, the oriented surface   must be parameterized. Let   be a continuous function that maps each point   from a two-dimensional domain   to a point in  .   must be continuous and onto. While   does not necessarily have to be one to one, the parameterization should never "fold back" on itself. The infinitesimal increases in   and   are respectively   and  . These respectively give rise to the displacements   and  . Assuming that the surface's orientation follows the right hand rule with respect to the displacements   and  , the surface vector that arises is  .

In the surface integral  , the differential   can be replaced with   to get  .

Example 3

Consider the problem of computing the surface area of a sphere of radius  .

Center the sphere   on the origin, and using   and   as the parameter variables, the sphere can be parameterized in spherical coordinates via   where   and  . The infinitesimal displacements from small changes in the parameters are:

  causes  

  causes  

The infinitesimal surface vector is hence  . While not important to this example, note how the parameterization was chosen so that the surface vector points outwards. The area is  .

The total surface area is hence:

 


The Gradient and Directional Derivatives

edit

Given a scalar field   that denotes a potential, and given a curve  , a commonly sought after quantity is the rate of change in   as   is being traversed. Let   be an arbitrary parameter for  , and let   denote the point indexed by  . Given an arbitrary   which corresponds to the point  , then using the chain rule gives the following expression for the rate of increase of   at  ,  :

 

where   is a vector field that denotes the "gradient" of  , and   is the unnormalized tangent of  .

If   is an arc-length parameter, i.e.  , 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

edit

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   denote an arbitrary continuous path that starts at point   and ends at point  . Given an infinitesimal path segment   with endpoints   and  , let   be an arbitrary point in  .   denotes the infinitesimal displacement denoted by  . The increase in   along   is:

 

The relative error in the approximations vanish as  . Adding together the above equation over all infinitesimal path segments of   yields the following path integral equation:

 

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

The gradient in cylindrical coordinates

edit

Let   be a scalar field that denotes a potential and a curve   that is parameterized by  :  . Let the rate of change in   be quantified by the vector  . The rate of change in   is:

 

Therefore in cylindrical coordinates, the gradient is:  

The gradient in spherical coordinates

edit

Let   be a scalar field that denotes a potential and a curve   that is parameterized by  :  . Let the rate of change in   be quantified by the vector  . The rate of change in   is:

 

Therefore in spherical coordinates, the gradient is:  

The Directional Derivative

edit

Given a scalar field   and a vector  , scalar field   computes the rate of change in   at each position   where the velocity of   is  . Scalar field   can also be expressed as  . Velocity   can also be a vector field   so   depends on the position  . Scalar field   becomes  .

In Cartesian coordinates where   the directional derivative is:

 

In cylindrical coordinates where   the directional derivative is:

 

In spherical coordinates where   the directional derivative is:

 

What makes the discussion of directional derivatives nontrivial is the fact that   can instead be a vector field  . Vector field   computes   at each position   where  .

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  , then  

In cylindrical coordinates,   and  

In spherical coordinates,  , and  , and  

Full Expansions

In Cartesian coordinates where   and   the directional derivative is:

     

In cylindrical coordinates where   and   the directional derivative is:

   

 

 

In spherical coordinates where   and   the directional derivative is:

   

     

     


The Divergence and Gauss's Divergence Theorem

edit

Let   denote a vector field that denotes "flow density". For any infinitesimal surface vector   at position  , the flow through   in the preferred direction is  .   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   ( ,  , and  ) that is centered on position  , the outwards flow through the surface   is:

       

     

 

 

All relative errors vanish as  .

  is the "divergence" of   and is the density of "flow generation" at  . As noted above, the total outwards flow through   is the total flow generated inside of  , which gives Gauss's divergence theorem:

 

 
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

edit

Let   denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of  , consider an infinitesimal volume   defined by all points   where  ,  , and  . Note that   is not a rectangular prism. Let  ,  , and  . Let   be an arbitrary point from  .

The volume of   is approximately  . The 6 surfaces bounding   are described in the following table:

Surface approximate area direction approximate flow density
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        

The total outwards flow through the surface   of   is:

       

     

 

 

 

All relative errors vanish as  .

The divergence (flow generation density) is therefore:

 

a note about the approximations

A reader may wonder why the area of surface  ,  ,   is approximated by   instead of   since the difference between   and   approaches 0 as  . While the absolute difference between   and   approaches 0 as  , the difference relative to the infinitesimal   does not approach 0:  .

With respect to the surface  ,  ,  , the area can be approximated by  ,  , or   since   is already a factor, and the differences between  ,  , and   relative to the infinitesimal   do approach 0 as  .


The divergence in spherical coordinates

edit

Let   denote a vector field that denotes "flow density". In order to compute the divergence (flow generation density) of  , consider an infinitesimal volume   defined by all points   where  ,  , and  . Note that   is not a rectangular prism. Let  ,  , and  . Let   be an arbitrary point from  .

The volume of   is approximately  . The 6 surfaces bounding   are shown in the following table:

Surface approximate area direction approximate flow density
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        
 ,  ,        

The total outwards flow through the surface   of   is:

 

 

 

 

 

 

 

 

All relative errors vanish as  

The divergence (flow generation density) is therefore:

 


Divergence free vector fields

edit

A vector field   for which   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   and   are two surfaces which share the same counterclockwise oriented boundary  , then  . In other words, the flux is purely a function of  . This property can be derived from Gauss's divergence theorem as follows:

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

Gauss's divergence theorem states that  . The flux through   is the flux through   minus the flux through  :    . Therefore:

   

The Laplacian Operator

edit

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

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

In Cartesian coordinates, the Laplacian is:

 

In cylindrical coordinates, the Laplacian is:

 

In spherical coordinates, the Laplacian is:

 

The Laplacian and Vector fields

edit

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  

Given scalar field   and vector field  , then  

In cylindrical coordinates,   and  

In spherical coordinates,  , and  , and  

Full Expansions

In Cartesian coordinates where  , the Laplacian is:

 

In cylindrical coordinates where  , the Laplacian is:

 

     

     

 


The Curl and Stokes' Theorem

edit

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

The path integral   for a closed curve   is the "circulation" of   around  . Stokes' theorem will show that the circulation around   is the total circulation accumulated in the interior of  .

Green's Theorem

edit
 
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   that is confined to 2 dimensions,   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   is the sum of the circulations around each infinitesimal loop.

 
An infinitesimal rectangular loop.

Consider the infinitesimal rectangle  . Let   be an arbitrary point inside the rectangle, let   and  , and let   be the counterclockwise boundary of  .

The circulation around   is approximately (the relative error vanishes as  ):

         

As  , the relative errors present in the approximations vanish, and therefore, for an infinitesimal rectangle,  

  is the "circulation density" at  . Let   be a counter-clockwise oriented loop with interior  . The circulation around loop   is the total circulation contained by  :  . This is Green's theorem.

Stokes' Theorem

edit

Stokes' Theorem is effectively a generalization of Green's theorem to 3 dimensions, and the "curl" is a generalization of the quantity   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  . Green's theorem gives:

 

  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   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:

 

and

 

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

 

This is Stokes' theorem, and   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   for all continuous closed curves  .

The curl in cylindrical coordinates

edit

Let   denote an arbitrary vector field in cylindrical coordinates. By calculating the circulation densities in surfaces perpendicular to  ,  , and  , the curl can be computed:

   

The curl in spherical coordinates

edit

Let   denote an arbitrary vector field in spherical coordinates. By calculating circulation densities in surfaces perpendicular to  ,  , and  , the curl can be computed:

 

 


Irrotational vector fields

edit

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   and   are two continuous curves which share the same starting point   and end point  , then  . In other words, the gain is purely a function of   and  . This property can be derived from Stokes' theorem as follows:

Invert the orientation of   to get   and combine   and   to get a continuous closed curve  , linking the curves together at the endpoints   and  . Let   denote a surface for which   is the counterclockwise oriented boundary.

Stokes' theorem states that  . The gain around   is the gain along   minus the gain along  :    . Therefore:

   

Summary and Extensions

edit

In summary:

The gradient of a scalar field   is   which denotes the rate of change in   in each direction, at each point.
Given an oriented curve   which starts at   and ends at  , the increase in   along   is:   (the gradient theorem)
If a vector field   denotes "flow density", then the divergence is   which denotes the density of "flow generation" at each point.
Given a volume   with outwards oriented surface  , the total flow being generated inside   is:   (Gauss's divergence theorem)
The curl of a vector field   is   which denotes the "circulation density" at each point.
Given an oriented surface   with a counter-clockwise oriented boundary  , the total circulation present in   is:   (Stokes' theorem)


Extending the gradient theorem

edit

The gradient theorem states that given an everywhere differentiable scalar field   and a continuous oriented curve   with endpoints   and  , that  . 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   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  . The volume integral of   over   is:  . Let   and   be the infinitesimal surface portions of   formed when   intersects   at   and   respectively. The x-component of   and   is   and   respectively. Adding up all possible line segments   gives:

  where   is the x-component of the differential  .

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

  where   is the y-component of the differential  .

  where   is the z-component of the differential  .

This yields:

 

and hence:

 

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


Extending Stokes' Theorem

edit

Stokes' theorem states that given an everywhere differentiable vector field   and an oriented surface   with counterclockwise boundary  , that  . 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   be arbitrary, and let   be the cross-section of   in the plane  . Let   be the counter-clockwise boundary of   (the surface normal vectors of   point in the positive x-direction). Green's theorem gives:

 

Now let the cross-section   have an infinitesimal thickness  , forming the volume slice  . Let   denote the infinitesimal strip of   that wraps the cross-section (  is similar to   except that   is a surface with a non-zero infinitesimal width). Let   be an infinitesimal portion of  . Ignoring the component of   that is parallel to  ,   denotes a thin strip of surface that wraps around  , and is parallel to the x-axis. The counterclockwise displacement   along the boundary of   manifested by   is  . Substituting into the path integral around   gives:

 

 

Integrating over all cross-sections gives:

 

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

 

 

This yields:

   

 

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