Vector Fields

A vector field assigns a vector to every point in a region. In the plane it has the form F(x, y) = ⟨P(x, y), Q(x, y)⟩, and in space F(x, y, z) = ⟨P, Q, R⟩. Vector fields model wind, water currents and forces. You sketch one by drawing the vector F at many points, each arrow starting at its point.

Before this lesson: Vectors in 3D, Partial Derivatives and Directional Derivatives

What a vector field is

A function of several variables gives one number at each point, like the temperature on a map. A vector field gives one arrow at each point, like the wind on a weather map: the arrow shows the direction of the wind, and its length shows the speed.

The components P and Q are ordinary functions of x and y. To find the vector at a point, plug the point into P and Q. The arrow for F(a, b) is drawn with its tail at (a, b), not at the origin.

Two grids from −2 to 2 in x and y. Left: the field F = ⟨−y, x⟩. At each grid point a navy arrow points counterclockwise around the origin, at right angles to the line from the origin, and arrows farther from the origin are longer. Right: the gradient field of f(x, y) = x² + 3y², drawn with arrows of equal length to show direction only. Three gray ellipses are level curves x² + 3y² = 1, 3 and 6. Every arrow points outward, at right angles to the ellipses, toward larger values of f.
Left: F = ⟨−y, x⟩ swirls counterclockwise (Example 1). Right: the gradient of x² + 3y² crosses every level curve at a right angle (Example 3).

Vector field and gradient field formulas

\mathbf{F}(x, y) = \langle P(x, y), Q(x, y) \rangle = P\,\mathbf{i} + Q\,\mathbf{j}
\mathbf{F}(x, y, z) = \langle P(x, y, z), Q(x, y, z), R(x, y, z) \rangle

The gradient field of a function f is the vector field made of its gradient vectors. It is one of the most important kinds of vector field.

\nabla f(x, y) = \langle f_x, f_y \rangle, \qquad \nabla f(x, y, z) = \langle f_x, f_y, f_z \rangle
  1. To sketch a vector field, pick a grid of points.
  2. At each point (a, b), compute F(a, b) = ⟨P(a, b), Q(a, b)⟩.
  3. Draw that vector with its tail at (a, b). Scale every arrow by the same factor so they don’t overlap.
  4. Look for patterns: where F is zero, where it is longest, and which way it turns.

Vector fields examples

Example 1: A rotation field

Find F(x, y) = ⟨−y, x⟩ at (1, 0), (0, 1), (−1, 0) and (2, 2), and describe the field.

\mathbf{F}(1, 0) = \langle -0, 1 \rangle = \langle 0, 1 \rangle

Substitute x = 1 and y = 0. The arrow at (1, 0) points up.

\mathbf{F}(0, 1) = \langle -1, 0 \rangle

Substitute x = 0 and y = 1. The arrow at (0, 1) points left.

\mathbf{F}(-1, 0) = \langle 0, -1 \rangle

Substitute x = −1 and y = 0. The arrow points down.

\mathbf{F}(2, 2) = \langle -2, 2 \rangle

Substitute x = 2 and y = 2. The arrow points up and to the left.

\langle -y, x \rangle \cdot \langle x, y \rangle = -xy + xy = 0

Dot F with the position vector ⟨x, y⟩. The dot product is 0.

|\mathbf{F}| = \sqrt{y^2 + x^2}

Find the length of each arrow.

Answer: every arrow is perpendicular to the line from the origin, so the field swirls counterclockwise in circles. Each arrow is as long as its distance from the origin, so the swirl is faster farther out. At (2, 2) the length is √8 ≈ 2.83.

Example 2: A field that depends only on x

Describe the vector field F(x, y) = ⟨1, x⟩.

\mathbf{F}(0, y) = \langle 1, 0 \rangle

On the y-axis, every arrow points straight right.

\mathbf{F}(1, y) = \langle 1, 1 \rangle

On the line x = 1, every arrow points up at 45°.

\mathbf{F}(-2, y) = \langle 1, -2 \rangle

On the line x = −2, every arrow points steeply down.

\dfrac{Q}{P} = \dfrac{x}{1} = x

The slope of each arrow is Q/P.

Answer: the arrows at (x, y) have slope x, and all arrows on a vertical line are the same. This is the slope field of dy/dx = x, drawn with arrows. Curves that follow the arrows are the parabolas y = x²/2 + C.

Example 3: A gradient field

Find the gradient field of f(x, y) = x² + 3y². Show that ∇f(1, 1) is perpendicular to the level curve of f through (1, 1).

\nabla f = \langle 2x, 6y \rangle

Take the partial derivatives f_x = 2x and f_y = 6y.

\nabla f(1, 1) = \langle 2, 6 \rangle

Substitute x = 1 and y = 1.

x^2 + 3y^2 = 4

The level curve through (1, 1): f(1, 1) = 1 + 3 = 4.

2x + 6y\dfrac{dy}{dx} = 0

Differentiate the level curve with implicit differentiation.

\dfrac{dy}{dx} = -\dfrac{2x}{6y} = -\dfrac{1}{3}

