The step dx appears in every term, dotted with a base vector. Pull it out in front, the same way you factor dx⋅(u+v)=dx⋅u+dx⋅v:
da=dx⋅[e1∂x1∂a+e2∂x2∂a+e3∂x3∂a].
The bracket is a vector that depends only on the field and the point, not on the step. It is the gradient of a:
da=dx⋅∇a,∇a=ei∂xi∂a=a,iei.
[1.57]
The first equation is the real definition: the gradient is the vector that turns a small step into the change of the field, by a dot product. The second is how you compute it in Cartesian coordinates. Exercise book exercise 1.10 uses exactly this definition to find a gradient without any coordinates.
The nabla operator
Look at the recipe for the gradient: base vector times derivative, summed. It is useful to treat that recipe as an object in its own right, the nabla (or del) operator:
∇=e1∂x1∂+e2∂x2∂+e3∂x3∂=ei∂xi∂.
[1.58]
∇ behaves like a vector (it has a base vector in every term) whose components are not numbers but instructions: “differentiate with respect to xi”. Applying it to a by writing it on the left gives the gradient. In the next sections we will dot it (∇⋅a), cross it (∇×a) and put it in front of a vector without any symbol (∇a), and in each case the one rule of chapter 1 tells us what happens: the base vector of ∇ takes part in the product, the derivative acts on everything to its right.
The reader also writes ∇=∼eT∼∇ (eq. 1.157), a row of base vectors times a column of derivatives. Multiplying it out gives [1.58].
What the gradient means
Take a step of length ds in the direction of a unit vector e, so dx=eds. Then [1.57] gives the directional derivative:
dsdae=e⋅∇a=∥∇a∥cosα,
[1.59]
where α is the angle between e and ∇a. Everything you need to know about the gradient is in this formula:
It points uphill, along the steepest ascent. The rate is largest when cosα=1, i.e. when you walk along ∇a.
Its length is the steepest rate. At α=0 the rate is ∥∇a∥.
It is perpendicular to the level sets. Walking along a level set (a= constant) gives zero change, so cosα=0: every direction tangent to the level set is perpendicular to ∇a.
Walking against it (α=180∘) gives the steepest descent: this is why gradient descent works.
∇ae
a=x12+x22∇a=1.80e1+1.20e2dsdae=e⋅∇a=1.62
The gradient is perpendicular to the level set through the point. Turn e to find the zero and the maximum rate.
Interactive · drag the point, turn e, switch fields
Figure [1.12]: Level sets (contour lines) of a scalar field in the e1e2-plane, the gradient at a point (blue, drawn shortened) and a direction e (magenta). The gradient is perpendicular to the contour through the point; the rate of change along e is e⋅∇a.
Try the plane preset: the contours are straight and evenly spaced, and the gradient is the same everywhere, because a linear function has constant slopes. On the bowl, the gradient points straight away from the centre and grows with distance, because the contours crowd together. On the saddle at the origin the gradient is zero, yet it is not a maximum or a minimum: a zero gradient only says the tangent plane is flat.
Worked example
Find the gradient of a(x)=c⋅x for a constant vector c, first without coordinates and then with indices.
Without coordinates: da=a(x+dx)−a(x)=c⋅dx=dx⋅c. Compare with da=dx⋅∇a: since this holds for every step, ∇a=c.
With indices: a=ckxk, so a,i=ck∂xk/∂xi=ckδki=ci, and ∇a=ciei=c. The step ∂xk/∂xi=δki is worth remembering: the coordinates are independent variables, so the derivative of one with respect to another is 1 if they are the same and 0 otherwise.
The level sets c⋅x= constant are planes perpendicular to c, and the gradient is c: perpendicular to the level sets, as promised.
Worked example
The temperature in a plate is T=T0+βx1x2 with β=2K/mm2. At the point (1,3) mm, in which direction does the temperature rise fastest, and how fast? How fast does it change in the direction (e1+e2)/2?
∇T=β(x2e1+x1e2)=2(3e1+e2)=6e1+2e2 K/mm. Fastest rise along (3e1+e2)/10, at ∥∇T∥=40≈6.3 K/mm. Along e=(e1+e2)/2: e⋅∇T=(6+2)/2≈5.7 K/mm, a little less than the maximum because e is 26.6∘ off the gradient direction.