Gradient Field of sin(x)cos(y): Direction of Steepest Ascent

Interactive Gradient Field of sin(x)cos(y): Direction of Steepest Ascent graph — click to explore
Click the graph to explore it interactively →
Question: Show the 2D vector field of \(f(x,y) = \sin(x) \cos(y)\) with arrows pointing in the direction of steepest ascent.
To visualize the direction of steepest ascent for the scalar field f(x,y) = \sin(x) \cos(y), we use the Gradient Vector Field. The gradient, denoted by \nabla f, at any point (x,y) is a vector that points in the direction where the function increases most rapidly.

Mathematical Derivation

The gradient is defined as the vector of partial derivatives: \begin{align*} \nabla f(x,y) &= \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right) \\ \frac{\partial}{\partial x} [\sin(x) \cos(y)] &= \cos(x) \cos(y) \\ \frac{\partial}{\partial y} [\sin(x) \cos(y)] &= -\sin(x) \sin(y) \\ \nabla f(x,y) &= \langle \cos(x) \cos(y), -\sin(x) \sin(y) \rangle \end{align*}

Visual Interpretation

In the provided diagram, you can explore how these vectors behave across the coordinate plane:
  • Vector Field (Blue Arrows): These arrows represent the gradient at various points on a grid. Notice that they always point towards local "peaks" (maxima) and away from local "valleys" (minima).
  • Contours (Gray Curves): These are the level curves where f(x,y) is constant. A fundamental property of the gradient is that it is always perpendicular to the level curves.
  • Probe Point P (Red): You can drag point P to see the specific gradient vector at that location.
  • Magnitude: The arrows are longest where the surface is steepest and shrink to a single point at critical points (maxima, minima, and saddle points), where the gradient is zero.
The function forms a periodic "checkerboard" of hills and depressions. For instance, at (\frac{\pi}{2}, 0), the function reaches a maximum value of 1. As you move P near this point, you will see all surrounding gradient vectors pointing directly toward it.