0% found this document useful (0 votes)
20 views80 pages

MA2104 Week 03

Uploaded by

gordenpey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views80 pages

MA2104 Week 03

Uploaded by

gordenpey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

MA2104 Week 3

1 Partial derivatives
Tangent planes
Differentiability & Linear approximations

2 Chain Rule
Implicit differentiation

3 Directional derivatives

1/80
Partial derivatives

Recall that for a function f of a single variable, we define the


derivative function as

f (x + h) − f (x)
f ′ (x) = lim
h→0 h

To extend this to multivariable functions, the idea is to ‘vary’ one


variable and keep other variable(s) fixed.

2/80
Partial derivatives

Definition 1 (Partial Derivative)


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

Other notations:
∂f
fx = .
∂x
∂f
fy = .
∂y
3/80
Partial derivatives

Example 1
For f (x, y ) = exy + yx , compute fx and fy .

Solution. Treating y as a constant, we have

1
fx (x, y ) = yexy + .
y

Treating x as a constant, we have


x
fy (x, y ) = xexy − .
y2

4/80
Partial derivatives

Geometric interpretation of partial derivatives:

Consider the surface S given by the equation z = f (x, y).

5/80
Partial derivatives

The curve C1 is the graph of the function g(x) = f (x, b).

The slope of its tangent T1 at P is: g ′ (a) = fx (a, b).

6/80
Partial derivatives

The curve C2 is the graph of the function h(x) = f (a, y ).

The slope of its tangent T2 at P is: h′ (b) = fy (a, b).

7/80
Partial derivatives

For functions of more than two variables, such as


w = f (x, y, z), we can similarly define

∂f ∂w
fx = =
∂x ∂x
∂f ∂w
fy = =
∂y ∂y
∂f ∂w
fz = = .
∂z ∂z

8/80
Partial derivatives

If f is a function of two variables, then its partial derivatives fx


and fy are also functions of two variables.

So, we can consider their partial derivatives

(fx )x , (fx )y , (fy )x , (fy )y .

These are called the second partial derivatives of f .

9/80
Partial derivatives

If z = f (x, y ), we use the following notation:


∂2f ∂2z
(fx )x = fxx = ∂x 2
= ∂x 2
∂2f ∂2z
(fx )y = fxy = ∂y∂x = ∂y∂x
∂2f ∂2z
(fy )x = fyx = ∂x∂y = ∂x∂y
∂2f ∂2z
(fy )y = fyy = ∂y 2
= ∂y 2

Thus, the notation fxy means that we first differentiate with


respect to x and then with respect to y .

10/80
Partial derivatives

Example 2
Find all second-order partial derivatives of
f (x, y ) = x 2 y − y 3 + ln x.

Solution. First, we compute the first-order derivatives:

1
fx = 2xy + ,
x
fy = x 2 − 3y 2 .

11/80
Partial derivatives

Then we have
∂ 1 1

fxx = ∂x 2xy + x = 2y − x2
,
∂ 1

fxy = ∂y 2xy + x = 2x,

x 2 − 3y 2

fyx = ∂x = 2x,

x 2 − 3y 2

fyy = ∂y = −6y.

12/80
Partial derivatives

Notice fxy = fyx in the preceding example. This is not a


coincidence.

Theorem 2 (Clairaut’s Theorem)


Suppose f is defined on a disk D that contains (a, b). If the
functions fxy and fyx are both continuous on D, then

fxy (a, b) = fyx (a, b).

13/80
Partial derivatives

Using Clairaut’s Theorem, it can be shown that (see Tutorial)

fxyy = fyxy = fyyx .


In fact, so long as the number of the same variable occurring in
the subscript are the same, the corresponding partial
derivatives are the same.

For example: for f (x, y , z), we have

fxxyyyzz = fxzxzyyy = fyzyzyxx = · · · .

14/80
Tangent planes

