Skip to main content
Mathematics LibreTexts

Vector Fields

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    We have now seen many types of functions. They are characterized by the domain and the range. Below is a list of some of the functions that we have encountered so far.

    Domain Range Name
    \(\mathbb{R}\) \(\mathbb{R}\) One variable Function
    \(\mathbb{R}\) \(\mathbb{R}^2\) Parametric Equations
    \(\mathbb{R}^2\) \(\mathbb{R}\) Function of 2 Variables
    \(\mathbb{R}\) Vectors Vector Valued Function

    By letting the domain be \(\mathbb{R}^n\) and the range be n-dimensional vectors, we get a new type of functions called a vector field.

    Definition: Vector Field

    A vector field is be a function where the domain is \(\mathbb{R}^n\) and the range is \(n\)-dimensional vectors.

    Example \(\PageIndex{1}\)

    An important vector field that we have already encountered is the gradient vector field. Let \(f(x,y)\) be a differentiable function. Then the function that takes a point \(x_0,y_0\) to \(\nabla f(x_0,y_0)\) is a vector field since the gradient of a function at a point is a vector. For example, if

    \[f(x,y) = 0.1xy - 0.2y\nonumber \]


    \[\nabla f(x,y) = 0.1y\hat{\textbf{i}} + (0.1x - 0.2) \hat{\textbf{j}} \nonumber \]

    The sketch of the gradient is pictured below.


    The best way to sketch a vector field is to use the help of a computer, however it is important to understand how they are sketched. For this example, we pick a point, say \((1,2)\) and plug it into the vector field

    \[\nabla f(1,2) = 0.2 \hat{\textbf{i}} - 0.2 \hat{\textbf{j}} \nonumber \]

    Next, sketch the vector that begins at \((1,2)\) and ends at \((1 + .2, .2 - .1)\). Notice that when we sketch vector fields, we use the definition that involves two points rather than the definition that assumes all vectors emanate from the origin.

    Example \(\PageIndex{2}\)

    In physics, many vector fields satisfy the inverse square law. A vector field \(\textbf{F}\) satisfying the inverse square law has the property that if

    \[\textbf{r} = x \hat{\textbf{i}} + y \hat{\textbf{j}} + z \hat{\textbf{k}} \nonumber \]

    and u is the unit vector in the direction of r (\(\textbf{u} = \frac{r}{||r||}\)), then

    \[F(x,y,z)= \dfrac{k}{||r||^2}u \nonumber \]

    Examples of force fields that satisfy the inverse square law are gravitational force fields and electric force fields. Below is a plot of a vector field that satisfies the inverse square law.


    Notice that as the distance from the origin gets small, the vector become small quickly. For gravity, this tells us that as we fly away from the earth, we experience less gravity, until it seems like weightlessness.

    Other examples of vector fields that occur in nature include velocity fields. For example, the currents in the ocean ensure movement of the water. The if we sketch the velocity vector of at each point of the ocean, we get a vector field. A similar velocity field is produced from wind in the atmosphere.

    Conservative Vector Fields

    Our first and most important example was the gradient vector field. Can we go backwards? That is, given a vector field \(\textbf{F}\), can we construct a function \(f\) with the property that

    \[\textbf{F}= \nabla f \nonumber \]

    The answer to this question is only for some very special vector fields, which we call conservative.

    Definition: Conservative Vector Field

    Let \(\textbf{F}\) be a vector field. Then \(\textbf{F}\) is called conservative if there is a differentiable function \(f\) such that

    \[\nabla f = \textbf{F} \nonumber \]

    \(f\) is called the potential function for \(\textbf{F}\).

    Fortunately, we do not need to flounder about to determine if a vector field \(\textbf{F}\) is conservative; we use the following argument:


    \[\textbf{F}= \langle M,N \rangle \nonumber \]

    is conservative, then

    \[ \langle M,Q \rangle = \nabla f = \langle f_x,f_y \rangle \nonumber \]

    So that

    \[M = f_x \label{eq1A}\]


    \[N=f_y \label{eq1B} \]

    Now take partial derivatives with respect to \(y\) of Equation \ref{eq1A} and with respect to \(x\) of Equation \ref{eq1B} to get

    \[M_y=f_{xy}\nonumber \]


    \[N_x = f_{yx} \nonumber \]

    Since mixed partial derivative are the same (for nice functions) we get

    \[M_y=N_x \nonumber \]

    This turns out to be both a necessary and sufficient condition for a vector field to be conservative.

    Theorem: Testing of Conservativeness

    If \(M\) and \(N\) have continuous first order partial derivatives, then the vector field

    \[\textbf{F} = M \hat{\textbf{i}} + N \hat{\textbf{j}} \nonumber \]

    is conservative if and only if

    \[M_y = N_x \nonumber \]

    Example \(\PageIndex{3}\)

    Determine which of the two vector fields are conservative

    1. \(\textbf{F}= 3xy \hat{\textbf{i}}- x^2 \hat{\textbf{j}} \)
    2. \(\textbf{G}=(1+2xy) \hat{\textbf{i}}+ (x^2-2) \hat{\textbf{j}} \)


    For part A. we find

    \[M_y=3x \;\;\; \text{and} \;\;\; N_x=-2x\nonumber \]

    Since they are not equal the vector field is not conservative.

    For part B. we find

    \[M_y=2x \;\;\; \text{and} \;\;\; N_x=2x\nonumber \]

    They are equal, so the vector field is conservative.

    Once we know that a vector field is conservative, how do we find the potential function? We investigate the relations

    \[M=f_x \;\;\; \text{and} \;\;\; N=f_y\nonumber \]

    Example \(\PageIndex{4}\)

    Find the potential function for the conservative vector field in the last example

    \[\textbf{G}=( 1+2xy) \hat{\textbf{i}}+ (x^2-2) \hat{\textbf{j}} \nonumber \nonumber \]


    We have

    \[M=1+2xy=f_x\nonumber \]

    Integrating both sides with respect to \(x\) we get

    \[x+x^2y+c(y)=f(x,y)\nonumber \]

    Notice that the constant of integration may involve \(y\) terms since we are treating \(y\) as a constant. Now differentiate with respect to \(y\) to get

    \[x^2+c'(y)=f_y=N=x^2-2\nonumber \]


    \[c'(y) = -2\nonumber \]

    Integrating with respect to \(y\), we get

    \[c(y) = -2y\nonumber \]

    We do not need a constant of integration here since we just want "a" potential function not the general potential function. Putting it all together, we get the potential function

    \[f(x,y)=x+x^2y-2y \nonumber \]

    The Curl of a Vector Field

    If \(\textbf{F}\) is a vector field then we want to look at what operation we can do to it. One such operation is called the Curl of \(\textbf{F}\). We define it as follows.

    Definition: Curl of a Vector Field

    If \(\textbf{F}\) is a differentiable vector field with

    \[\textbf{F} = M \hat{\textbf{i}}+N \hat{\textbf{j}}+P\hat{\textbf{k}} \nonumber \]


    \[\begin{align*} Curl \; \textbf{F} &= \nabla \times \textbf{F} \\ &= \begin{vmatrix} \hat{\textbf{i}} & \hat{\textbf{j}} & \hat{\textbf{k}} \\ \partial x &\partial y &\partial z \\ M &N &P \end{vmatrix} \\ &=(P_y-N_z) \hat{\textbf{i}} -(P_x-M_z) \hat{\textbf{j}}+(N_x-M_y) \hat{\textbf{k}} \end{align*}\nonumber \]

    Notice that for a two dimensional vector field, where there is only a k component for a cross product, that if the curl is zero then the vector field field is conservative; actually more is true. Remembering that all second order partial derivatives are independent of order for nice functions, we have

    Theorem: The curl of a conservative vector field

    Let \(\textbf{F}\) be a three dimensional differentiable vector field with continuous partial derivatives. Then

    \[Curl \; \textbf{F} =0 \nonumber \]

    if and only if \(\textbf{F}\) is conservative.

    Example \(\PageIndex{5}\)

    Determine if the vector field

    \[\textbf{F}=yz^2 \hat{\textbf{i}} +(xz^2+2) \hat{\textbf{j}} + (2xyz-1) \hat{\textbf{k}} \nonumber \]

    is conservative. If it is, find a potential function.


    We calculate

    \[\begin{align*} Curl \textbf{F} &= \begin{vmatrix} \hat{\textbf{i}} & \hat{\textbf{j}} & \hat{\textbf{k}} \\ \partial x & \partial y & \partial z \\ yz^2 &xz^2 &2xyz-1 \end{vmatrix} \\ &= (2xz-2xz) \hat{\textbf{i}} - (2yz-2yz) \hat{\textbf{j}} +(z^2-z^2) \hat{\textbf{k}} \\ &=0 \end{align*}\nonumber \]

    The vector field is conservative. Now equate

    \[f_x = yz^2 \nonumber \]

    and integrate to get

    \[f=xyz^2+c(y,z) \nonumber \]

    Notice the constant now depends on both \(y\) and \(z\), since they were held constant when we integrated. Now take a partial with respect to \(y\) to get

    \[xz^2=f_y=xz^2+2 \nonumber \]


    \[c_y(y,z)=2 \nonumber \]

    Integrate with respect to \(y\) to get

    \[c(y,z) = 2y + c(z)\nonumber \]

    Notice that \(z\) is the only "constant" remaining. We get

    \[f=xyz^2+2y+c(z) \nonumber \]

    Now take a derivative with respect to z to get

    \[2xyz + c'(z) = f_z = 2xyz - 1\nonumber \]

    so that

    \[c'(z) = -1\nonumber \]

    finally integrate to get

    \[c(z) = -z\nonumber \]

    The potential function is

    \[f(x,y,z) = xyz^2 + 2y - z\nonumber \]

    The Divergence of a Vector Field

    The curl of a vector field was defined as the cross product of the "dell" operator with the vector field. A curious student may try to take a dot product instead and see where it leads.

    Definition: The Divergence of a Vector Field

    If F is a differentiable vector field with

    \[\textbf{F}=M \hat{\textbf{i}}+N \hat{\textbf{j}}+P \hat{\textbf{k}} \nonumber \]


    \[div \; \textbf{F}=\nabla \cdot \textbf{F} = M_y+N_y+P_z \nonumber \]

    Notice that the curl of a vector field is a vector field, while the divergence of a vector field is a real valued function.

    Example \(\PageIndex{6}\)

    Find the divergence of the vector field

    \[\textbf{F}=(x-3y) \hat{\textbf{i}} +(x^2z^2+\cos(z^2)) \hat{\textbf{j}}+(xyz^2) \hat{\textbf{k}} \nonumber \]


    We just take the three partial derivatives and add them up

    \[ (1) + (0) + (2xyz) = 1 + 2xyz\nonumber \]

    Contributors and Attributions

    Vector Fields is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.