Differentiation in several variables · Definition
Gradient
Before you start you need to know
It turns the information of several partial derivatives into a single arrow that tells where to climb and how steep the terrain is.
Definition
The gradient \(\nabla f\) of a differentiable function \(f\) is the vector that collects its partial derivatives at a point; it points where \(f\) increases fastest.
The gradient appears when the differential is written as a dot product: \(df=\nabla f\cdot\langle dx,dy\rangle\). Hence, for a unit direction \(\mathbf{u}\), the rate of change is \(\nabla f\cdot\mathbf{u}=|\nabla f|\cos\theta\), with \(\theta\) the angle between them. It is maximal, equal to \(|\nabla f|\), when \(\mathbf{u}\) points along the gradient; minimal, \(-|\nabla f|\), in the opposite sense; and zero in the perpendicular directions.
This explains the relation with level curves: along one of them \(f\) does not change, so the gradient is perpendicular to its tangent. For \(f=x^2+y^2\) at \((1,1)\), \(\nabla f=\langle2,2\rangle\) is normal to the circle \(x^2+y^2=2\) there. With that normal one writes the tangent line to a curve \(f(x,y)=c\): \(f_x(x-a)+f_y(y-b)=0\). In three variables the same argument gives the tangent plane to a level surface.
The gradient is defined the same way with three or more variables, as the vector of all partials: for \(f=xyz\), \(\nabla f=\langle yz,xz,xy\rangle\). Where it is the zero vector, the tangent plane is horizontal and the point is a candidate for a maximum, minimum or saddle.
A common mistake is to treat \(\nabla f\) as a number: it is a vector, and the direction of fastest increase requires normalizing it. Its immediate application is the directional derivative, which comes next.
Think about it
A hiker stands where \(|\nabla h|=0.2\) (height \(h\)). What is the maximum slope and in which direction does it occur?
The maximum slope is \(0.2\) (it rises 20 cm per horizontal meter), in the direction of the gradient of \(h\); in the perpendicular directions the hiker walks at constant height.
Exercises 10
- Compute \(\nabla f(1,2)\) for \(f(x,y)=x^2y\).
- Compute \(\nabla f(2,0)\) for \(f(x,y)=xe^{y}\).
- Compute \(\nabla f(1,2,3)\) for \(f(x,y,z)=xyz\).
- Compute \(\nabla f(1,1)\) for \(f(x,y)=\ln(x^2+y^2)\).
- For \(f(x,y)=x^2+y^2\) at \((3,4)\), what is the maximum rate of change of \(f\)?
- In which unit vector direction does \(f(x,y)=xy\) increase fastest from \((2,3)\)?
- The level curve of \(f(x,y)=x^2+y^2\) through \((1,1)\) has a tangent vector there. Which one?
- If \(\nabla f(P)=\mathbf{0}\) and \(f\) is differentiable, what can be said at \(P\)?
- Find the tangent line to the curve \(x^2+4y^2=8\) at the point \((2,1)\).
- The temperature is \(T(x,y)=x^2y\). From \((1,1)\), toward which unit vector does it decrease fastest?
References
- James Stewart, Daniel K. Clegg, Saleem Watson, Calculus: Early Transcendentals, 9th edition, Cengage, 2021. §14.6
- Joel Hass, Christopher Heil, Przemyslaw Bogacki, Maurice D. Weir, George B. Thomas Jr., Thomas' Calculus, 15th edition, Pearson, 2023. §14.5
- Jerrold E. Marsden, Anthony Tromba, Vector Calculus, 6th edition, W. H. Freeman, 2012. §2.6