# 3.4 Gradient of a Scalar Field

When dealing with a scalar physical quantity whose magnitude depends on a single variable, such as the temperature T as a function of height z, the rate of change of T with height can be described by the derivative d T/d z. However, if T is also a function of x and y, its spatial rate of change becomes more difficult to describe because we now have to deal with three separate variables. The differential change in T along x, y, and z can be described in terms of the partial derivatives of T with respect to the three coordinate variables, but it is not immediately obvious as to how we should combine the three partial derivatives so as to describe the spatial rate of change of T along a specified direction. Furthermore, many of the quantities we deal with in electromagnetics are vectors; therefore, both their magnitudes and directions may vary with spatial position. To this end, we introduce three fundamental operators to describe the differential spatial variations of scalars and vectors: the gradient, divergence, and curl operators. The gradient operator applies to scalar fields and is the subject of the present section. The other two operators, which apply to vector fields, are discussed in succeeding sections.

Suppose that T 1=T(x,y,z) is the temperature at point P 1=(x,y,z) in some region of space, and

T 2=T(x+d x,y+d y,z+d z)

is the temperature at a nearby point P 2=(x+d x,y+d y,z+d z) (Fig. 3-20). The differential distances d x, d y, and d z are the components of the differential distance vector d l. That is,

d l=x ˆ d x+y ˆ d y+z ˆ d z. (3.69)

# Figure 3-20 Differential distance vector d l between points P 1 and P 2.

Figure 3 20 Full Alternative Text

From differential calculus, the temperature difference between points P 1 and P 2, d T=T 2−T 1, is

d T=∂T∂x d x+∂T∂y d y+∂T∂z d z. (3.70)

Because d x=x ˆ⋅d l, d y=y ˆ⋅d l, and d z=z ˆ⋅d l, Eq. (3.70) can be rewritten as

d T=x ˆ∂T∂x⋅d l+y ˆ∂T∂y⋅d l+z ˆ∂T∂z⋅d l=x ˆ∂T∂x+y ˆ∂T∂y+z ˆ∂T∂z⋅d l. (3.71)

The vector inside the square brackets in Eq. (3.71) relates the change in temperature d T to a vector change in direction d l. This vector is called the gradient of T (or grad T for short) and denoted ∇T:

Equation (3.71) then can be expressed as

d t=∇T⋅d l. (3.73)

The symbol ∇ is called the del or gradient operator and is defined as

With d l=a ˆ l d l, where a ˆ l is the unit vector of d l, the directional derivative of T along a ˆ l is

We can find the difference (T 2−T 1), where T 1=T(x 1,y 1,z 1) and T 2=T(x 2,y 2,z 2) are the values of T at points

P 1=(x 1,y 1,z 1)and P 2=(x 2,y 2,z 2)

not necessarily infinitesimally close to one another, by integrating both sides of Eq. (3.73). Thus,

T 2−T 1=∫P 1 P 2∇T⋅d l. (3.76)

# Example 3-11: Directional Derivative

Find the directional derivative of T=x 2+y 2 z along direction x ˆ 2+y ˆ 3−z ˆ 2 and evaluate it at (1,−1,2).

Solution: First, we find the gradient of T:

∇T=x ˆ∂∂x+y ˆ∂∂y+z ˆ∂∂z(x 2+y 2 z)=x ˆ 2 x+y ˆ 2 y z+z ˆ y 2.

We denote l as the given direction,

l=x ˆ 2+y ˆ 3−z ˆ 2.

Its unit vector is

a ˆ l=l|l|=x ˆ 2+y ˆ 3−z ˆ 2 2 2+3 2+2 2=x ˆ 2+y ˆ 3−z ˆ 2 17.

Application of Eq. (3.75) gives

d T d l=∇T⋅a ˆ l=(x ˆ 2 x+y ˆ 2 y z+z ˆ y 2)⋅x ˆ 2+y ˆ 3−z ˆ 2 17=4 x+6 y z−2 y 2 17.

At (1,−1,2),

d T d l(1,−1,2)=4−12−2 17=−10 17.

# 3.4.1 Gradient Operator in Cylindrical and Spherical Coordinates

Even though Eq. (3.73) was derived using Cartesian coordinates, it should have counterparts in other coordinate systems. To convert Eq. (3.72) into cylindrical coordinates (r,ϕ,z), we start by restating the coordinate relations

