Calculus · Unit 3 · Topic 14

Gradient: the direction of steepest increase.

Short answer

The gradient of a scalar field \(\phi(x, y, z)\) is the vector of its partial derivatives:

\[\nabla\phi = \frac{\partial\phi}{\partial x}\,\mathbf{i} + \frac{\partial\phi}{\partial y}\,\mathbf{j} + \frac{\partial\phi}{\partial z}\,\mathbf{k}\]

It points in the direction in which \(\phi\) increases fastest, its size is that greatest rate, and it is normal to the surface \(\phi = c\).

Engineering Calculus · Unit 3B Tech / BE Semester IBSc
01

Scalar fields and the gradient

Before you start: you'll need partial differentiation.

A scalar field gives a single number at every point in space: temperature in a room, height on a map, pressure in a pipe. We write it as \(\phi(x, y, z)\).

The del operator collects the three partial derivatives into one vector operator:

\[\nabla = \mathbf{i}\,\frac{\partial}{\partial x} + \mathbf{j}\,\frac{\partial}{\partial y} + \mathbf{k}\,\frac{\partial}{\partial z}\]

Gradient

\[\operatorname{grad}\phi = \nabla\phi = \frac{\partial\phi}{\partial x}\,\mathbf{i} + \frac{\partial\phi}{\partial y}\,\mathbf{j} + \frac{\partial\phi}{\partial z}\,\mathbf{k}\]

The gradient turns a scalar field into a vector field.

02

What the gradient tells you

Contour curves of f = x² + 2y² with gradient arrows that cross each contour at right angles, pointing outwards ∇f f = 2.4 f = 0.4
Contour lines of \(f = x^2 + 2y^2\), each joining points of equal value. At every point, \(\nabla f\) is perpendicular to the contour and points towards higher values: the steepest way uphill.
  • Direction: \(\nabla\phi\) points in the direction in which \(\phi\) increases fastest.
  • Size: \(|\nabla\phi|\) is that greatest rate of increase.
  • Normal to surfaces: \(\nabla\phi\) is perpendicular to the level surface \(\phi = c\) through the point. So the unit normal to a surface \(\phi(x, y, z) = c\) is \[\hat n = \frac{\nabla\phi}{|\nabla\phi|}\]

On a hill, the gradient of height points straight up the steepest slope, and it is at right angles to the contour lines on the map.

03

Useful results

Let \(\vec r = x\mathbf{i} + y\mathbf{j} + z\mathbf{k}\) be the position vector and \(r = |\vec r| = \sqrt{x^2 + y^2 + z^2}\).