Recall that we can use the derivative f ′ (a) to get the tangent
line to the curve y = f (x) at x = a:

y = f (a) + f ′ (a)(x − a).


The same idea applies to find tangent plane equations.

15/80
Tangent planes

The tangent plane to the surface S at the point P is defined to


be the plane that contains both tangent lines T1 and T2 .

16/80
Tangent planes

Recall that any plane passing through P(a, b, c) has an


equation of the form

n · ⟨x − a, y − b, z − c⟩ = 0
where n is a vector normal to the plane.

17/80
Tangent planes

Finding a normal vector n:


A vector with the same direction as T1 is

⟨1, 0, fx (a, b)⟩.

A vector with the same direction as T2 is

⟨0, 1, fy (a, b)⟩.

18/80
Tangent planes

A vector normal to the plane is given by the cross product:

⟨0, 1, fy (a, b)⟩ × ⟨1, 0, fx (a, b)⟩ = ⟨fx (a, b), fy (a, b), −1⟩.

19/80
Tangent planes

Theorem 3 (Equation of Tangent Plane)


Suppose f (x, y ) has continuous first partial derivatives at (a, b).
A normal vector to the tangent plane is

⟨fx (a, b), fy (a, b), −1⟩.


Further, an equation of the tangent plane is given by

fx (a, b)(x − a) + fy (a, b)(y − b) − (z − f (a, b)) = 0


or

z = f (a, b) + fx (a, b)(x − a) + fy (a, b)(y − b).

20/80
Tangent planes

Example 3
Find the tangent plane to the elliptic paraboloid z = 2x 2 + y 2 at
the point (1, 1, 3).

Solution. Notice

fx (x, y) = 4x, fx (1, 1) = 4,

fy (x, y) = 2y, fy (1, 1) = 2.


The equation of the plane is

z = f (1, 1) + 4(x − 1) + 2(y − 1),

z = 4x + 2y − 3.
21/80
Tangent planes

The figure shows the elliptic paraboloid and its tangent plane at
(1, 1, 3) that we found in the preceding example


22/80
Differentiability & Linear approximations

Definition 4 (Increment)
Let z = f (x, y). Suppose △x and △y are increments in the
independent variable x and y respectively from a fixed point
(a, b).
Then the increment in z at (a, b) is defined by

△z = f (a + △x, b + △y ) − f (a, b).

23/80
Differentiability & Linear approximations

Example 4
Let z = 2x 2 − xy. Find △z at (x, y).

Solution.

△z = f (x + △x, y + △y) − f (x, y)


 
= 2(x + △x)2 − (x + △x)(y + △y) − (2x 2 − xy)
= (4x − y )△x − x△y + 2(△x)2 − △x△y.

24/80
Differentiability & Linear approximations

For single-variable function f (x), we say that f is differentiable


at a if and only if f ′ (a) exists.

However, for functions of more than one variables, existence of


partial derivatives DOES NOT imply differentiability!!

25/80
Differentiability & Linear approximations

Here is an informal definition of differentiability:

Definition 5
We say that f is differentiable at (a, b) if the tangent plane at
(a, b) is a good approximation to f at points close to (a, b).

How good is good???

26/80
Differentiability & Linear approximations

Here is a formal definition of differentiability:

Definition 6 (Differentiability - Two Variable)


Let z = f (x, y). We say that f is differentiable at (a, b) if we can
write

△z = fx (a, b)△x + fy (a, b)△y + ϵ1 △x + ϵ2 △y

where ϵ1 and ϵ2 are functions of △x and △y and ϵ1 , ϵ2 → 0 as


(△x, △y ) → (0, 0).

We say that f is differentiable on a region R ⊆ R2 if f is


differentiable at every point in R.

27/80
Differentiability & Linear approximations

Example 5
Using the formal definition, show that z = f (x, y) = 2x 2 − xy is
differentiable on the entire xy-plane.

Solution. Let (x, y ) be a point in the plane. By Example 4,

