Required math: vectors, calculus
Required physics: none
Given a scalar field defined over three-dimensional space (for example, the temperature in a room or the density of some substance over its volume), we would like to be able to determine the rate of change of the field at a given point as we move along a given direction. For example, if we know the temperature in a room we might like to know how fast the temperature changes as we move straight up towards the ceiling.
To make things precise, we’ll consider a unit vector that points in the direction in which we wish to find the rate of change of the scalar field. In rectangular coordinates we can write this unit vector as
From linear algebra, we know that a line parallel to this vector can be written in vector form as
where is a parameter that ranges from to and is a point on the line. In components, we have
Now if we have some scalar field given by we can find its directional derivative in a given direction by finding the total derivative of with respect to the parameter . From the chain rule for functions of several variables, we have, since each of the components of depends on :
From the above equations, we can work out the deriviatives with respect to and get
If we define a vector called the gradient of by
we can write the directional derivative as
Since is a unit vector, we can write this as
where is the angle between the gradient and the unit vector . From this we see that has its maximum value when , or when the gradient is parallel to the direction of the derivative. In other words, the gradient of a scalar field points in the direction of greatest rate of change of the field at a given point.
In general curvilinear coordinates, we have three coordinates , and whose unit vectors are mutually perpendicular. We can define the line parametrically in terms of these coordinates in the same way as with rectangular coordinates above, so that the rate of change of the scalar field is
In these general coordinates, however, a line element has the form
where , and are functions of the three coordinates. Dividing through by and taking the limit to get a derivative, we have
From this, we can write 12 as a dot product if we define the gradient in curvilinear coordinates as
Then we get
We can still write the equation for the line in the form 3, except now the components of the unit vector would be written in terms of the three basis vectors for whatever coordinate system we are using. Thus the analysis above is still valid for general coordinate systems, and the gradient still represents the direction of maximum increase of the scalar field.