2E02 Partial Derivatives
2E02 Partial Derivatives
Figure 1: b is the base length of the triangle, h is the height of the triangle, H is the height of
the cylinder.
(x,y,z)
(x,y) f f
x y w
x z
2
Examples. Find the natural domain of f , identify the graph of f as
a surface in 3-space and sketch it.
1. f (x, y) = 0;
2. f (x, y) = 1;
3. f (x, y) = x;
4. f (x, y) = ax + by + c;
5. f (x, y) = x2 + y 2;
p
6. f (x, y) = 1 − x2 − y 2;
p
7. f (x, y) = 1 + x2 + y 2;
p
8. f (x, y) = x2 + y 2 − 1;
p
9. f (x, y) = − x2 + y 2;
3
2 Level curves
4
Examples.
1. f (x, y) = ax + by + c;
2. f (x, y) = x2 + y 2;
p
3. f (x, y) = 1 − x2 − y 2;
p
4. f (x, y) = 1 + x2 + y 2;
p
5. f (x, y) = x2 + y 2 − 1;
p
6. f (x, y) = − x2 + y 2;
5
There is no “direct” way to graph a function of three variables. The
graph would be a curved 3-dimensional space ( a 3-dim manifold if it
is smooth), in 4-space. But f (x, y, z) = k defines a surface in 3-space
which we call the level surface with constant k.
Examples.
1. f (x, y, z) = x2 + y 2 + z 2;
2. f (x, y, z) = z 2 − x2 − y 2;
6
3 Limits and Continuity
1.0
0.8
f(x)
0.6
0.4
0.2
a x
0.5 1.0 1.5 2.0
1.5 C5
1.0 C6 (x,y) C4
0.5 C3
(a,b)
C1
x
0.5 1.0 1.5 2.0
C2
For z = f (x, y) there are infinitely many curves along which one can
approach (a, b).
This leads to the notion of the limit of f (x, y) along a curve C.
If all these limits coincide then f (x, y) has a limit at (a, b), and the
limit is equal to f (a, b) then f is continuous at (a, b).
7
4 Partial Derivatives
f(x)
(a,f(a))
x
a
∂x ∂y
If f (x, y) = x then = 1 , and if f (x, y) = y then =0
∂x ∂x
8
Geometrically, given the surface z = f (x, y), we consider its intersec-
tion with the plane y = b which is a curve. This curve is the graph of
the function f (x, b), and therefore the partial derivative fx(a, b) is the
slope of the tangent line to the curve at (a, b, f (a, b))
9
Similarly, if we fix x = a where a is a number from the domain of f
then f (a, y) is a function of a single variable y and we can calculate
its derivative at some y = b. This derivative is called the partial
derivative of f (x, y) with respect to y at (a, b) and is denoted by
∂f (a, b)
fy (a, b) or by
∂y
∂f (a, b) d
f (a, b + h) − f (a, b)
fy (a, b) = = f (a, y) = lim
∂y dy y=b h→0 h
∂x ∂y
If f (x, y) = x then = 0 , and if f (x, y) = y then =1
∂y ∂y
The intersection of the surface z = f (x, y) with the plane x = a is
a curve which is the graph of the function f (a, y), and therefore the
partial derivative fy (a, b) is the slope of the tangent line to the curve
at (a, b, f (a, b))
Example.
p
3
2x2 − 3xy 2 + 3 cos(2x + 3y) − 3y 3 + 18
z = f (x, y) = ln
2
Find fx(x, y), fy (x, y), f (3, −2), fx(3, −2), fy (3, −2)
For w = f (x, y, z) there are three partial derivatives fx(x, y, z), fy (x, y, z),
fz (x, y, z)
Example.
p
f (x, y, z) = z 2 + y − x + 2 cos(3x − 2y)
Find
fx(x, y, z), fy (x, y, z), fz (x, y, z),
f (2, 3, −1), fx(2, 3, −1), fy (2, 3, −1), fz (2, 3, −1)
11
In general, for w = f (x1, x2, . . . , xn) there are n partial derivatives:
∂w ∂w ∂w
, , ... ,
∂x1 ∂x2 ∂xn
Example. q
r= x21 + x22 + · · · + x2n
Find
∂r ∂r ∂r ∂r ∂r
, , , , , n ≥ 9, i ≤ n
∂x1 ∂x2 ∂x9 ∂xi ∂xn−1
Notation
2 2
∂ f ∂ ∂f ∂ f ∂ ∂f
fxx = = , fxy = =
∂x2 ∂x ∂x ∂y∂x ∂y ∂x
∂ 2f ∂ 2f
∂ ∂f ∂ ∂f
fyx = = , fyy = 2 =
∂x∂y ∂x ∂y ∂y ∂y ∂y
fxy and fyx are called the mixed second-order partial
derivatives. fx and fy can be called first-order partial derivative.
12
Example.
π π
z = 2ey− 2 sin x − 3ex− 4 cos y
Find
∂z ∂z ∂ 2z ∂ 2z ∂ 2z ∂ 2z
, , , , , ,
∂x ∂y ∂x2 ∂x∂y ∂y 2 ∂y∂x
∂z π π ∂z π π ∂ 2z π π ∂ 2z π π
( , ), ( , ), ( , ), ( , )
∂x 4 2 ∂y 4 2 ∂x∂y 4 2 ∂y∂x 4 2
Higher-order derivatives
13
5 Differentiability, differentials and local linearity
For f (x, y), the symbol ∆f , called the increment of f , denotes the
change
∆f = f (a + ∆x, b + ∆y) − f (a, b)
For small ∆x, ∆y
∆f ≈ fx(a, b)∆x + fy (a, b)∆y
Definition. A function f (x, y) is said to be differentiable at (a, b)
provided fx(a, b) and fy (a, b) both exist and
For f (x, y, z)
∆f = f (a + ∆x, b + ∆y, c + ∆z) − f (a, b, c)
For small ∆x, ∆y, ∆z
∆f ≈ fx(a, b, c)∆x + fy (a, b, c)∆y + fz (a, b, c)∆z
and f (x, y, z) is differentiable at (a, b, c) if
15
6 The Chain Rule
Recall
dy dy dx
y = f (x(t)) ⇒ =
dt dx dt
because
dy dx
∆y ≈ ∆x , ∆x ≈ ∆t
dx dt
p
Example. z = 4 − x2 − y 2, x = 1 + cos t, y = sin t
16
Similarly, if w = f (x, y, z) and x = x(t), y = y(t), z = z(t). Then
w = f (x(t), y(t), z(t)) is a function of the single variable t, and
dw ∂w dx ∂w dy ∂w dz
= + +
dt ∂x dt ∂y dt ∂z dt
In general, if w = f (x1, x2, . . . , xn) and x1 = x1(t), x2 = x2(t), ... ,
xn = xn(t), then
n
dw ∂w dx1 ∂w dx2 ∂w dxn X ∂w dxi
= + + ··· =
dt ∂x1 dt ∂x2 dt ∂xn dt i=1
∂xi dt
Implicit differentiation
Find dy/dx.
17
The chain rule for partial derivatives
4. Let w = f (x1, ..., xn) and x1 = x1(u1, ..., um), ... , xn = xn(u1, ..., um)
n
∂w X ∂w ∂xi
= , α = 1, . . . , m
∂uα i=1
∂x i ∂u α
18
∂z ∂z
Example. Find ∂u and ∂v where
x
z = cos sin 2y ; x = 3u − 2v , y = u2 − 2v 3
2
∂ 2u 2
2∂ u
−c =0
∂t2 ∂x2
Show that
19
7 Directional Derivatives and Gradients
20
Generalisation to f (x, y, z) (and f (x1, . . . , xn)) is straightforward.
d
D~uf (a, b, c) = [f (a + s u1 , b + s u2 , c + s u3)]
ds s=0
= fx(a, b, c) u1 + fy (a, b, c) u2 + fz (a, b, c) u3
21
The gradient
Note that
D~uf = fx u1 + fy u2 + fz u3 = (fx ~i + fy ~j + fz ~k) · (u1 ~i + u2 ~j + u3 ~k)
In particular
~ (a, b)·~u ,
D~uf (a, b) = ∇f ~ (a, b, c)·~u ,
D~uf (a, b, c) = ∇f ~ ·~u
D~uf = ∇f
~ r =
p
Example. Find ∇r; x2 + y 2 + z 2 and D~ur(1, 1, 1) in the
direction of ~a = ~i + 2 ~j + 2 ~k.
22
Properties of the gradient
~ (a, b) · ~u = |∇f
D~uf (a, b) = ∇f ~ (a, b)| |~u| cos θ = |∇f
~ (a, b)| cos θ
23
~ (x1, . . . , xn)| cos θ, these properties
Since D~uf (x1, . . . , xn) = |∇f
hold for functions of any number of variables.
24
Gradients are normal to level curves and level surfaces
dx dy
T~ (s) = ~i + ~j
ds ds
Since f (x, y) is constant on C we expect DT~ f (x, y) = 0. Indeed
25
Definition. A vector is called normal to a surface at (a, b, c) if it is
normal to a tangent vector to any curve on the surface through (a, b, c).
dx dy dz
T~ (s) = ~i + ~j + ~k
ds ds ds
and DT~ F (x, y, z) is
dx dy dz d ~ ⊥ T~
= Fx + Fy + Fz = F (x(s), y(s), z(s)) = 0 ⇒ ∇F
ds ds ds ds
26
Tangent planes
Consider a level surface σ: F (x, y, z) = k,
and let P = (a, b, c) belong to σ.
~ (a, b, c) is normal to tangent
Since ∇F
vectors to curves on σ through P ,
all these tangent vectors belong to one
and the same plane.
This plane is called the tangent plane
to the surface σ at P .
To find an equation of the tangent plane
we use that if we know a vector ~n normal
to a plane through a point ~r0 = a~i + b ~j + c ~k
then an equation of the plane is
~n · (~r − ~r0) = 0 ⇔ n1(x − a) + n2(y − b) + n3(z − c) = 0
because ~r − ~r0 is parallel to the plane and therefore normal to ~n.
Choosing ~n = ∇F~ (a, b, c), we get the equation of the tangent plane to
the level surface σ at P = (a, b, c)
28
8 Maxima and minima of functions of two variables
Definition. A function f
of two variables is said to have a
relative maximum (minimum)
at a point (a, b) if there is a disc
centred at (a, b) such that
f (a, b) ≥ f (x, y) (f (a, b) ≤ f (x, y))
for all points (x, y) that lie inside
the disc.
A function f is said to have an
absolute maximum (minimum)
at (a, b) if
f (a, b) ≥ f (x, y) (f (a, b) ≤ f (x, y))
for all points (x, y) that lie inside
in the domain of f .
If f has a relative (absolute)
maximum or minimum at (a, b)
then we say that f has a relative
(absolute) extremum at (a, b).
relative ↔ local
29
The extreme-value theorem. If f (x, y) is continuous on a closed
and bounded set R, then f has both absolute maximum and an abso-
lute minimum on R.
Example. f (x, y) = y 2 − x2 is a
hyperbolic paraboloid.
fx = −2x, fy = 2y ⇒ (0, 0) is critical
but it is not a relative extremum.
It is a saddle point.
30
We say that a surface z = f (x, y) has a saddle point at (a, b) if
there are two distinct vertical planes through this point such that the
trace of the surface in one of the planes has a relative maximum at
(a, b), and the trace in the other has a relative minimum at (a, b).
Example.
31
The second partials test
Example.
f (x, y) = x4 − x2y + y 2 − 3y + 4
Example.
f (x, y) = 3x + 6y − 3xy − 7 , R is the triangle (0, 0), (0, 3), (5, 0)
32
Lagrange multipliers
~ (a, b) = λ ∇g(a,
∇f ~ b)
d ∂f 0 ∂f 0
f (x(t), y(t)) = x + y
dt ∂x ∂y
= ∇f~ · (x0 ~i + y 0 ~j) = ∇f
~ · T~
~ and ∇g
Thus, both ∇f ~ are ⊥ to T~ .
33
In general, we introduce a Lagrange multiplier λα for each of the con-
straint gα , and the equations are
m
X
~ =
∇f ~ α.
λα ∇g
α=1
34