△z = (4x − y)△x − x△y + 2(△x)2 − △x△y.

28/80
Differentiability & Linear approximations

Since fx = 4x − y and fy = −x, we can express

△z = fx △x + fy △y + ϵ1 △x + ϵ2 △y
where
ϵ1 = 2△x and
ϵ2 = −△x.

Since ϵ1 → 0 and ϵ2 → 0 as (△x, △y) → (0, 0), it follows that f


is differentiable at (x, y).

29/80
Differentiability & Linear approximations

The following is an immediate consequence of differentiability:

Theorem 7
Suppose z = f (x, y) is differentiable at (a, b). Let △x and △y
be small increments in x and y respectively from (a, b).

Then

△z ≈ fx (a, b)△x + fy (a, b)△y.

30/80
Differentiability & Linear approximations

The preceding theorem says that if △x, △y are small, then


(provided f (x, y) is differentiable)

△z ≈ fx (a, b)△x + fy (a, b)△y.


and so

f (a + △x, b + △y) ≈ f (a, b) + fx (a, b)△x + fy (a, b)△y .


| {z }
tangent plane

As △x, △y → 0, tangent plane gets closer and closer to the


surface!
31/80
Differentiability & Linear approximations

In a similar manner, if △x, △y and △z are small, then


(provided f (x, y, z) is differentiable)

f (a + △x, b + △y , c + △z) ≈
f (a, b, c) + fx (a, b, c)△x + fy (a, b, c)△y + fz (a, b, c)△z.

This procedure is called Linear Approximation.

32/80
Differentiability & Linear approximations

Example 6
The base radius and height of a circular cone are measured as
10cm and 25cm respectively, with a possible error in
measurement of as much as 0.1cm in each.

Using linear approximation, estimate the magnitude of


maximum error in the calculated volume of the cone.

33/80
Differentiability & Linear approximations

Solution. The volume of the cone is V = πr 2 h/3. So

2πrh πr 2
△V ≈ Vr △r + Vh △h = △r + △h.
3 3

Since each error is at most 0.1cm, we can take dr = 0.1 and


dh = 0.1 along with r = 10, h = 25 to give

500π 100π
dV = (0.1) + (0.1) = 20π.
3 3
The maximum error required is 20πcm3 . ■

34/80
Differentiability & Linear approximations

Some useful facts regarding partial derivatives and


differentiability:

' $

fx and fy continuous =⇒ f differentiable.

fx and fy continuous ̸⇐= f differentiable.


& %

35/80
Differentiability & Linear approximations

' $

f differentiable =⇒ f continuous.

f differentiable ̸⇐= f continuous.


& %

36/80
Differentiability & Linear approximations

' $

fx and fy exist ̸=⇒ f differentiable.

fx and fy exist ⇐= f differentiable.


& %

37/80
Differentiability & Linear approximations

