Functions of Several Variables Explained
Functions of Several Variables Explained
A plane in space is determined by a point P0 (x0 , y0 , z0 ) in the plane and a vector n = ⟨a, b, c⟩
that is orthogonal to the plane (specify the “direction” of the plane). This orthogonal vector
is called a normal vector. Let P (x, y, z) be an arbitrary point in the plane, and let r0 and r
ÐÐ→
be the position vectors of P0 and P , then P0 P = r − r0 . Since the normal vector is orthogonal
1
to every vector in the given plane, we have n ⋅ (r − r0 ) = 0, that is
⟨a, b, c⟩ ⋅ ⟨x − x0 , y − y0 , z − z0 ⟩ = 0 or
a(x − x0 ) + b(y − y0 ) + c(z − z0 ) = 0 or
ax + by + cz + d = 0 with d = ax0 + by0 + cz0
EXAMPLE 1 Find an equation of the plane through the point (2, 4, −1) with normal vector
n = ⟨2, 3, 4⟩. Find the intercepts and sketch the plane.
Solution. Put a = 2, b = 3, c = 4 and x0 = 2, y0 = 4, z0 = −1 into the equation of plane, we have
2(x − 2) + 3(y − 4) + 4(z + 1) = 0 or 2x + 3y + 4z = 12. To find the x-intercept we set y = z = 0
in this equation and obtain x = 6. Similarly, the y-intercept is 4 and the z-intercept is 3. This
enables us to sketch the portion of the plane that lies in the first octant.
EXAMPLE 2 Find an equation of the plane that passes through the points P (1, 3, 2),
Q(3, −1, 6) and R(5, 2, 0).
Ð→ Ð→
Solution. Since both P Q and P R lie in the plane, their cross product is orthogonal to the plane
RR i j k RRR
Ð→ Ð→ RRRR RR
and can be taken as the normal vector. Then n = P Q × P R = RRR 2 −4 4 RRRR = 12i + 20j + 14k.
RRR R
RR 4 −1 −2 RRRR
A plane equation is 12(x − 1) + 20(y − 3) + 14(z − 2) = 0 or 6x + 10y + 7z = 50
2
EXAMPLE 3 Find an equation of the plane that passes through the points (−2, 4, 1) and is
parallel to the plane 3x − 2y + z = 4.
Solution. A normal vector is n = ⟨3, −2, 1⟩. Then a equation of the plane is 3(x + 2) − 2(y −
4) + (z − 1) = 0 or 3x − 2y + z = −13.
EXAMPLE 4 Determine the line of intersection L of two planes x+y +z = 1 and x−2y +3z = 1
Solution. The normal of the two planes are n1 = ⟨1, 1, 1⟩, n2 = ⟨1, −2, 3⟩, which are not parallel,
i.e., the two planes do intersect.
To determine the intersection line, its direction vector v and a point P0 on the line are
required. Because L is in both planes, v is orthogonal to both of the normal vectors. Thus a
vector v parallel to L is given by the cross product
RRR i j k RRR
RR RR
v = n1 × n2 = RRRR 1 1 1 RRRR = 5i − 2j − 3k.
RRR R
RR 1 −2 3 RRRR
For a point P0 on L, we can find it where the line intersects the x − y plane by setting z = 0
in the equations of both planes. This gives x + y = 1 and x − 2y = 1, whose solution is x = 1 and
y = 0. So P0 (1, 0, 0).
Eventually, L is given as r(t) = r0 + vt = ⟨1, 0, 0⟩ + t⟨5, −2, −3⟩
3
General Cylindrical Surfaces
DEFINITION Given a curve C in a plane S and a line L not in S, a cylinder is the surface
consisting of all the lines parallel to L that pass through C.
A common situation: the curve C is in a coordinate plane and the line L is in the direction
of the 3rd coordinate axis, i.e., direction that orthogonal to the coordinate plane where C is.
Then we can easily write down the cylindrical surface generated by C and L.
EXAMPLE 5 The curve z = x2 is a parabola in the x − z plane, and the line L is parallel
to the y-axis. The equation for the cylindrical surface generated by the curve and the line is
z = x2 . The variable corresponding to the coordinate axis parallel to L is missing, because for
arbitrary point P (x, y, z) on this surface, constrain is only set to its x and z coordinates.
4
Quadric Surfaces
The General equation (quadratic equation)
where A, B, C, D, E, F, G, H, I, J are not zero at the same time. Making hand sketches can be
challenging, we usually need the help of
Traces: the curves of intersection of the surface with planes parallel to the coordinate
planes. Traces in the coordinate planes are called the xy-trace, yz-trace, and xz-trace.
y2 z2
EXAMPLE 7 Use traces to sketch the quadric surface with equation x2 + + = 1.
9 4
y2
Solution. Substituting z = 0, the xy-trace is x2 + = 1 which is an ellipse. In general, the
9
y 2 k 2
horizontal trace in the plane z = k is x2 + = 1 − , which is an ellipse, if k 2 < 4. (If k 2 = 4, the
9 4
trace consists of a single point (0, 0, ±2), the intercepts at z-axis. If k 2 > 4, the trace is empty.)
y2 z2
Similarly, vertical traces parallel to the y − z plane and x − z plane are also ellipses: + =
9 4
z2 k2
1 − k 2 for x = k, −1 < k < 1 and x2 + = 1− for y = k, −3 < k < 3. The intercepts at x- and y-
4 9
axes are (±1, 0, 0) and (0, ±3, 0)
The surface is an ellipsoid.
y2 z2
Graph of an ellipsoid x2 + + =1
9 4
EXAMPLE 8 Use traces to sketch the quadric surface with equation z = 4x2 + y 2 .
Solution. If we put x = 0, we get z = y 2 , so the yz-trace is a parabola. If we put x = k (a
constant), we get z = y 2 +4k 2 . This means that if we slice the graph with any plane parallel to the
yz-plane, we obtain a parabola that opens upward. Similarly, if y = k, the trace is z = 4x2 + k 2 ,
which is again a parabola that opens upward. If we put z = k, we get the horizontal traces
4x2 + y 2 = k, which are a family of ellipses for k > 0. Because of the elliptical and parabolic
traces, the quadric surface is called an elliptic paraboloid.
x2 z2
EXAMPLE 9 Sketch the quadric surface with equation + y2 − = 1.
4 4
x2 k2
Solution. The trace in any horizontal plane z = k is the ellipse + y 2 = 1 + . But the traces
4 4
x2 z 2 2
z2
in the xz- and yz- planes are the hyperbolas − = 1, y = 0 and y − = 1, x = 0. This
4 4 4
surface is called a hyperboloid of one sheet.
5
Graph of an elliptic paraboloid z = 4x2 + y 2
x2 z2
Graph of a hyperboloid of one sheet + y2 − =1
4 4
6
7
2 Graphs & Level Curves
Functions of Two Variables
DEFINITION A function of two variables z = f (x, y) is a rule that assigns to each ordered
pair of real numbers (x, y) a unique real number z.
Independent variables: x, y
dependent variables: z
If a function f is given by an explicit formula and no domain is specified, then the domain
of f is understood to be the set of all pairs (x, y) for which the given expression defined a real
number.
√
EXAMPLE 1 Find the domain and range of z = f (x, y) = 9 − x2 − y 2
Solution. Domain is the set of (x, y) such that z is real: 9−x2 −y 2 ⩾ 0 ⇒ D = {(x, y) ∣ x2 +y 2 ⩽ 9}
Range is the set of z: {z ∣ 0 ⩽ z ⩽ 3} = [0, 3]
8
Graphs
DEFINITION If f is a function of two variables with domain D, then the graph of f is the
set of all points (x, y, z) in R3 such that z = f (x, y) and (x, y) is in D.
√
EXAMPLE 3 Graphing z = f (x, y) = 9 − x2 − y 2
Solution. A hemisphere generated by rotating the half circle x2 + z 2 = 9 for z ⩾ 0 on the x − z
plane about the z- axis.
EXAMPLE 4 Graphing
(a) z = f (x, y) = x2 + y 2 a paraboloid by rotating the parabola z = x2 on the x − z plane
about the z-axis
9
√
(b) z = f (x, y) = 1 + x2 + y 2 a hyperboloid by rotating the upper branch of the hyperbola
z 2 = 1 + y 2 on the y − z plane about the z-axis
Rotation can only be used to graph functions whose horizontal traces are circles.
Graphs of z = f (x, y) should pass the vertical line test: every line parallel to z-axis
intersects the graph at most once
DEFINITION The level curves of a function f of two variables are the curves with equations
f (x, y) = k, where k is a constant (in the range of f ).
10
A level curve f (x, y) = k is the set of all points in the domain of f at which f takes on a
given value k. In other words, it is a curve in the x − y plane that shows where the graph of f
has height k (above or below the x − y plane). A collection of level curves is called a contour
map. From a contour map, one can visualize a function z = f (x, y) by lifting up (k > 0) or
putting down (k < 0) the level curves with k.
Contour maps are most descriptive when the level curves f (x, y) = k are drawn for equally
spaced values of k, and we assume that this is the case unless indicated otherwise.
11
Solution. The expression for f (x, y, z) is defined as long as z − y > 0, therefore, the domain is
D = {(x, y, z) ∈ R3 ∣ z > y}
Graphs of functions of three variables lie in a four-dimensional space, which can be examined
by its level surfaces, which are the surfaces with equations f (x, y, z) = k with k a constant in
the range of f .
EXAMPLE 7 Find the level surfaces of the functions (a) f (x, y, z) = x2 +y 2 +z 2 (b) f (x, y, z) =
x2 − y − z 2 √
Solution. (a) Level surfaces are a family of concentric spheres with radius k: x2 + y 2 + z 2 = k
(b) Level surfaces are a family of hyperbolic paraboloids x2 − y − z 2 = k or y = x2 − z 2 − k
lim f (x, y) = L
(x,y)→(a,b)
if for
√ every number ε > 0 there is a corresponding number δ > 0 such that if (x, y) ∈ D and
0 < (x − a)2 + (y − b)2 < δ then ∣f (x, y) − L∣ < ε.
12
Illustration 1 If any small interval (L − ε, L + ε) is given around L, then we can find a disk
Dδ with center (a, b) and radius δ > 0 such that f maps all the points in Dδ [except possibly
(a, b)] into the interval (L − ε, L + ε).
Illustration 2 If ε > 0 is given, we can find δ > 0 such that if (x, y) is restricted to lie in the
disk Dδ and (x, y) ≠ (a, b), then the corresponding part of S lies between the horizontal planes
z = L − ε and z = L + ε.
Remark For functions of a single variable, if we let x → a, there are only two possible directions:
x → a− and x → a+ . However, for functions of two variables, (x, y) can approach (a, b) from
infinite numbers of directions and in infinite number of manners in the domain of the function.
Therefore, if lim(x,y)→(a,b) f (x, y) exists, f (x, y) → L no matter how (x, y) → (a, b)
4. Product lim f (x, y)g(x, y) = [ lim f (x, y)] [ lim g(x, y)] = LM
(x,y)→(a,b) (x,y)→(a,b) (x,y)→(a,b)
√
EXAMPLE 1 Find lim(x,y)→(2,8) (3x2 y + xy)
13
Solution.
√ √
lim (3x2 y + xy) = lim 3x2 y + lim xy
(x,y)→(2,8) (x,y)→(2,8) (x,y)→(2,8)
2 1/2 1/2
= 3[ lim x] [ lim y] + [ lim x] [ lim y]
(x,y)→(2,8) (x,y)→(2,8) (x,y)→(2,8) (x,y)→(2,8)
xy − 4y 2
EXAMPLE 4 Find lim(x,y)→(4,1) f (x, y), where f (x, y) = √ √
x−2 y
Solution. The domain of f (x, y) is D = {(x, y) ∣ x > 0, y > 0, x ≠ 4y}
√ √ √ √
(xy − 4y 2 ) ( x + 2 y) y (x − 4y) ( x + 2 y)
lim f (x, y) = lim √ √ √ lim
√ = (x,y)→(4,1)
(x,y)→(4,1) (x,y)→(4,1) ( x − 2 y) ( x + 2 y) x − 4y
x≠4y x≠4y
√ √
= lim y ( x + 2 y) = 4
(x,y)→(4,1)
14
Non-existence of Limits: Two-Path Test
If f (x, y) approaches two different values as (x, y) approaches (a, b) along two different paths
in the domain of f , then lim(x,y)→(a,b) f (x, y) does not exist.
(x + y)2
EXAMPLE 5 Does lim(x,y)→(0,0) exist?
x2 + y 2
Solution. Let (x, y) approaches (a, b) along y = mx, where m is a constant.
2 2 2
(x + y) (x + mx) x2 (1 + m) (1 + m)2
lim = lim = lim =
(x,y)→(0,0) x2 + y 2 x→0 x2 + (mx)2 x→0 x2 (1 + m2 ) 1 + m2
y=mx
(my 2 ) y 2 m
lim f (x, y) = lim 2 2 4
= 2
(x,y)→(0,0) y→0 (my ) + y m +1
x=my 2
lim(x,y)→(0,0) f (x, y) does NOT exist. Therefore, the function is NOT continuous at (0, 0). The
graph of f (x, y) is shown below.
15
Continuity of Composite Functions
THEOREM If u = g(x, y) is continuous at (a, b) and z = f (u) is continuous at g(a, b), then
the composite function z = f (g(x, y)) is continuous at (a, b).
DEFINITION f (x) is continuous at x = a, if (1) f (x) is defined at a; (2) limx→a f (x) exists;
(3) limx→a f (x) = f (a)
x2 sin y π
EXAMPLE 9 Find the limit of f (x, y, z) = 2 at (2, , 0)
z +4 2
Solution.
x2 sin y 22 sin π2
lim = 2 =1
(x,y,z)→(2, π2 ,0) z 2 + 4 0 +4
√
EXAMPLE 10 Where is the function h(x, y, z) = x2 √ + y 2 + z 2 − 1 continuous?
Solution. Let u = g(x, y, z) = x2 + y 2 + z 2 − 1, f (u) = u. Since u = g(x, y, z) is continuous
and non-negative on {(x, y, z) ∣ x2 + y 2 + z 2 ⩾ 1}, and f (u) is continuous for u ⩾ 0, h(x, y, z) =
f (g(x, y, z)) is continuous on or outside the unit sphere centered at the origin.
4 Partial Derivatives
Derivatives of Two-Variable Functions
If f is a function of two variables x and y, suppose we let only x vary while keeping y fixed,
say y = b, where b is a constant. Then we are really considering a function of a single variable
x, namely, g(x) = f (x, b). If g has a derivative at a, then we call it the partial derivative of
f with respect to x at (a, b), and denote it by fx (a, b). Thus
f (a + h, b) − f (a, b)
fx (a, b) = lim
h→0 h
16
Similarly, the partial derivative of f with respect to y at (a, b), denoted by fy (a, b), is
obtained by keeping x fixed (x = a) and finding the ordinary derivative at b of the function
G(y) = f (a, y):
f (a, b + h) − f (a, b)
fy (a, b) = lim
h→0 h
The geometrical interpretation of the partial derivatives are illustrated below.
If we replace (a, b) by variable point (x, y), then fx and fy are functions of x and y.
DEFINITION If f is a function of two variables, its partial derivatives are the functions
fx and fy defined by
f (x + h, y) − f (x, y)
fx (x, y) = lim
h→0 h
f (x, y + h) − f (x, y)
fy (x, y) = lim
h→0 h
NOTATIONS If z = f (x, y), we write
∂f ∂ ∂z
fx (x, y) = fx = = f (x, y) =
∂x ∂x ∂x
∂f ∂ ∂z
fy (x, y) = fy = = f (x, y) =
∂y ∂y ∂y
RULES for finding partial derivatives of z = f (x, y)
17
To find fx , regard y as a constant and differentiate f (x, y) with respect to x. That is
d
taking g(x), where g(x) = f (x, y) by keeping y fixed.
dx
To find fy , regard x as a constant and differentiate f (x, y) with respect to y. That is
d
taking G(y), where G(y) = f (x, y) by keeping x fixed.
dy
REMARK All the rules and results for ordinary derivative can be used to compute partial
derivatives.
EXAMPLE 2 Calculate the partial derivatives of (a) f (x, y) = sin(xy) and (b) f (x, y) = x2 exy
∂f ∂ ∂
Solution. (a) = [sin(xy)] = cos(xy) ⋅ (xy) = y cos(xy) ⇐ applying chain rule
∂x ∂x ∂x
∂f ∂ ∂
= [sin(xy)] = cos(xy) ⋅ (xy) = x cos(xy)
∂y ∂y ∂y
∂f ∂ ∂ ∂
(b) = [x2 exy ] = [ (x2 )] exy + x2 [ (exy )] ⇐ applying rule of product
∂x ∂x ∂x ∂x
= 2xexy + x2 yexy = x(2 + xy)exy ⇐ applying chain rule
∂f ∂ 2 xy ∂
= [x e ] = x2 (exy ) = x2 ⋅ xexy = x3 exy ⇐ applying rule of constant
∂y ∂y ∂y
multiple & chain rule
∂ ∂f ∂ 2f ∂ 2z
( )= = = (fx )x = fxx
∂x ∂x ∂x2 ∂x2
∂ ∂f ∂ 2f ∂ 2z
( )= = = (fx )y = fxy
∂y ∂x ∂y∂x ∂y∂x
∂ ∂f ∂ 2f ∂ 2z
( )= = = (fy )x = fyx
∂x ∂y ∂x∂y ∂x∂y
∂ ∂f ∂ 2f ∂ 2z
( )= = = (fy )y = fyy
∂y ∂y ∂y 2 ∂y 2
18
Functions of Three or More Variables
In general, if y = f (x1 , x2 , . . . , xn ) is a function of n variables, its partial derivative with respect
to the i-th variable xi is defined as
∂f f (x1 , x2 , . . . , xi−1 , xi + h, xi+1 , . . . , xn ) − f (x1 , x2 , . . . , xi−1 , xi , xi+1 , . . . , xn )
fxi = = lim
∂xi h→0 h
If the limit exists.
EXAMPLE 5 The idea gas law gives the relationship of gas pressure P , volume V , and
temperature T as P V = kT , where k > 0 is a constant. Discuss the behaviour of the pressure.
T
Solution. We can rewrite P as a function of V and T : P = P (V, T ) = k , providing V > 0
V
and T > 0.
∂P T
= −k 2 < 0, P is a decreasing function of volume V .
∂V V
∂P 1
= k > 0, P is an increasing function of temperature T .
∂T V
Differentiability
f (a + ∆x) − f (a)
One-variable function y = f (x) is differentiable at x = a, if the limit lim∆x→0 =
∆x
f (a + ∆x) − f (a)
f ′ (a) exits. We can define an error function ε(∆x) = − f ′ (a). Then, if f (x)
∆x
is differentiable at x = a, we have lim∆x→0 ε = 0. The change in y as x varies from a to a + ∆x
is expressed as ∆y = f (a + ∆x) − f (a) = f ′ (a)∆x + ε∆x with lim∆x→0 ε = 0. This implies that
to be truly differentiable a function must be locally linear: when x changes around a,
i.e., x = a + ∆x with ∆x → 0, f (x) = f (a + ∆x) = f (a) + f ′ (a)∆x + ε∆x ≃ f (a) + f ′ (a)∆x. In
other words, if a one-variable function is differentiable at a, it can be approximated by a piece
of straight line in the vicinity of f (a) and the slope of the line is f ′ (a).
For two-variable functions, z = f (x, y) is differentiable at (a, b), if fx (a, b) and fy (a, b) exist
and the change in z as (x, y) varies in the vicinity of (a, b) is equal to
where ε1 and ε2 are functions of ∆x and ∆y, and (ε1 , ε2 ) → (0, 0) as (∆x, ∆y) → (0, 0).
19
THEOREM Suppose f has fx and fy defined on an open set containing (a, b), and fx and fy
are continuous at (a, b), then f is differentiable at (a, b).
REMARK For two-variable functions, the existence of fx and fy at (a, b) is NOT enough to
guarantee the differentiability of f at (a, b).
f (x, y) is not differentiable at (0, 0), however fx and fy exist at (0, 0):
f (∆x, 0) − f (0, 0) 1 ∆x ⋅ 0
fx (0, 0) = lim∆x→0 = lim∆x→0 [ − 0] = 0
∆x ∆x (∆x)2 + 02
f (0, ∆y) − f (0, 0) 1 ⋅0 ⋅ ∆y
fy (0, 0) = lim∆y→0 = lim∆y→0 [ 2 − 0] = 0.
∆x ∆y 0 + (∆y)2
f is not differentiable, since fx and fy are not continuous at (0, 0). See the graph of f (x, y)
20
PROOF A change of ∆t in t produces changes of ∆x in x and ∆y in y. These, in turn, produce
a change of ∆z in z, which is equal to
∂f ∂f
∆z = ∆x + ∆y + ε1 ∆x + ε2 ∆y
∂x ∂y
where ε1 → 0 and ε2 → 0 as (∆x, ∆y) → (0, 0). [z is differentiable.] Dividing both sides of this
equation by ∆t, we have
∆z ∂f ∆x ∂f ∆y ∆x ∆y
= + + ε1 + ε2
∆t ∂x ∆t ∂y ∆t ∆t ∆t
We now let ∆t → 0, then ∆x = g(t + ∆t) − g(t) → 0 and ∆y = h(t + ∆t) − h(t) → 0 because g
and h are differentiable. This, in turn, means that ε1 → 0 and ε2 → 0, so
dz ∆z
= lim
dt ∆t→0 ∆t
∂f ∆x ∂f ∆y ∆x ∆y
= lim + lim + lim ε1 ⋅ lim + lim ε2 ⋅ lim
∂x ∆t→0 ∆t ∆t→0 ∂y ∆t ∆t→0 ∆t→0 ∆t ∆t→0 ∆t→0 ∆t
∂f dx ∂f dy dx dy ∂f dx ∂f dy
= + +0⋅ +0⋅ = + ◻
∂x dt ∂y dt dt dt ∂x dt ∂y dt
Extension Functions with three independent variables w = f (x, y, z), where x, y, and z are
functions of the single variable t, then
dw ∂w dx ∂w dy ∂w dz
= + +
dt ∂x dt ∂y dt ∂z dt
dz π
EXAMPLE 1 If z = x2 − 3y 2 + 20 with x = 2 cos t and y = 2 sin t, calculate at t = .
dt 4
∂z ∂z dx dy
Solution. = 2x, = −6y, = −2 sin t, = 2 cos t, then
∂x ∂y dt dt
dz ∂z dx ∂z dy
= + = (2x)(−2 sin t) + (−6y)(2 cos t) = −8 sin t cos t − 24 sin t cos t = −16 sin 2t.
dt ∂x dt ∂y dt
dz π
Therefore, ∣ = −16 sin = −16. The geometric picture is shown below.
dt t= π 2
4
21
The Chain Rule: Case 2
Theorem 2 Suppose that z = f (x, y) is a differentiable function of x and y, where x = g(s, t)
and y = h(s, t) are differentiable functions of s and t. Then
∂z ∂z ∂x ∂z ∂y ∂z ∂z ∂x ∂z ∂y
= + = +
∂s ∂x ∂s ∂y ∂s ∂t ∂x ∂t ∂y ∂t
Theorem 2 could be directly obtained by Theorem 1: in computing ∂z/∂s we hold t fixed and
compute the ordinary derivative of z with respect to s. A similar argument holds for ∂z/∂t.
EXAMPLE 2 Given z = sin 2x cos 3y, x = s + t and y = s − t, calculate ∂z/∂s and ∂z/∂t.
Solution.
∂z ∂z ∂x ∂z ∂y
= + = (2 cos 2x cos 3y)(1) + (−3 sin 2x sin 3y)(1)
∂s ∂x ∂s ∂y ∂s
= 2 cos 2x cos 3y − 3 sin 2x sin 3y = 2 cos[2(s + t)] cos[3(s − t)] − 3 sin[2(s + t)] sin[3(s − t)]
∂z ∂z ∂x ∂z ∂y
= + = (2 cos 2x cos 3y)(1) + (−3 sin 2x sin 3y)(−1)
∂t ∂x ∂t ∂y ∂t
= 2 cos 2x cos 3y + 3 sin 2x sin 3y = 2 cos[2(s + t)] cos[3(s − t)] + 3 sin[2(s + t)] sin[3(s − t)]
Implicit Differentiation
We suppose that an equation of the form F (x, y) = 0 defines y implicitly as a differentiable
function of x. If F is differentiable, we can apply Theorem 1 to differentiate both sides of the
equation F (x, y) = 0 with respect to x. Since both x and y are functions of x, we obtain
∂F dx ∂F dy
+ =0
∂x dx ∂y dx
But dx/dx = 1, so if ∂F /∂y ≠ 0 we solve for dy/dx and obtain
∂F
dy Fx
= − ∂x = −
dx ∂F Fy
∂y
EXAMPLE 3 If F (x, y) = sin xy + πy 2 − x = 0, find dy/dx.
dy Fx y cos xy − 1
Solution. Fx = y cos xy − 1, Fy = x cos xy + 2πy, then =− =−
dx Fy x cos xy + 2πy
EXAMPLE 4 A fluid flow √ with velocity v = ⟨u, v⟩, where u = 2 sin πx cos πy and v = −2 cos πx sin π[Link]
speed of the flow is s = u2 + v 2 , apply the chain rule to find ∂s/∂x and ∂s/∂y.
∂s 2u u ∂s 2v v
Solution. = √ = , = √ =
∂u 2 u2 + v 2 s ∂v 2 u2 + v 2 s
∂s ∂s ∂u ∂s ∂v u v 2π
= + = (2π cos πx cos πy)+ (2π sin πx sin πy) = (u cos πx cos πy+v sin πx sin πy)
∂x ∂u ∂x ∂v ∂x s s s
∂s ∂s ∂u ∂s ∂v u v 2π
= + = (−2π sin πx sin πy)+ (−2π cos πx cos πy) = − (u sin πx sin πy+v cos πx cos πy)
∂y ∂u ∂y ∂v ∂y s s s
22
6 Directional Derivatives & Gradient
Directional Derivatives
Recall that if z = f (x, y), then the partial derivatives fx and fy are defined as
ÐÐ→
are the projections of P , Q onto the xy-plane, then the vector P ′ Q′ is parallel to u and so
ÐÐ→
P ′ Q′ = hu = ⟨ha, hb⟩ for some scalar h. Therefore, x = x0 + ha, y = y0 + hb, and
REMARK The partial derivatives of f with respect to x and y are just special cases of the
directional derivative: fx = Di f and fy = Dj f .
23
THEOREM If f is a differentiable function of x and y, then f has a directional derivative in
the direction of any unit vector u = ⟨a, b⟩ and
Du f (x, y) = fx (x, y)a + fy (x, y)b = ⟨fx (x, y), fy (x, y)⟩ ⋅ ⟨a, b⟩
PROOF If we define a function g of the single variable h by g(h) = f (x0 + ha, y0 + hb), then,
by the definition of the directional derivative at (x0 , y0 ), we have
f (x0 + ha, y0 + hb) − f (x0 , y0 ) g(h) − g(0)
Du f (x0 , y0 ) = lim = lim = g ′ (0)
h→0 h h→0 h
On the other hand, we can write g(h) = f (x, y), where x = x0 + ha, y = y0 + hb, so the Chain
Rule gives
∂f dx ∂f dy
g ′ (h) = + = fx (x, y)a + fy (x, y)b
∂x dh ∂y dh
If we now put h = 0, then x = x0 , y = y0 and
If the unit vector u makes an angle θ with the positive x-axis, then we can write u =
⟨cos θ, sin θ⟩ and the formula becomes
Du f (x, y) = fx (x, y) cos θ + fy (x, y) sin θ = ⟨fx (x, y), fy (x, y)⟩ ⋅ ⟨cos θ, sin θ⟩
√
1 2 1 2 1 1 1 3
EXAMPLE 1 z = f (x, y) = x + y + 2 (paraboloid), u = ⟨ √ , √ ⟩, v = ⟨ , − ⟩ (already
4 2 2 2 2 2
unit vectors). Find Du f and Dv f at P0 (3, 2).
1 3
Solution. fx = x, fy = y, then ⟨fx (P0 ), fy (P0 )⟩ = ⟨ , 2⟩
2 2
3 1 1 7
Du f (P0 ) = ⟨ , 2⟩ ⋅ ⟨ √ , √ ⟩ = √
2 2√2 2 2
3 1 3 3 √
Dv f (P0 ) = ⟨ , 2⟩ ⋅ ⟨ , − ⟩= − 3
2 2 2 4
24
Therefore Du f (x, y) = ∇f (x, y) ⋅ u with u a unit vector.
25
Equation of Tangent Line
√
EXAMPLE 5 Given z = f (x, y) = 1 + 2x2 + y 2 the upper sheet of a two-sheet hyperboloid.
(a) Calculate ∇f (1, 1).
(b) Find the slope of the line tangent to the level curve at (1, 1).
(c) Find the equation of the tangent line.
2x y 1
Solution. (a) fx (x, y) = √ , fy (x, y) = √ , then ∇f (1, 1) = ⟨1, ⟩
1 + 2x2 + y 2 1 + 2x2 + y 2√ 2
(b) Since f (1, 1) = 2, the level curve through (1, 1) is given as 1 + 2x2 + y 2 = 2 or 2x2 +y 2 = 3,
which is an ellipse. We find the slope of the tangent line to the level curve by taking d/dx to
dy dy 2x
the equation of the level curve: 4x + 2y = 0, therefore ∣ =− ∣ = −2
dx dx (1,1) y (1,1)
1
The tangent vector is T = ⟨1, −2⟩ or any of its scalar multiple. ∇f (1, 1)⋅T = ⟨1, ⟩⋅⟨1, −2⟩ = 0.
2
Orthogonality between ∇f and T verified.
(c) Equation of the tangent line at (1, 1) is fx (1, 1)(x−1)+fy (1, 1)(y−1) = 0, thus y = −2x+3
(slope= −2)
26
Gradient in Three Dimensions
Let w = f (x, y, z) be differentiable, the gradient of f is the vector function ∇f defined by
∂f ∂f ∂f
∇f (x, y, z) = i+ j+ k
∂x ∂y ∂z
The directional derivative of f at (x0 , y0 , z0 ) in the direction of a unit vector u = ⟨u1 , u2 , u3 ⟩ is
Du f (x0 , y0 , z0 ) = ∇f (x0 , y0 , z0 ) ⋅ u
Let w0 = f (x0 , y0 , z0 ), f (x, y, z) = w0 is a level surface of w = f (x, y, z) and the point (x0 , y0 , z0 )
is on the level surface. Then, ∇f (x0 , y0 , z0 ) is orthogonal to the level surface at (x0 , y0 , z0 ).
If x, y and z are differentiable functions of t and F is also differentiable, then we can use the
Chain Rule to differentiate both side of the above equation as
∂F dx ∂F dy ∂F dz
+ + = 0 or ∇F ⋅ r ′ (t) = 0
∂x dt ∂y dt ∂z dt
27
In particular, when t = t0 , ∇F (x0 , y0 , z0 ) ⋅ r ′ (t0 ) = 0. This means that at P , the gradient vector
∇F (x0 , y0 , z0 ) is perpendicular to the tangent vector r ′ (t0 ). Since the curve C is arbitrarily
defined, then, ∇F (x0 , y0 , z0 ) is orthogonal to all the tangent vectors to any curve on the surface
that passes through P . These tangent vectors line in the same plane, which is the tangent
plane to the surface S at P with a normal vector ∇F (x0 , y0 , z0 ). We can write the equation
of this tangent plane as
∇F (x0 , y0 , z0 ) ⋅ ⟨x − x0 , y − y0 , z − z0 ⟩ = 0
or
x2 y 2
EXAMPLE 1 F (x, y, z) = + + z 2 − 1 = 0 is an ellipsoid.
9 25
3
(a) Find the tangent plane at (0, 4, )
5
(b) At which points the tangent planes are horizontal?
3 2x 2y 8 6
Solution. (a) ∇F (0, 4, ) = ⟨ , , 2z⟩∣ = ⟨0, , ⟩
5 9 25 (0,4, 35 )
25 5
8 6 3
Therefore, the tangent plane is given by 0(x − 0) + (y − 4) + (z − ) = 0 or 4y + 15z = 25
25 5 5
(b) A horizontal tangent plane has a normal vector parallel to k, i.e., ∇F = ⟨0, 0, 2z⟩. Since
we are finding points on the surface, we have z = ±1. Therefore, at (0, 0, ±1), the tangent planes
are horizontal.
28
Tangent Plane to Explicitly Defined Surface z = f (x, y)
When a surface is explicitly given as z = f (x, y), the equation of a tangent plane is obtained by
defining a new function F (x, y, z) = f (x, y) − z = 0, which has the gradient vector ∇F (x, y, z) =
⟨fx (x, y), fy (x, y), −1⟩. Therefore the equation for the tangent plane at (x0 , y0 , z0 ), where z0 =
f (x0 , y0 ) is written as
or
EXAMPLE 2 Find the tangent plane to a elliptical paraboloid z = 32 − 3x2 − 4y 2 at (2, 1, 16)
Solution. fx = −6x and fy = −8y.
The tangent plane is z = (−12)(x − 2) + (−8)(y − 1) + 16 = 48 − 12x − 8y
Linear Approximation
The linear approximation to the surface z = f (x, y) at the point (x0 , y0 , f (x0 , y0 )) is the tangent
plane given by
29
5
EXAMPLE 3 Find the linear approximation to z = f (x, y) = at (−1, 2, 1)
x2 + y2
10x 10y
Solution. fx (x, y) = − , f y (x, y) = −
(x2 + y 2 )2 (x2 + y 2 )2
10(−1) 2 10(2) 4
fx (−1, 2) = − = , fy (−1, 2) = − =−
25 5 25 5
2 4 2 4
L(x, y) = (x + 1) − (y − 2) + 1 = x − y + 3
5 5 5 5
L(−1.05, 2.1) = 0.9 → good approximation for f (−1.05, 2.1) ≃ 0.9070295
DEFINITION Difference is the exact change in z between the points (x, y, z) and (x0 , y0 , z0 )
∆z = f (x, y) − f (x0 , y0 )
30
DEFINITION Local Maximum/Minimum Values
A function of two variables has a local maximum at (a, b) if f (x, y) ⩽ f (a, b) when (x, y)
is near (a, b). This means f (x, y) ⩽ f (a, b) for all points (x, y) in some disk with the center at
(a, b) in the domain of f . Then, f (a, b) is a local maximum value.
A function of two variables has a local minimum at (a, b) if f (x, y) ⩾ f (a, b) when (x, y)
is near (a, b). This means f (x, y) ⩾ f (a, b) for all points (x, y) in some disk with the center at
(a, b) in the domain of f . Then, f (a, b) is a local minimum value.
REMARK When finding local extrema, comparison between f (x, y) and f (a, b) is made in a
small neighborhood around (a, b).
THEOREM If f has a local maximum or minimum at (a, b), and fx and fy exist at (a, b),
then fx (a, b) = fy (a, b) = 0
PROOF Let g(x) = f (x, b) with y = b fixed. Since f has a local extrema at (a, b), we have
g ′ (a) = fx (a, b) = 0. Similarly, let h(y) = f (a, y) with x = a fixed, then, h′ (b) = fy (a, b) = 0.
1. fx (a, b) = fy (a, b) = 0
31
THEOREM Second Derivative Test
Suppose that the second partial derivatives of f are continuous throughout an open disk
centered at the point (a, b), where fx (a, b) = fy (a, b) = 0.
2
Let D(x, y) = fxx (x, y)fyy (x, y) − [fxy (x, y)]
1. If D(a, b) > 0 and fxx (a, b) < 0, then f has a local maximum value at (a, b)
2. If D(a, b) > 0 and fxx (a, b) > 0, then f has a local minimum value at (a, b)
EXAMPLE 2 Show that (0, 0) is a saddle point for f (x, y) = xy(x − 2)(y + 3)
Solution. (0, 0) is a critical point for f (see EXAMPLE 1)
fxx = 2y(y + 3), fyy = 2x(x − 2), fxy = fyx = 2(x − 1)(2y + 3)
Therefore fxx (0, 0) = fyy (0, 0) = 0, fxy (0, 0) = fyx (0, 0) = −6
D(0, 0) = −36 < 0, then (0, 0) is a saddle point
32
EXAMPLE 4 Show that (0, 0) is a saddle point of f (x, y) = x4 + y 4 − 4xy + 1. Sketch the level
curves near the saddle point.
Solution. fx = 4x3 − 4y, fy = 4y 3 − 4x, fxx = 12x2 , fyy = 12y 2 , fxy = fyx = −4
Since fx (0, 0) = fy (0, 0) = 0, (0, 0) is a critical point. Moreover, D(0, 0) = −16 < 0, therefore
(0, 0) is a saddle point.
The graph and level curves of f are shown below. Level curves are crossed at the saddle
point.
3. The greatest function value found in step 1 and 2 is the absolute maximum value of f ,
and the least function value found in step 1 and 2 is the minimum value of f
EXAMPLE 5 Find the absolute maximum and minimum values of f (x, y) = x2 +y 2 −2x+2y +5
on R = {(x, y) ∣ x2 + y 2 ⩽ 4}
Solution. We first find the critical points from fx = 2x − 2 = 0 and fy = 2y + 2 = 0. Therefore,
(1, −1) is the only critical point in R, at which f (1, −1) = 3.
Second, we find the extrema on the boundary of R where x2 + y 2 = 4. The boundary
can be parametrized by x = 2 cos t, y = 2 sin t for t ∈ [−π, π]. Then, on the boundary of R,
g(t) = f (x(t), y(t)) = 4 cos2 t + 4 sin2 t − 4 cos t + 4 sin t + 5 = 9 − 4 cos t + 4 sin t.
d π
Extrema on the boundary of R occur when g(t) = 4 sin t + 4 cos t = 0, i.e., t = − and
dt 4
3π √ √ √
t= . Then, the extrema are obtained as f (x(−π/4), y(−π/4)) = f ( 2, − 2) = 9 − 4 2 and
4 √ √ √
f (x(3π/4), y(3π/4)) = f (− 2, 2) = 9 + 4 2
Finally, we compare
33
f (1,
√ −1)√ =3 √ → absolute minimum
f( √ 2, −√2) = 9 − 4√2
f (− 2, 2) = 9 + 4 2 → absolute maximum
34