Home page for accesible maths 3 Functions of two or more variables

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

3.2 The gradient vector

You’ve studied partial differentiation in MATH102. We’ll use the same notation for partial derivatives fx=fx, fy=fy as used in MATH102.

Example. f(x,y)=x2+xy+y2. Then

For a function f from 3 to , the vector-valued function (fxfyfz) is called the gradient vector of f, denoted f or grad f.

Example. Let f(x,y,z)=x2y2z. Then

One partial derivative zero. If f=f(x,y) and fy=0 throughout the plane (or some region such as a rectangle or a circle), then, of course, f does not vary with y, so it is constant along horizontal lines and is actually a function of x only. In other words, f(x,y)=g(x) for some function g of one variable. Similarly, if f is a function of x,y,z and fx=0 throughout a region, then it equals g(y,z) for some function g of two variables.

First order approximation to the variation of f.

If f is a function of x only, then, by the very meaning of differentiation, f(x+δx)-f(x)f(x)δx for small δx, with error small compared to δx. Suppose now that f is a function of x and y, and that fx and fy exist and vary continuously. By the principle just stated, applied twice, we have

f(x+δx,y)-f(x,y) fx(x,y)δx,
f(x+δx,y+δy)-f(x+δx,y) fy(x+δx,y)δy
fy(x,y)δy  since fy varies continuously.

By adding these two statements, we obtain the following approximation to the change in f, δf:

δf=f(x+δx,y+δy)-f(x,y)fxδx+fyδy  (*),

in which fx and fy are evaluated at (x,y), and the error is small compared to δx and δy.

Similarly, for a function of three variables,

δffxδx+fyδy+fzδz=(f).δ𝒓  (**).

Curves f(x,y)=c

Suppose that (x,y) and (x+δx,y+δy) both lie on the curve f(x,y)=c. Then δf=0, so by (*), fxδx+fyδy0 for small δx and δy. But this is exactly the same thing as saying f(δxδy)=0. We therefore have the following theorem:

Theorem 3.3

The vector f(x0,y0) is normal to the curve f(x,y)=c at the point (x0,y0).

In other words, if f(x0,y0)(0  0) then there exists a tangent line to the curve at (x0,y0), and f(x0,y0) is perpendicular to it.

We can (almost always) use this to determine an equation for the tangent to the curve at (x0,y0).

Example 3.4

Determine the equation of the tangent line to the curve x2+y3=2 at the point (1,1).

We calculate f: fx=2x, fy=3y2 so f(1,1)=(2  3). Thus (2  3) is normal to the curve at (1,1). In particular, the equation of the tangent line is:

(2  3)(xy)=(2  3)(1  1)

so 2x+3y=5.

Remark. If f(x0,y0)=(0  0) then we can’t define the tangent line to the curve at (x0,y0). This can happen for a variety of reasons, none of which will be discussed in this course.

Example 3.5. The ellipse  3x2+4y2=12.

The gradient at (x,y) is

Hence f at (1,3/2) is (6  12), and the tangent at (1,3/2) is

Alternatively, we can describe the ellipse via the parametrized curve γ:[0,2π)2, γ(t)=(2cost3sint). Then (1  3/2)=γ(π/3). Since γ(t)=(-2sint3cost), we have: γ(π/3)=                             

Thus (-2  1) is a tangent vector to the curve at (1,3/2). In particular, another way of writing the tangent line is: (xy)=(1  3/2)+λ(-2  1).

It is straightforward to check that this really does give the same line as the equation x+2y=4.


Surfaces f(x,y,z)=c

Suppose that 𝒓0=(x0y0z0) and 𝒓0+δ𝒓=(x0+δxy0+δyz0+δz) lie on the surface f(x,y,z)=c, so that δ𝒓 is a displacement within the surface. By (**),

fxδx+fyδy+fzδz=(f).δ𝒓0.

Hence we have the analogous statement to Thm. 3.3:

Theorem 3.6

Let 𝐫0 be a point on the surface f(x,y,z)=c. Then f(𝐫0) is normal to the surface at 𝐫0. Thus if f(𝐫0)(0  0  0) then there exist a normal line and a tangent plane to the surface f(x,y,z)=c at 𝐫0; the normal line is given by (xyz)=𝐫0+λf(𝐫0), and the tangent plane is given by the equation:

f(𝒓0)𝒓=f(𝒓0)𝒓0

Note once again that whereas lines in 2 can be given by an equation of the form ax+by=c, an equation in 3 of the form ax+by+cz=d describes a plane; a normal vector to this plane is (abc). If we are given a normal vector 𝐧 and a vector 𝐮 in the plane, then the equation of the plane is: 𝐧𝒓=𝐧𝐮.

Example 3.7. Find the normal line and tangent plane to the surface xy=z2 at (4,1,2).

The surface is f(x,y,z)=0, where f(x,y,z)=xy-z2.

Example: the gradient of r and functions of r

Let 𝒓=(xyz) and

r=|𝒓|=(x2+y2+z2)1/2,    the distance to the origin,

𝒓^=1r𝒓=(xryrzr),    the unit vector in the direction of 𝒓.

Proposition: We have r=𝒓^. Also, f(r)=f(r)𝒓^.

Proof. By the (one-dimensional) chain rule,

rx=

and similarly for y and z. Also,

xf(r)=

An important special case is:

(GMr)=-GMr2𝒓^

which is the gravitational force exerted at P by a mass M at the origin (see Examples 3.1 and 3.2).