Solve and substitute (1, 1).

\langle 3, -1 \rangle

A tangent vector with slope −1/3.

\langle 2, 6 \rangle \cdot \langle 3, -1 \rangle = 6 - 6 = 0

Take the dot product.

Answer: ∇f = ⟨2x, 6y⟩, and ∇f(1, 1) = ⟨2, 6⟩ is perpendicular to the ellipse x² + 3y² = 4. Gradient vectors always cross level curves at right angles and point toward larger values of f, as in directional derivatives.

Example 4: A gradient field in space

Find the gradient field of f(x, y, z) = xyz² and evaluate it at (1, 2, −1). Find the length of that vector.

f_x = yz^2, \quad f_y = xz^2, \quad f_z = 2xyz

Take the three partial derivatives.

\nabla f = \langle yz^2, xz^2, 2xyz \rangle

Write the gradient field.

\nabla f(1, 2, -1) = \langle 2(1), 1(1), 2(1)(2)(-1) \rangle

Substitute. Note that z² = 1.

= \langle 2, 1, -4 \rangle

Simplify.

|\nabla f| = \sqrt{4 + 1 + 16} = \sqrt{21}

Find the length (see magnitude of a vector).

Answer: ∇f(1, 2, −1) = ⟨2, 1, −4⟩, with length √21 ≈ 4.58. That is the fastest rate of increase of f at that point.

Example 5: Water speed in a channel

A straight canal is 10 m wide, with banks at y = −5 and y = 5. The water velocity is F(x, y) = ⟨0.08(25 − y²), 0⟩ in meters per second. Find the speed in the middle and 3 m from the middle. Where is the speed 1 m/s?

\mathbf{F}(x, 0) = \langle 0.08(25), 0 \rangle = \langle 2, 0 \rangle

Substitute y = 0. The speed in the middle is 2 m/s.

\mathbf{F}(x, 3) = \langle 0.08(25 - 9), 0 \rangle

Substitute y = 3.

= \langle 1.28, 0 \rangle

Multiply: 0.08 · 16.

0.08(25 - y^2) = 1

Set the speed equal to 1.

25 - y^2 = 12.5

Divide both sides by 0.08.

y^2 = 12.5

Subtract 25 and multiply by −1.

y = \pm\sqrt{12.5} \approx \pm 3.54

Take square roots.

Answer: the water moves 2 m/s in the middle and 1.28 m/s at 3 m from the middle. The speed is 1 m/s about 3.54 m from the middle, on either side. At the banks the speed is 0, and every arrow points in the +x direction, downstream.

Common mistakes

MistakeExample of the errorFix
Drawing every arrow from the originDrawing F(2, 2) = ⟨−2, 2⟩ as an arrow from (0, 0) to (−2, 2)The tail of F(a, b) goes at the point (a, b).
Swapping the componentsTaking F(0, 1) = ⟨0, −1⟩ for F = ⟨−y, x⟩P goes first and Q second: F(0, 1) = ⟨−1, 0⟩.
Confusing f with ∇fWriting the gradient field of x² + 3y² as x² + 3y²A gradient field is a vector of partial derivatives: ⟨2x, 6y⟩.
Arrows so long they overlapDrawing ⟨2, 6⟩ at full size on a grid with spacing 1Shrink every arrow by the same factor, or draw equal lengths and state that only the direction is shown.
Assuming every field is a gradient fieldLooking for f with ∇f = ⟨−y, x⟩No such f exists: a gradient field ⟨P, Q⟩ needs P_y = Q_x, but here −1 ≠ 1.

Related methods

Testing for a gradient field

If F = ⟨P, Q⟩ = ∇f with smooth f, then P_y = f_xy and Q_x = f_yx are equal. So if P_y ≠ Q_x, F is not a gradient field. A gradient field is also called a conservative field, and the lesson on conservative vector fields shows how to find f.

Flow lines

A flow line is a curve whose tangent vector at every point is the field vector there. For F = ⟨−y, x⟩ the flow lines are circles around the origin. Finding flow lines means solving the differential equation dy/dx = Q/P.

Radial and inverse-square fields

The field F = ⟨x, y⟩ points straight away from the origin. Gravity and electric force fields point toward or away from a center and get weaker with distance, with length proportional to 1/r².

Practice problems

  1. Find F(2, 1) for F(x, y) = ⟨x − y, x + y⟩, and find its length.
  2. Find F(−1, 3) for F(x, y) = ⟨y², x⟩.
  3. Find the gradient field of f(x, y) = x³y.
  4. Find ∇f(0, π/2) for f(x, y) = eˣ sin y.
  5. Find the gradient field of f(x, y) = ln(x² + y²) and evaluate it at (1, 1).
  6. Find F(1, −2, 3) for F(x, y, z) = ⟨yz, xz, xy⟩, and find its length.
  7. Show that F(x, y) = ⟨2xy, x² + 1⟩ is the gradient field of f(x, y) = x²y + y.
  8. Show that F(x, y) = ⟨y, −x⟩ is not a gradient field.
  9. Where is F(x, y) = ⟨x − 2, y + 1⟩ equal to the zero vector? Describe the field.
  10. The wind velocity over a field, in km/h, is F(x, y) = ⟨12, 0.5x⟩, with x in km east of a weather station. Find the wind speed and its direction at x = 10.