ResultNote
\(\nabla(\phi\psi) = \phi\,\nabla\psi + \psi\,\nabla\phi\)product rule
\(\nabla f(r) = f'(r)\,\dfrac{\vec r}{r}\)for any function of \(r\) alone
\(\nabla r = \dfrac{\vec r}{r}\)a unit vector pointing away from the origin
\(\nabla r^n = n\,r^{n-2}\,\vec r\)so \(\nabla\dfrac{1}{r} = -\dfrac{\vec r}{r^3}\)

The first entry follows from \(\dfrac{\partial r}{\partial x} = \dfrac{x}{r}\), which you get by differentiating \(r^2 = x^2 + y^2 + z^2\).

04

Solved examples

Example 1: Gradient at a point

Easy

Find \(\nabla\phi\) and \(|\nabla\phi|\) at \((1, 2, 1)\) for \(\phi = x^2y + yz^2\).

  1. \(\phi_x = 2xy\), \(\phi_y = x^2 + z^2\), \(\phi_z = 2yz\).
  2. At \((1, 2, 1)\): \(\nabla\phi = 4\mathbf{i} + 2\mathbf{j} + 4\mathbf{k}\).
  3. \(|\nabla\phi| = \sqrt{16 + 4 + 16} = 6\).

Answer\(\nabla\phi = 4\mathbf{i} + 2\mathbf{j} + 4\mathbf{k}\), \(\;|\nabla\phi| = 6\)

Example 2: Gradient of a power of r

Medium

Show that \(\nabla r^n = n\,r^{n-2}\,\vec r\).

  1. \(\dfrac{\partial}{\partial x}r^n = n\,r^{n-1}\dfrac{\partial r}{\partial x} = n\,r^{n-1}\dfrac{x}{r} = n\,r^{n-2}\,x\). Similarly for \(y\) and \(z\).
  2. So \(\nabla r^n = n\,r^{n-2}(x\mathbf{i} + y\mathbf{j} + z\mathbf{k})\).

Answer\(\nabla r^n = n\,r^{n-2}\,\vec r\). With \(n = -1\): \(\nabla\dfrac{1}{r} = -\dfrac{\vec r}{r^3}\).

Example 3: Unit normal to a sphere

Easy

Find the unit normal to the surface \(x^2 + y^2 + z^2 = 9\) at \((1, 2, 2)\).

  1. \(\phi = x^2 + y^2 + z^2\), so \(\nabla\phi = (2x, 2y, 2z) = (2, 4, 4)\) at the point.
  2. \(|\nabla\phi| = \sqrt{4 + 16 + 16} = 6\).

Answer\(\hat n = \dfrac{1}{3}(\mathbf{i} + 2\mathbf{j} + 2\mathbf{k})\), which points straight out from the centre, as expected.

Example 4: Unit normal to another surface

Medium

Find the unit normal to \(xy + yz + zx = 3\) at \((1, 1, 1)\).

  1. \(\nabla\phi = (y + z,\; x + z,\; x + y) = (2, 2, 2)\) at the point.
  2. \(|\nabla\phi| = 2\sqrt 3\).

Answer\(\hat n = \dfrac{1}{\sqrt 3}(\mathbf{i} + \mathbf{j} + \mathbf{k})\)

Example 5: Angle between two surfaces

Exam level

Find the angle between the surfaces \(x^2 + y^2 + z^2 = 9\) and \(z = x^2 + y^2 - 3\) at the point \((2, -1, 2)\).

  1. The angle between surfaces is the angle between their normals. Check the point lies on both: \(4 + 1 + 4 = 9\) ✓ and \(4 + 1 - 3 = 2\) ✓.
  2. Surface 1: \(\nabla\phi_1 = (2x, 2y, 2z) = (4, -2, 4)\), with length 6.
  3. Surface 2: write it as \(x^2 + y^2 - z = 3\). \(\nabla\phi_2 = (2x, 2y, -1) = (4, -2, -1)\), with length \(\sqrt{21}\).
  4. \(\cos\theta = \dfrac{16 + 4 - 4}{6\sqrt{21}} = \dfrac{8}{3\sqrt{21}}\).

Answer\(\theta = \cos^{-1}\dfrac{8}{3\sqrt{21}} \approx 54.4^\circ\)

Example 6: Greatest rate of increase

Medium

In which direction does \(\phi = xyz^2\) increase fastest at \((1, 0, 3)\), and what is that rate?

  1. \(\nabla\phi = (yz^2,\; xz^2,\; 2xyz) = (0, 9, 0)\) at the point.

AnswerFastest increase along \(\mathbf{j}\), at the rate \(|\nabla\phi| = 9\).

Vipul Sir's tip

For a normal to a surface, first move everything to one side so the surface reads \(\phi(x, y, z) = \text{constant}\). Then the normal is simply \(\nabla\phi\). Forgetting to rearrange (as in Example 5) gives the wrong vector.

05

Common mistakes

1. Giving \(\nabla\phi\) as a number

The gradient of a scalar field is a vector. Its size \(|\nabla\phi|\) is a number.

2. Forgetting to normalise

A unit normal must be divided by \(|\nabla\phi|\).

3. Not rearranging the surface first

For \(z = x^2 + y^2 - 3\), use \(\phi = x^2 + y^2 - z\), not \(x^2 + y^2 - 3\).

4. Using an obtuse angle between surfaces

The angle between two surfaces is usually taken as the acute angle, so use \(|\cos\theta|\) if the dot product comes out negative.

06

How it's asked in exams

  • Find \(\nabla\phi\) at a point, and its magnitude.
  • Unit normal to a surface at a point.
  • Angle between two surfaces at a common point.
  • Prove a result such as \(\nabla r^n = n r^{n-2}\vec r\) or \(\nabla f(r) = f'(r)\dfrac{\vec r}{r}\).
  • Find \(\phi\) given \(\nabla\phi\) (see scalar potential).
07

Practice questions

Try each one on paper before you open the answer.

Q1Find \(\nabla\phi\) for \(\phi = x^3 + y^3 + z^3 - 3xyz\).

\(3(x^2 - yz)\mathbf{i} + 3(y^2 - zx)\mathbf{j} + 3(z^2 - xy)\mathbf{k}\).

Q2Show that \(\nabla(\log r) = \dfrac{\vec r}{r^2}\).

\(\nabla f(r) = f'(r)\dfrac{\vec r}{r}\) with \(f = \log r\), \(f' = \dfrac{1}{r}\).

Q3Find the unit normal to \(x^2y + 2xz = 4\) at \((2, -2, 3)\).

\(\nabla\phi = (2xy + 2z,\; x^2,\; 2x) = (-2, 4, 4)\), with length 6. So \(\hat n = \dfrac{1}{3}(-\mathbf{i} + 2\mathbf{j} + 2\mathbf{k})\).

Q4Find the greatest rate of increase of \(\phi = x^2 + y^2 + z^2\) at \((1, 1, 1)\).

\(\nabla\phi = (2, 2, 2)\), so the rate is \(2\sqrt 3\), in the direction \(\dfrac{1}{\sqrt 3}(\mathbf{i} + \mathbf{j} + \mathbf{k})\).

Q5If \(\nabla\phi = 2xyz^3\,\mathbf{i} + x^2z^3\,\mathbf{j} + 3x^2yz^2\,\mathbf{k}\), find \(\phi\).

Integrate the first component with respect to \(x\): \(x^2yz^3\). It also matches the other two components. So \(\phi = x^2yz^3 + c\).

Stuck on a question?

Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.

08

Frequently asked questions

What is the gradient of a scalar field?

The vector \(\nabla\phi = \phi_x\mathbf{i} + \phi_y\mathbf{j} + \phi_z\mathbf{k}\). It points in the direction of fastest increase, and its size is that rate of increase.

Why is the gradient normal to a level surface?

Along the surface \(\phi\) doesn't change, so the rate of change in any tangent direction is 0. That rate is \(\nabla\phi\cdot\hat t = 0\), so \(\nabla\phi\) is perpendicular to every tangent direction.

What is the difference between gradient, divergence and curl?

Gradient acts on a scalar field and gives a vector. Divergence acts on a vector field and gives a scalar. Curl acts on a vector field and gives a vector.

Where the gradient leads next

← All 33 Calculus topics
Vipul Sir
Written by Vipul Sir

Vipul Sir has taught mathematics for over 15 years to HSC, CBSE, ICSE, IGCSE/IB, Diploma, Engineering and BSc students at VVS Classes in Goregaon and Vile Parle, Mumbai. He teaches every class himself, concepts first and exam technique second.

First-year Engineering Calculus

Get the whole course right, with Vipul Sir beside you.

Concept-first coaching in small batches in Goregaon and Vile Parle, from the mean value theorems to Gauss's divergence theorem.

WhatsApp↗