Example 7
Let f be the function on R2 defined by
(
xy
x 2 +y 2
if (x, y) ̸= (0, 0),
f (x, y ) =
0 if (x, y) = (0, 0).

(a) Compute the following partial derivatives using the


definition:
fx (0, 0), fy (0, 0).
(b) Is the function f (x, y) differentiable at (0, 0)? Justify your
answer.

38/80
Differentiability & Linear approximations

Solution.

(a)

f (0 + h, 0) − f (0, 0)
fx (0, 0) = lim
h→0 h
h·0
2 2 − 0
= lim h +0
h→0 h
0
= lim
h→0 h
= 0.

Likewise,
fy (0, 0) = 0.

39/80
Differentiability & Linear approximations

(b) Consider the limit


xy
lim f (x, y) = lim .
(x,y)→(0,0) (x,y)→(0,0) x 2 + y2

Along x = 0, the limit is 0.


Along x = y, the limit is 12 .

Thus, the function f does not have a limit at (0, 0), so f is not
continuous at (0, 0), let alone be differentiable! ■

40/80
Chain Rule

Recall: Chain Rule for functions of one variable:

If y = f (x) and x = g(t), where f and g are differentiable


functions, then y is indirectly a differentiable function of t, and

dy dy dx
= .
dt dx dt

41/80
Chain Rule

Theorem 8 (The Chain Rule - Case 1)


Suppose that z = f (x, y ) is a differentiable function of x and y ,
where x = g(t) and y = h(t) are both differentiable functions of
t. Then, z is a differentiable function of t and
dz ∂f dx ∂f dy
= + .
dt ∂x dt ∂y dt

42/80
Chain Rule

Example 8
For z = f (x, y ) = x 2 ey , x = g(t) = t 2 − 1 and y = h(t) = sin t,
find the derivative dz
dt .

Solution. First, compute the partial derivatives:


∂z ∂z
= 2xey , = x 2 ey .
∂x ∂y

Next, compute the derivatives:

dx dy
= 2t, = cos t.
dt dt

43/80
Chain Rule

Therefore, using the chain rule

dz ∂z dx ∂z dy
= +
dt ∂x dt ∂y dt

= 2xey (2t) + x 2 ey cos t

= 2(t 2 − 1)esin t (2t) + (t 2 − 1)2 esin t cos t.

44/80
Chain Rule

Notice, in the preceding example, you could have first


substituted for x and y and then compute the derivative of

f (g(t), h(t)) = (t 2 − 1)2 esin t


using the usual rules of differentiation for functions of a single
variable.

45/80
Chain Rule

Theorem 9 ( Chain Rule - Case 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 both differentiable
functions of s and t. Then,
∂z ∂f ∂x ∂f ∂y
= + ,
∂s ∂x ∂s ∂y ∂s

∂z ∂f ∂x ∂f ∂y
= + .
∂t ∂x ∂t ∂y ∂t

46/80
Chain Rule

Case 2 of the Chain Rule contains three types of variables:

s and t are independent variables.

x and y are called intermediate variables.

z is the dependent variable.

47/80
Chain Rule

Example 9
∂z ∂z
If z = ex sin y , where x = st 2 and y = s2 t, find ∂s and ∂t .

Solution. Applying Case 2 of Chain Rule,

∂z ∂z ∂x ∂z ∂y
= +
∂s ∂x ∂s ∂y ∂s

= (ex sin y)(t 2 ) + (ex cos y )(2st)


2 2
= t 2 est sin(s2 t) + 2stest cos(s2 t).

48/80
Chain Rule

∂z ∂z ∂x ∂z ∂y
= +
∂t ∂x ∂t ∂y ∂t

= (ex sin y)(2st) + (ex cos y)(s2 )


2 2
= 2stest sin(s2 t) + s2 est cos(s2 t).

49/80
Chain Rule

To remember the Chain Rule, it is helpful to draw a tree


diagram, as follows.

We draw branches from the dependent variable z to the


intermediate variables x and y to indicate that z is a function of
x and y.

50/80
Chain Rule

Then, we draw branches from x and y to the independent


variables s and t. On each branch, we write the corresponding
partial derivative.

51/80
Chain Rule

To find ∂z
∂s , we find the product of the partial derivatives along
each path from z to s and then add these products:

∂z ∂z ∂x ∂z ∂y
= + .
∂s ∂x ∂s ∂y ∂s

∂z
Similarly, we find ∂t by using the paths from z to t.

52/80
Chain Rule

Theorem 10 (The Chain Rule - General Version)


Suppose that u is a differentiable function of n variables x1 , . . . ,
xn , and each xj is a differentiable function of m variables
t1 , . . . , tm . Then u is a function of t1 , . . . , tm and
∂u ∂u ∂x1 ∂u ∂x2 ∂u ∂xn
= + + ··· +
∂ti ∂x1 ∂ti ∂x2 ∂ti ∂xn ∂ti

for each i = 1, . . . , m.

53/80
Chain Rule

Example 10
Write out the Chain Rule for the case where w = f (x, y , z, t)
and x = x(u, v ), y = y(u, v ), z = z(u, v ), t = t(u, v ).

54/80
Chain Rule

∂w ∂w ∂x ∂w ∂y ∂w ∂z ∂w ∂t
= + + + .
∂u ∂x ∂u ∂y ∂u ∂z ∂u ∂t ∂u

55/80
Chain Rule

∂w ∂w ∂x ∂w ∂y ∂w ∂z ∂w ∂t
= + + + .
∂v ∂x ∂v ∂y ∂v ∂z ∂v ∂t ∂v

56/80
Chain Rule

Example 11
If w = f (x 2 − y 2 , y 2 − x 2 ) and f is differentiable, show that

∂w ∂w
y +x = 0.
∂x ∂y

57/80
Chain Rule

Solution. Introduce intermediate variables:

u = x 2 − y 2, v = y 2 − x 2.

Using Chain Rule,

∂w ∂w ∂u ∂w ∂v ∂w ∂w
= + = (2x) + (−2x)
∂x ∂u ∂x ∂v ∂x ∂u ∂v
and
∂w ∂w ∂u ∂w ∂v ∂w ∂w
= + = (−2y) + (2y)
∂y ∂u ∂y ∂v ∂y ∂u ∂v

58/80
Chain Rule

Therefore
∂w ∂w
y +x
∂x ∂y
   
∂w ∂w ∂w ∂w
= (2xy) + (−2xy) + (−2xy) + (2xy) = 0.
∂u ∂v ∂u ∂v

59/80
Implicit differentiation

Consider a surface defined by an equation

F (x, y , z) = 0

where F (x, y, z) is differentiable.

Suppose z is implicitly defined as a function of independent


variables x and y: for every choice of x and y , there is a unique
z such that F (x, y, z) = 0.

∂z
How to compute ??
∂x

60/80
Implicit differentiation

Idea: Use Chain Rule to differentiate the equation


F (x, y , z) = 0 with respect to x:

∂F ∂F ∂F ∂z
+ + = 0. (why?)
∂x ∂y ∂z ∂x

61/80
Implicit differentiation

∂F
Therefore, if ̸= 0, then
∂z
∂F
∂z ∂x Fx
= − ∂F =− .
∂x ∂z
Fz

62/80
Implicit differentiation

Theorem 11 (Implicit Differentiation: Two Independent


Variables)
Suppose the equation F (x, y, z) = 0, where F is differentiable,
defines z implicitly as a differentiable function of x and y . Then,

∂z Fx (x, y, z) ∂z Fy (x, y, z)
=− , =−
∂x Fz (x, y , z) ∂y Fz (x, y , z)

provided Fz (x, y, z) ̸= 0.

63/80
Implicit differentiation

Example 12
∂z
Find ∂x if
x 3 + y 3 + z 3 + 6xyz = 1.

Solution. Let F (x, y , z) = x 3 + y 3 + z 3 + 6xyz − 1. Then

Fx = 3x 2 + 6yz, Fz = 3z 2 + 6xy.

Therefore, by the Implicit Differentiation Theorem,

∂z Fx 3x 2 + 6yz
=− =− 2 .
∂x Fz 3z + 6xy

64/80
Directional derivatives

Facing east (in the direction of positive x-axis), the slope is


∂f
given by the partial derivative ∂x .

Facing north (in the direction of positive y-axis), the slope is


∂f
given by the partial derivative ∂y .

How to compute the slope when you are facing any given
direction, say north-east?

65/80
Directional derivatives

Definition 12 (Directional derivative)


The directional derivative of f (x, y ) at (x0 , y0 ) in the direction of
unit vector u = ⟨a, b⟩ is

f (x0 + ha, y0 + hb) − f (x0 , y0 )


Du f (x0 , y0 ) = lim
h→0 h
provided this limit exists.

66/80
Directional derivatives

67/80
Directional derivatives

' $

The directional derivative Du f (x0 , y0 ) is


the rate of change of the function at the
point (x0 , y0 ) in the direction given by u:
& %

68/80
Directional derivatives

Du f (x0 , y0 ) > 0

69/80
Directional derivatives

Du f (x0 , y0 ) < 0

70/80
Directional derivatives

• if u = i = ⟨1, 0⟩ then
Di f = fx .
• if u = j = ⟨0, 1⟩ then
Dj f = fy .

The partial derivatives of f with respect to x and y are just


special cases of the directional derivative.

71/80
Directional derivatives

Theorem 13 (Computing Directional Derivative)


If f (x, y) is a differentiable function, 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.

We can rewrite it in terms of vectors:

Du f (x, y) = ⟨fx , fy ⟩ · ⟨a, b⟩ = ⟨fx , fy ⟩ · u.

72/80
Directional derivatives

Proof. Define

g(h) = f (x0 + ah, y0 + bh).


Note that

f (x0 + ah, y0 + bh) − f (x0 , y0 )


Du f (x0 , y0 ) = lim
h→0 h
g(h) − g(0)
= lim
h→0 h
= g ′ (0).

73/80
Directional derivatives

Set x = x0 + ah, y = y0 + bh.

We can compute g ′ (h) using the Chain Rule:

∂f dx ∂f dy
g ′ (h) = + = fx (x, y)a + fy (x, y )b.
∂x dh ∂y dh

Substituting h = 0:

g ′ (0) = fx (x0 , y0 )a + fy (x0 , y0 )b.


Hence

Du f (x0 , y0 ) = g ′ (0) = fx (x0 , y0 )a + fy (x0 , y0 )b.


74/80
Directional derivatives

The vector ⟨fx , fy ⟩ is so important that we will give it a special


name.
Definition 14 (Gradient)
The gradient of f (x, y) is the vector-valued function

∂f ∂f
▽f (x, y) = ⟨fx , fy ⟩ = fx i + fy j = i+ j
∂x ∂y

provided both partial derivatives exist.

75/80
Directional derivatives

▽f is read ‘del f ’.

With this notation, we have

Du f (x, y ) = ▽f (x, y ) · u

76/80
Directional derivatives

Example 13
Find the directional derivative of the function
f (x, y ) = x 2 y 3 − 4y at the point (2, −1) in the direction of the
vector v = 2i + 5j.

Solution. First compute the gradient vector at (2, −1):

▽f (x, y ) = 2xy 3 i + (3x 2 y 2 − 4)j

▽f (2, −1) = −4i + 8j.

77/80
Directional derivatives

Notice v is NOT a unit vector. The unit vector in the direction of


v is

v 2 5
u= = √ i + √ j.
||v|| 29 29
Therefore

Du f (2, −1) = ▽f (2, −1) · u


2 5
= ⟨−4, 8⟩ · ⟨ √ , √ ⟩
29 29
32
= √ .
29

78/80
Directional derivatives

The idea can be easily extended to 3D:

Definition 15 (3-D Directional Derivative)


The directional derivative of f (x, y , z) at (x0 , y0 , z0 ) in the
direction of unit vector u = ⟨a, b, c⟩ is

f (x0 + ha, y0 + hb, z0 + hc) − f (x0 , y0 , z0 )


Du f (x0 , y0 , z0 ) = lim
h→0 h
provided this limit exists.

79/80
Directional derivatives

As in the 2D case, we compute 3D-directional derivative using


the gradient vector.

Theorem 16 (Computing 3-D Directional Derivative)

Du f (x0 , y0 , z0 ) = ▽f (x, y, z) · u
where
∂f ∂f ∂f
▽f = ⟨fx , fy , fz ⟩ = i+ j+ k
∂x ∂y ∂z
is the gradient vector.

80/80

You might also like