Show answers

1.

\mathbf{F}(2, 1) = \langle 2 - 1, 2 + 1 \rangle

Substitute x = 2 and y = 1.

= \langle 1, 3 \rangle

Simplify.

|\mathbf{F}| = \sqrt{1 + 9} = \sqrt{10}

Find the length.

Answer: ⟨1, 3⟩, length √10 ≈ 3.16

2.

\mathbf{F}(-1, 3) = \langle 3^2, -1 \rangle

Substitute x = −1 and y = 3.

= \langle 9, -1 \rangle

Simplify.

Answer: ⟨9, −1⟩

3.

f_x = 3x^2y, \quad f_y = x^3

Take the partial derivatives.

\nabla f = \langle 3x^2y, x^3 \rangle

Write the gradient field.

Answer: ⟨3x²y, x³⟩

4.

\nabla f = \langle e^x\sin y, e^x\cos y \rangle

Take the partial derivatives.

\nabla f\Big(0, \dfrac{\pi}{2}\Big) = \langle 1 \cdot 1, 1 \cdot 0 \rangle = \langle 1, 0 \rangle

Substitute: e⁰ = 1, sin(π/2) = 1, cos(π/2) = 0.

Answer: ⟨1, 0⟩

5.

f_x = \dfrac{2x}{x^2 + y^2}, \quad f_y = \dfrac{2y}{x^2 + y^2}

Take the partial derivatives with the chain rule.

\nabla f(1, 1) = \Big\langle \dfrac{2}{2}, \dfrac{2}{2} \Big\rangle = \langle 1, 1 \rangle

Substitute x = 1 and y = 1.

Answer: ⟨2x/(x² + y²), 2y/(x² + y²)⟩; at (1, 1) it is ⟨1, 1⟩.

6.

\mathbf{F}(1, -2, 3) = \langle (-2)(3), (1)(3), (1)(-2) \rangle

Substitute x = 1, y = −2, z = 3.

= \langle -6, 3, -2 \rangle

Multiply.

|\mathbf{F}| = \sqrt{36 + 9 + 4} = \sqrt{49} = 7

Find the length.

Answer: ⟨−6, 3, −2⟩, length 7

7.

f_x = 2xy

Differentiate x²y + y with respect to x.

f_y = x^2 + 1

Differentiate with respect to y.

\nabla f = \langle 2xy, x^2 + 1 \rangle = \mathbf{F}

Compare with F.

Answer: ∇f = F, so F is a gradient field.

8.

P_y = \dfrac{\partial}{\partial y}(y) = 1

Differentiate P = y with respect to y.

Q_x = \dfrac{\partial}{\partial x}(-x) = -1

Differentiate Q = −x with respect to x.

P_y \ne Q_x

A gradient field would need these to be equal.

Answer: F is not a gradient field.

9.

x - 2 = 0, \quad y + 1 = 0

Set both components equal to 0.

(x, y) = (2, -1)

Solve each equation.

Answer: at (2, −1). Each arrow points from (2, −1) toward its own point, so the field points straight away from (2, −1) and gets longer with distance.

10.

\mathbf{F}(10, y) = \langle 12, 0.5(10) \rangle = \langle 12, 5 \rangle

Substitute x = 10.

|\mathbf{F}| = \sqrt{144 + 25} = \sqrt{169} = 13

Find the speed.

\tan\theta = \dfrac{5}{12} \Rightarrow \theta \approx 22.6^\circ

Find the angle above the east direction.

Answer: 13 km/h, toward about 22.6° north of east

Vector fields FAQ

What is a vector field in calculus?

It is a function that assigns a vector to each point of a region, such as F(x, y) = ⟨P, Q⟩. Examples are wind velocity, water flow, gravity and electric fields.

How do you sketch a vector field?

Choose a grid of points, compute F at each one, and draw the arrow with its tail at that point. Use the same scale for every arrow so the picture shows which vectors are longer.

What is a gradient field?

It is the vector field ∇f of a function f. Its arrows point in the direction where f increases fastest and cross the level curves of f at right angles.

Is every vector field a gradient field?

No. For example, ⟨−y, x⟩ is not, because ∂P/∂y = −1 and ∂Q/∂x = 1 differ. Gradient fields are exactly the conservative fields.

Summary

  • A vector field assigns a vector F(x, y) = ⟨P, Q⟩ or F(x, y, z) = ⟨P, Q, R⟩ to each point.
  • Draw F(a, b) with its tail at (a, b), with all arrows scaled the same way.
  • The gradient field of f is ∇f = ⟨f_x, f_y⟩ or ⟨f_x, f_y, f_z⟩.
  • Gradient vectors are perpendicular to level curves and point uphill.
  • If P_y ≠ Q_x, F is not a gradient field.

Previous lesson: Jacobians and Change of Variables

Next lesson: Line Integrals

Back to the Calculus 3 Index