r=x 2+y 2,tan ϕ=y x. (3.77)

From differential calculus,

∂T∂x=∂T∂r∂r∂x+∂T∂ϕ∂ϕ∂x+∂T∂z∂z∂x. (3.78)

Since z is orthogonal to x and ∂z/∂x=0, the last term in Eq. (3.78) vanishes. From the coordinate relations given by Eq. (3.77), it follows that

∂r∂x=x x 2+y 2=cos ϕ, (3.79a)
∂ϕ∂x=−1 r sin ϕ. (3.79b)

Hence,

∂T∂x=cos ϕ∂T∂r−sin ϕ r∂T∂ϕ. (3.80)

This expression can be used to replace the coefficient of x ˆ in Eq. (3.72), and a similar procedure can be followed to obtain an expression for ∂T/∂y in terms of r and ϕ. If, in addition, we use the relations x ˆ=r ˆ cos ϕ−ϕ ˆ sin ϕ and y ˆ=r ˆ sin ϕ+ϕ ˆ cos ϕ [from Eqs. (3.57a) and (3.57b)], then Eq. (3.72) becomes

∇T=r ˆ∂T∂r+ϕ ˆ 1 r∂T∂ϕ+z ˆ∂T∂z. (3.81)

Hence, the gradient operator in cylindrical coordinates can be expressed as

A similar procedure leads to the expression for the gradient in spherical coordinates:

# 3.4.2 Properties of the Gradient Operator

For any two scalar functions U and V, the following relations apply:

(1)∇(U+V)=∇U+∇V, (3.84a)
(2)∇(U V)=U∇V+V∇U, (3.84b)
(3)∇V n=n V n−1∇V,for any n. (3.84c)

# Example 3-12: Calculating the Gradient

Find the gradient of each of the following scalar functions and then evaluate it at the given point.

1. V 1=24 V 0 cos π y/3 sin 2 π z/3 at (3,2,1) in Cartesian coordinates,

2. V 2=V 0 e−2 r sin 3 ϕ at (1,π/2,3) in cylindrical coordinates,

3. V 3=V 0 a/R cos 2 θ at (2 a,0,π) in spherical coordinates.

Solution: (a) Using Eq. (3.72) for ∇,

∇V 1=x ˆ∂V 1∂x+y ˆ∂V 1∂y+z ˆ∂V 1∂z=−y ˆ 8 π V 0 sin π y 3 sin 2 π z 3+z ˆ 16 π V 0 cos π y 3 cos 2 π z 3=8 π V 0−y ˆ sin π y 3 sin 2 π z 3+z ˆ 2 cos π y 3 cos 2 π z 3.

At (3,2,1),

∇V 1=8 π V 0−y ˆ sin 2 2 π 3+z ˆ 2 cos 2 2 π 3=π V 0−y ˆ 6+z ˆ 4.

(b) The function V 2 is expressed in terms of cylindrical variables. Hence, we need to use Eq. (3.82) for ∇:

∇V 2=r ˆ∂∂r+ϕ ˆ 1 r∂∂ϕ+z ˆ∂∂z V 0 e−2 r sin 3 ϕ=−r ˆ 2 V 0 e−2 r sin 3 ϕ+ϕ ˆ(3 V 0 e−2 r cos 3 ϕ)/r=−r ˆ 2 sin 3 ϕ+ϕ ˆ 3 cos 3 ϕ r V 0 e−2 r.

At (1,π/2,3), r=1 and ϕ=π/2. Hence,

∇V 2=−r ˆ 2 sin 3 π 2+ϕ ˆ 3 cos 3 π 2 V 0 e−2=r ˆ 2 V 0 e−2=r ˆ 0.27 V 0.

(c) As V 3 is expressed in spherical coordinates, we apply Eq. (3.83) to V 3:

∇V 3=R ˆ∂∂R+θ ˆ 1 R∂∂θ+ϕ ˆ 1 R sin θ∂∂ϕ V 0 a R cos 2 θ=−R ˆ V 0 a R 2 cos 2 θ−θ ˆ 2 V 0 a R 2 sin 2 θ=−[R ˆ cos 2 θ+θ ˆ 2 sin 2 θ]V 0 a R 2.

At (2 a,0,π), R=2 a and θ=0, which yields

∇V 3=−R ˆ V 0 4 a.