MH1811 Mathematics 2
Gradient Vectors: Orthogonality & Applications
Main instructor — Dr Duzhin Fedor, slides mostly developed
by Dr Tan Geok Choo
Division of Mathematical Sciences
School of Physical and Mathematical Sciences
Nanyang Technological University
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
1 / 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
2 / 82
Recall: Gradient Vector
Recall that for a function f (x, y ), the the gradient of f , ∇f , is
∂f ∂f
∇f (x, y ) = (fx (x, y ) , fy (x, y )) = i+ j,
∂x ∂y
whereas for a function F (x, y , z) of three variables x, y and z,
the gradient of F is
∇F (x, y , z) = (Fx , Fy , Fz ) .
In this section, we shall discuss the orthogonal property of
gradient vector to its level curve or surface. It is used in
describing equation of tangent planes. Hence, it is applied to
estimating errors and linear approximations.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
3 / 82
Gradient Vector Perpendicular to Level
Curve.
Proposition
Consider the 2-variable function f (x, y ) and the level curve
defined by f (x, y ) = k . Suppose P0 (x0 , y0 ) is a point on this level
curve, i.e., f (x0 , y0 ) = k .
Then the gradient vector ∇f (P0 ) is orthogonal (perpendicular) to
the tangent of the level curve f (x, y ) = k at P0 .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
4 / 82
Diagram – Orthogonality.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
5 / 82
Proof.
Consider the 2-variable function f (x, y ) and the level curve
defined by f (x, y ) = k .
Partial differentiating f (x, y ) = k w.r.t x, we obtain
dy dy
fx + fy · = 0, i.e., ∇f · 1, = 0.
dx dx
The gradient
vector
∇f (P0 ) is orthogonal (perpendicular) to the
dy
vector 1, .
dx
dy
Next we shall explain why the vector 1, is a vector parallel
dx
to the tangent of the level curve f (x, y ) = k .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
6 / 82
Proof (continued.)
Recall that the slope of the tangent to the level curve at P0 is
dy
.
dx P0
Thus, moving one unit along positive x-direction,
the
value of y
dy dy
changes by units. Hence, the vector 1, is parallel
dx P0 dx P0
to the tangent of the level curve f (x, y ) = k at P0 .
dy
Therefore, the equation ∇f · 1, = 0 tells us that
dx
∇f (P0 ) is perpendicular (orthogonal) to the tangent of the level
curve f (x, y ) = k at P0 .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
7 / 82
Example 1.
Example
Let f (x, y ) = x(x − 3) − y .
Sketch the level curve of f which passes through P0 (1, −1) and
indicate the gradient vector ∇f (P0 ) on the sketch.
[SOLUTION] Note that f (P0 ) = f (1, −1) = −1.
The level curve passing through P is the curve f (x, y ) = −1, i.e.,
x(x − 3) − y = −1, which is the parabola
y = x(x − 3) + 1 = x 2 − 3x + 1.
The gradient vector is evaluated as follows:
∇f (x, y ) = (2x − 3, −1) so that ∇f (P0 ) = (−1, −1).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
8 / 82
Sketch: Level curve & gradient vector.
At P0 (1, −1), ∇f (P0 ) = (−1, −1) is perpendicular to the tangent
of the parabola y = x(x − 3) + 1.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of Physical
9 / 82
Quiz
https://forms.gle/E7yCyjXx8GhV8pgx7
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 10
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 11
Physical
/ 82
Orthogonal to Level Surface
Proposition
Consider a 3-variable function F (x, y , z). Suppose S is the level
surface with equation F (x, y , z) = k and P (x0 , y0 , z0 ) is a point
on S.
Then the gradient vector ∇F (P0 ) is orthogonal to the level
surface defined by F (x, y , z) = k at P0 .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 12
Physical
/ 82
Diagram – Orthogonality.
∇F (x0 , y0 , z0 ) · (x − x0 , y − y0 , z − z0 ) = 0
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 13
Physical
/ 82
Proof. Orthogonal to Level Surface
Suppose S is the level surface with equation F (x, y , z) = k and
P (x0 , y0 , z0 ) is a point on S.
Consider a curve C that lies on S and passes through the point
P. This curve C can be described by a continuous vector
function
r (t) = (x(t), y (t), z(t)) .
Let t0 be the value such that r(t0 ) = (x0 , y0 , z0 ).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 14
Physical
/ 82
Proof. Orthogonal to Level Surface
Since C lies on S, the point represented by r(t) must satisfy the
equation of S. That is,
F (r(t)) = F (x(t), y (t), z(t)) = k .
Applying Chain Rule to differentiate the above equation with
respect to t, we obtain
∂F dx ∂F dy ∂F dz
+ + = 0,
∂x dt ∂y dt ∂z dt
which is,
∇F · r0 (t) = 0,
where ∇F = (Fx , Fy , Fz ) and r0 (t) = (x 0 (t), y 0 (t), z 0 (t)).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 15
Physical
/ 82
Proof. Orthogonal to Level Surface
In particular, when t = t0 , we have r(t0 ) = (x0 , y0 , z0 ), so that
∇F (x0 , y0 , z0 ) · r0 (t0 ) = 0
The vector r0 (t0 ) is tangential to the curve C at P0 .
The above equation implies that the gradient vector
∇F (x0 , y0 , z0 ) is orthogonal to the tangent vector r0 (t0 ) of the
curve C on S at P.
Therefore, the gradient vector ∇F (x0 , y0 , z0 ) is perpendicular to
the level surface S at the point P.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 16
Physical
/ 82
Quiz
https://forms.gle/biVoCRTqdNAS1jF17
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 17
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 18
Physical
/ 82
Tangent Planes to Level Surface
Consider the level surface with equation F (x, y , z) = k and a
point P (x0 , y0 , z0 ) on S.
If ∇F (x0 , y0 , z0 ) 6= 0 (is not the zero vector), we define the
tangent plane to the level surface F (x, y , z) = k at P (x0 , y0 , z0 )
as the plane passes through P and has normal vector
∇F (x0 , y0 , z0 ).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 19
Physical
/ 82
Tangent Planes to Level Surface
Therefore, the equation of this tangent plane is
∇F (x0 , y0 , z0 ) · (x − x0 , y − y0 , z − z0 ) = 0.
We rewrite the above equation as
(Fx (x0 , y0 , z0 ), Fy (x0 , y0 , z0 ), Fz (x0 , y0 , z0 ))
· (x − x0 , y − y0 , z − z0 ) = 0.
We obtain
Fx (x0 , y0 , z0 ) (x − x0 ) + Fy (x0 , y0 , z0 ) (y − y0 )
+Fz (x0 , y0 , z0 ) (z − z0 ) = 0.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 20
Physical
/ 82
Normal Lines to Level Surfaces
Moreover, the normal line to the surface F (x, y , z) = k at
P (x0 , y0 , z0 ) can be represented by the vector equation
r = (x0 , y0 , z0 ) + t∇F (x0 , y0 , z0 )
or
x = x0 + tFx (x0 , y0 , z0 ) ,
y = y0 + tFy (x0 , y0 , z0 ) ,
z = z0 + tFz (x0 , y0 , z0 ) .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 21
Physical
/ 82
Example 2.
Example
Find the equation of the tangent plane and normal at the point
(−2, 1, −3) to the ellipsoid
x2 z2
+ y2 + = 3.
4 9
x2 z2
[SOLUTION] Let F (x, y , z) = + y2 + .
4 9
Equation of tangent plane is
∇F (−2, 1, −3) · (x − x0 , y − y0 , z − z0 ) = 0
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 22
Physical
/ 82
Example 2. (Cont’d.) Tangent plane.
x2 z2
[SOLUTION] F (x, y , z) = + y 2 + . We have
4 9
x 2z
∇F = (Fx , Fy , Fz ) = , 2y ,
2 9
−2
so that ∇F (−2, 1, −3) = −1, 2, .
3
Thus, the required equation is
−2
−1, 2, · (x − (−2), y − 1, z − (−3)) = 0.
3
That is
2
−x + 2y − z = 6.
3
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 23
Physical
/ 82
Example 2. (Cont’d.) Normal line.
The equation of the normal line at the point (−2, 1, −3) to the
x2 z2
ellipsoid + y2 + = 3 is
4 9
r = (x0 , y0 , z0 ) + t∇F (x0 , y0 , z0 )
−2
i.e., (x, y , z) = (−2, 1, −3) + t −1, 2, .
3
(In parametric form, x = −2 − t, y = 1 + 2t, z = −3 − 32 t. )
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 24
Physical
/ 82
Quiz
https://forms.gle/gHUyGDN8v6JTgmAMA
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 25
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 26
Physical
/ 82
Tangent Plane to Graph z = f (x, y ).
In this section, we shall apply the equation of tangent plane to
level surface F (x, y , z) = k from the preceding section to the
graph z = f (x, y ).
Note that the graph z = f (x, y ) is equivalent to f (x, y ) − z = 0.
Thus, it can be viewed as the level surface F (x, y , z) = 0 where
F (x, y , z) = f (x, y ) − z.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 27
Physical
/ 82
Equation of Tangent Plane.
The graph z = f (x, y ) is viewed as the level surface
F (x, y , z) = 0 where
F (x, y , z) = f (x, y ) − z.
Let z0 = f (x0 , y0 ). Then P0 (x0 , y0 , z0 ) lies on the level surface
F (x, y , z) = 0.
The gradient vector
∇F (P0 ) = (fx (x0 , y0 ) , fy (x0 , y0 ) , −1)
is a normal vector of the tangent plane to level surface
F (x, y , z) = 0 at P0 (which is the graph z = f (x, y ) at (x0 , y0 )).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 28
Physical
/ 82
Equation of Tangent Plane.
Therefore, the equation of the tangent plane at P0 is given by
∇F (P0 ) · (x − x0 , y − y0 , z − z0 ) = 0,
i.e., (fx , fy , −1) · (x − x0 , y − y0 , z − z0 ) = 0.
Expanding the above equation and rearranging the terms, we
obtain
z = f (x0 , y0 ) + fx (x0 , y0 ) (x − x0 ) + fy (x0 , y0 ) (y − y0 ) ,
which is equivalent to
z = f (x0 , y0 ) + ∇f (x0 , y0 ) · (x − x0 , y − y0 )
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 29
Physical
/ 82
Tangent Plane to z = f (x, y ).
Proposition
Suppose f (x, y ) is a function of two variables.
The equation of the tangent plane to the graph z = f (x, y ) at
(x0 , y0 , f (x0 , y0 )) is given by
z = f (x0 , y0 ) + ∇f (x0 , y0 ) · (x − x0 , y − y0 )
that is,
z = f (x0 , y0 ) + fx (x0 , y0 ) (x − x0 ) + fy (x0 , y0 ) (y − y0 ).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 30
Physical
/ 82
Diagram – Tangent Plane
z = f (x0 , y0 ) + ∇f (x0 , y0 ) · (x − x0 , y − y0 )
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 31
Physical
/ 82
Summary: Equation of Tangent Plane to
z = f (x, y ).
z = f (x0 , y0 ) + ∇f (x0 , y0 ) · (x − x0 , y − y0 )
z = f (x0 , y0 ) + fx (x0 , y0 ) (x − x0 ) + fy (x0 , y0 ) (y − y0 )
Rearranging the above gives
fx (x0 , y0 ) x + fy (x0 , y0 ) y − z
| {z } | {z }
a b
= fx (x0 , y0 ) x0 + fy (x0 , y0 ) y0 − f (x0 , y0 )
| {z }
d
which is in the form ax + by + cz = d, where c = −1.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 32
Physical
/ 82
Remark: Tangent Plane to z = f (x, y ).
For a function f (x) of one variable, the equation of the tangent
line at x = x0 is given by
y = f (x0 ) + f 0 (x0 ) (x − x0 ) .
Here, we have obtained a similar equation describing the
tangent plane to the surface z = f (x, y ) at (x0 , y0 , f (x0 , y0 ))
given by
z = f (x0 , y0 ) + ∇f (x0 , y0 ) · (x − x0 , y − y0 )
that is,
z = f (x0 , y0 ) + fx (x0 , y0 ) (x − x0 ) + fy (x0 , y0 ) (y − y0 ).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 33
Physical
/ 82
Example 3.
Example
Find the equation of the tangent plane to the surface
z = 2x 2 + y 2 at the point (1, 1, 3).
[SOLUTION] Let f (x, y ) = 2x 2 + y 2 . The required equation is
z = f (1, 1) + fx (1, 1) (x − 1) + fy (1, 1) (y − 1).
Note that fx (x, y ) = 4x and fy (x, y ) = 2y .
Thus, we have f (1, 1) = 3, fx (1, 1) = 4 and fy (1, 1) = 2.
Therefore the equation of the tangent plane at (1, 1, 3) is
z = 3 + 4 (x − 1) + 2 (y − 1) , i.e., z = 4x + 2y − 3.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 34
Physical
/ 82
Quiz
https://forms.gle/iSUoSPHNWhffXBRV8
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 35
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 36
Physical
/ 82
Recall: Linear Approximation
Recall that linear approximation for a single variable function
f (x) for values of x near a is an approximation of f (x) using the
tangent function.
(Note: y = f (a) + f 0 (a) (x − a) is the equation of tangent line to
y = f (x) at x = a.)
The value f (x) is approximated by the function L(x) which
defines the tangent line:
f (x) ≈ L(x) = f (a) + f 0 (a) (x − a) .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 37
Physical
/ 82
Linear Approximation for f (x, y )
For a 2-variable function f (x, y ), we have a similar linear
approximation for (x, y ) close to (a, b).
Recall that the equation of tangent plane to z = f (x, y ) at (a, b)
is
z = f (a, b) + fx (a, b) · (x − a) + fy (a, b) · (y − b) .
| {z }
L(x,y )
Let
L(x, y ) = f (a, b) + fx (a, b) · (x − a) + fy (a, b) · (y − b)
be the function which describes the above tangent plane.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 38
Physical
/ 82
Linear Approximation for f (x, y )
For (x, y ) close to (a, b), we use L(x, y ) to approximate f (x, y ):
f (x, y ) ≈ L(x, y )
We say L(x, y ) is a linear approximation of f (x, y ) .
Thus we have
f (x, y ) ≈ f (a, b) + ∇f (a, b) · (x − a, y − b)
or,
f (x, y ) ≈ f (a, b) + fx (a, b) · (x − a) + fy (a, b) · (y − b)
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 39
Physical
/ 82
Diagram – Linear Approximation
f (x, y ) ≈ L(x, y ) = f (a, b) + ∇f (a, b) · (x − a, y − b)
= f (a, b) + fx (a, b) · (x − a) + fy (a, b) · (y − b)
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 40
Physical
/ 82
Example 4.
Example
Use linear approximation to approximate the value
q
9 (1.95)2 + (8.1)2 .
p
[SOLUTION] Let f (x, y ) = 9x 2 + y 2 .
Note that 1.95 is close to 2 and 8.1 is close to 8.
Thus, we choose a = 2 and b = 8, and approximate f (1.95, 8.1)
as follows:
f (1.95, 8.1) ≈ f (2, 8) + fx (2, 8) · (1.95 − 2) + fy (2, 8) · (8.1 − 8)
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 41
Physical
/ 82
p
Example 4. (Cont’d) f (x, y ) = 9x 2 + y 2
[SOLUTION] We have
∂ p 2 9x
fx (x, y ) = 9x + y 2 = p ,
∂x 9x 2 + y 2
∂ p 2 y
fy (x, y ) = 9x + y 2 = p ,
∂y 9x 2 + y 2
Thus, we have
f (1.95, 8.1) ≈ f (2, 8) + fx (2, 8) · (−0.05) + fy (2, 8) · (0.1)
9 (2) 8
= 10 + q (−0.05) + q (0.1)
2 2 2 2
9 (2) + 8 9 (2) + (8)
= 10 + (−0.01) = 9.99.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 42
Physical
/ 82
Quiz
https://forms.gle/BmJBiEfgdDXUDXyt6
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 43
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 44
Physical
/ 82
Estimating changes in f
Consider a function f (x, y ).
We want to estimate the change in f from the point (a, b) to
(a + ∆x, b + ∆y ), that is,
∆f = f (a + ∆x, b + ∆y ) − f (a, b) .
Here, ∆x and ∆y are respectively small changes in
independent variables x and y .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 45
Physical
/ 82
Differential.
Recall that for a function of one variable f (x), to estimate the
change of f , i.e.,
∆f = f (a + ∆x) − f (a) ,
we estimate f (a + ∆x) by L(a + ∆x), where
L(x) = f (a) + f 0 (a)(x − a) is the linear approximation of f about
a.
Thus, we have
∆f ≈ df = L(a + ∆x) − f (a) = f 0 (a) ∆x.
where df = f 0 (a) ∆x, is known as the differential of f .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 46
Physical
/ 82
Change & Total Differential.
Similarly, when ∆x and ∆y are small, to estimate ∆f , we
estimate f (a + ∆x, b + ∆y ) by L (a + ∆x, b + ∆y ).
Recall: L(x, y ) = f (a, b) + ∇f (a, b) · (x − a, y − b) so that
L(x, y ) − f (a, b) = ∇f (a, b) · (x − a, y − b).
Thus,with x = a + ∆x and y = b + ∆y , we have
∆f = f (a + ∆x, b + ∆y ) − f (a, b) ≈ L (a + ∆x, b + ∆y ) − f (a, b)
= ∇f (a, b) · (∆x, ∆y ) = fx (a, b) ∆x + fy (a, b) ∆y
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 47
Physical
/ 82
Diagram – Differential z = f (x, y )
∆z ≈ dz = fx (a, b) dx + fy (a, b) dy
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 48
Physical
/ 82
Total Differential.
We define the total differential of f (or simply the differential of
f ), denoted by df , as
df = ∇f (a, b) · (∆x, ∆y )
= fx (a, b) ∆x + fy (a, b) ∆y
Thus we have ∆f ≈ df .
Differentials are used in estimating errors, sensitivity, etc.
Remark For independent variables x and y , the following
notation is often used: dx = ∆x and dy = ∆y , so that
df = ∇f (a, b) · (dx, dy ) = fx (a, b) dx + fy (a, b) dy
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 49
Physical
/ 82
Example 5.
Example
Let f (x, y ) = x 2 + 3xy − y 2 . If x changes from 2 to 2.05 and y
changes from 3 to 2.96, compute df and compare it with ∆f .
[SOLUTION] Since x changes from 2 to 2.05 and y changes
from 3 to 2.96, we have
a = 2,
∆x = 2.05 − 2 = 0.05,
b = 3 and
∆y = 2.96 − 3 = −0.04.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 50
Physical
/ 82
Example (Solution).
fx (x, y ) = 2x + 3y and fy (x, y ) = 3x − 2y
Thus, df = (2a + 3b) ∆x + (3a − 2b) ∆y , i.e.,
df = (2 (2) + 3 (3)) · (0.05) + (3 (2) − 2 (3)) · (−0.04) = 0.65.
The change in f is ∆f = f (2.05, 2.96) − f (2, 3)
h i h i
2 2 2 2
= (2.05) + 3 (2.05) · (2.96) − (2.96) − (2) + 3 (2) · (3) − (3)
= 0.6449.
Note that ∆f is approximately equal to df , but df is much easier
to calculate.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 51
Physical
/ 82
Application
Total differentials are used in estimating errors, changes, and
sensitivity etc.
Example
A cylindrical can is designed to have a radius 3 cm and a height
of 15 cm. But the radius and height are off by the amount not
more than 0.04 cm and 0.2 cm respectively. Estimate the
resulting change in the volume of the can.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 52
Physical
/ 82
Example (Solution)
Let r cm and h cm be the radius and height of a cylindrical can
respectively.
The volume of the can is
V = πr 2 h(cm3 ).
We estimate the resulting change in the volume of the can by
total differential, i.e., 4V ≈ dV .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 53
Physical
/ 82
Example (Solution) Continued.
V = πr 2 h(cm3 )
dV = (Vr )(4r ) + (Vh )(4h) = π 2rh(4r ) + r 2 (4h) .
By triangle inequality, we have,
|dV | ≤ π |2rh(4r )| + r 2 (4h)
= π 2rh|4r | + r 2 |4h| .
Since r = 3, h = 15 , |4r | ≤ 0.04 and |4h| ≤ 0.2, we have
|dV | ≤ π 2(3)(15)|4r | + 32 |4h|
≤ π (90(0.04) + 9(0.2)) = 5.4π.
We conclude that 4V ≈ 5.4π.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 54
Physical
/ 82
3-variable Function
For a 3-variable function F (x, y , z), we have the following linear
approximation and total differential at (a, b, c),
F (x, y , z) ≈ L(x, y , z)
= F (a, b, c) + ∇F (a, b, c) · (x − a, y − b, z − c)
4F ≈ df = ∇F (x, y , z) · (x − a, y − b, z − c)
= Fx (a, b, c) · (x − a) + Fy (a, b, c) · (y − b) + Fz (a, b, c) · (z − c)
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 55
Physical
/ 82
Remarks
More generally, for n-variable function f (x1 , x2 , . . . , xn ), we have
the following linear approximation and total differential at
(a1 , a2 , . . . , an ),
f (x1 , x2 , . . . , xn ) ≈ L(x1 , x2 , . . . , xn ) = f (a1 , a2 , . . . , an )+
∇f (a1 , a2 , . . . , an ) · (x1 − a1 , x2 − a2 , . . . , xn − an )
df = ∇f (a1 , a2 , . . . , an ) · (x1 − a1 , x2 − a2 , . . . , xn − an ) .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 56
Physical
/ 82
Quiz
https://forms.gle/sA53apVTE4VuKNpo6
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 57
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 58
Physical
/ 82
Recall: Partial Derivatives
For the function f (x, y ), recall that the partial derivatives fx and
fy at a point (a, b) are defined as
f (a + h, b) − f (a, b)
fx (a, b) = lim
h→0 h
and
f (a, b + h) − f (a, b)
fy (a, b) = lim
h→0 h
They represent respectively the rate of change of f in the x- and
y -directions, i.e., the directions of the unit vectors i and j.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 59
Physical
/ 82
Directional Derivatives
Suppose that we want to find the rate of change of f in the
direction corresponding to unit vector u = (u1 , u2 ).
We shall determine the change in f w.r.t. change along u in h
steps.
Since the point changes from (a, b) to
(a, b) + hu = (a, b) + h(u1 , u2 ) = (a + hu1 , b + hu2 )
the corresponding change in f is
f (a + hu1 , b + hu2 ) − f (a, b) .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 60
Physical
/ 82
Diagram: Directional Derivative.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 61
Physical
/ 82
Directional Derivatives
The rate of change along the direction u is thus the limit of the
ratio
f (a + hu1 , b + hu2 ) − f (a, b)
as h → 0.
h
We define this limit, if exists, as the directional derivative of f
along u.
Definition
The directional derivative of f at (a, b) in the direction of the unit
vector u = (u1 , u2 ) is
f (a + hu1 , b + hu2 ) − f (a, b)
Du f (a, b) = lim
h→0 h
if this limit exists.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 62
Physical
/ 82
Duf (x, y ) = ∇f · u
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 = (u1 , u2 ) and
Du f (a, b) = ∇f (a, b) · u = fx (a, b) u1 + fy (x, y ) u2 .
[Proof.]
f (a + hu1 , b + hu2 ) − f (a, b)
Du f (a, b) = lim
h→0 h
Letting g(h) = f (a + hu1 , b + hu2 ), we have
g 0 (0) = Du f (a, b).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 63
Physical
/ 82
Proof.
To find g 0 (0), we have to determine g 0 (h), and substitute h = 0.
Applying the chain rule to g(h) = f (a + hu1 , b + hu2 ), we have
dg ∂f d(a + hu1 )
g 0 (h) = = (a + hu1 , b + hu2 ) +
dh ∂x dh
∂f d(b + hu2 )
(a + hu1 , b + hu2 )
∂y dh
= fx (a + hu1 , b + hu2 ) · u1 + fy (a + hu1 , b + hu2 ) · u2 .
Substituting h = 0, we have
g 0 (0) = fx (a, b) · u1 + fy (a, b) · u2
= ∇f (a, b) · (u1 , u2 ) = ∇f (a, b) · u.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 64
Physical
/ 82
Summary: Evaluating Directional Derivatives.
To evaluate Du f (a, b) at P(a, b) using the established formula,
we compute
Du f (a, b) = ∇f (a, b) · u = fx (a, b) u1 + fy (a, b) u2 .
We have to identify the point P(a, b) and the (direction) unit
vector u.
More generally, we have
Du f (x, y ) = ∇f (x, y ) · u = fx (x, y ) u1 + fy (x, y ) u2 .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 65
Physical
/ 82
Example 1.
Example
Let f (x, y ) = x 3 − 3xy + 4y 2 .
(a) Find the directional derivative Du f (x, y ) where u is the unit
π
vector given by angle θ = .
6
(b) What is Du f (1, 2)?
[SOLUTION] We have ∇f = 3x 2 − 3y , −3x + 8y .
(a) Note that
√ !
π π 3 1
u = cos i + sin j = , .
6 6 2 2
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 66
Physical
/ 82
Example 1 (Cont’d). f (x, y ) = x 3 − 3xy + 4y 2
(a) Thus, we have
√ !
3 1
Du f (x, y ) = ∇f (x, y ) · u = 3x 2 − 3y , −3x + 8y
· ,
2 2
3√ 2 3 3√
3x − x + 4y −
= 3y .
2 2 2
(b) Note that P = (1, 2). Therefore, we have
3√ 3 3√ 13 3 √
Du f (1, 2) = 3 − + 4 (2) − 3 (2) = − 3
2 2 2 2 2
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 67
Physical
/ 82
Example 2.
Example
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.
1
[SOLUTION] We should find the unit vector u = v along v.
√ kvk
Note that ||v|| = 29. The unit vector in the direction of v is
v 1
u= =√ (2, 5) .
||v|| 29
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 68
Physical
/ 82
Example 2 (Cont’d). f (x, y ) = x 2y 3 − 4y .
(2, 5)
∇f (x, y ) = 2xy 3 , 3x 2 y 2 − 4 , u = √
29
Therefore, we have
(2, 5)
Du f (x, y ) = ∇f (x, y ) · u = 2xy 3 , 3x 2 y 2 − 4 · √
29
At the point (2, −1), we have
(2, 5)
Du f (2, −1) = (−4, 8) · √
29
−4 · 2 + 8 · 5 32
= √ =√ .
29 29
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 69
Physical
/ 82
Directional Derivatives
For functions of three variables, we define directional derivatives
in the same manner.
Definition
The directional derivative of f at (a, b, c) in the direction of a unit
vector u = (u1 , u2 , u3 ) is
f (a + hu1 , b + hu2 , c + hu3 ) − f (a, b, c)
Du f (a, b, c) = lim
h→0 h
if the limit exists.
Similarly, we have
Du f (x, y , z) = ∇f (x, y , z) · u.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 70
Physical
/ 82
Directional Derivatives
1 Directional derivatives are defined similarly for a function f
of n variables. Using vector notation, it can be defined as
follows, where u is a unit vector.
f (x + hu) − f (x0 )
Du f (x0 ) = lim
h→0 h
2 We also have the result: Du f (x) = ∇f (x) · u, i.e.,
Du f (x1 , x2 , . . . , xn ) = ∇f (x1 , x2 , . . . , xn ) · u.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 71
Physical
/ 82
Quiz
https://forms.gle/gwhTGZ8uaPZ92LA17
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 72
Physical
/ 82
Outline
1 Orthogonal to Level Curve f (x, y ) = k .
2 Orthogonal to Level Surface F (x, y , z) = k
3 Tangent Plane to Level Surface F (x, y , z) = k .
4 Tangent Plane to Graph z = f (x, y ).
5 Linear Approximation
6 Total Differential
7 Directional Derivatives
8 Maximum/Minimum Rate of Change
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 73
Physical
/ 82
Maximum and minimum rate of Change.
Question At a point P, is there a direction u in which the rate of
change in f (x, y ) is the maximum (resp. minimum)? If there is,
what is the corresponding maximum (resp. ) rate of change in f ?
At a point P(a, b), for a differentiable function f , the directional
derivative Du f (P) = ∇f (P) · u is the rate of change in f (at
P(a, b) ) in the direction u.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 74
Physical
/ 82
Duf = ∇f · u.
Using the dot-product form of Du f , we have
Du f (P) = ∇f (P) · u = k∇f (P)k kuk cos θ = k∇f (P)k cos θ,
where θ is the angle between ∇f (P) and u.
Note that the maximum (respectively minimum) value of cos θ is
1 (resp. −1) and this occurs when θ = 0 (resp. θ = π).
Therefore the maximum (resp. minimum) value of Du f (P) is
k∇f (P)k (resp. − k∇f (P)k) when u has the same direction as
(resp. opposite direction to) the gradient vector ∇f (P).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 75
Physical
/ 82
Maximum/Minimum Rate of Change.
We record this in the next theorem.
Theorem
Suppose f is a differentiable function of two or three variables.
(a) The maximum rate of change in f at P is k∇f (P0)k and it
∇f (P)
occurs in the direction u = , which is the same
k∇f (P)k
direction as the gradient vector ∇f (P).
(b) The minimum rate of change in f at P is − k∇f (P)k and it
−∇f (P)
occurs in the direction u = , which is the opposite
k∇f (P)k
direction of the gradient vector ∇f (P).
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 76
Physical
/ 82
Example 3.
Example
(a) If f (x, y ) = xey , find the rate of change of f at the point
P (2, 0) in the direction from P to Q 12 , 2 .
(b) What is the maximum rate of change? In what direction
does f have the maximum rate of change?
For part (a), the rate of change of f at point P along a direction
with unit vector u is given by
Du f (P) = ∇f (P) · u.
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 77
Physical
/ 82
Solution. (a)
f (x, y ) = xey :
∇f (x, y ) = (fx (x, y ) , fy (x, y )) = (ey , xey )
so that
∇f (2, 0) = e0 , 2e0 = (1, 2) .
−→ −−→ −→
The direction is PQ = OQ − OP = − 32 , 2 .
−→
The unit vector u in the direction PQ is
− 32 , 2
3 4
u= q = − , .
3 2
2 5 5
−2 + 2
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 78
Physical
/ 82
Solution. (a)
Thus, the rate of change of f in the direction from P to Q is
Du f (2, 0) = ∇f (2, 0) · u
3 4 3 4
= (1, 2) · − , = − +2 = 1.
5 5 5 5
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 79
Physical
/ 82
Solution (b). Maximum rate of change in f at
P & direction.
We have computed ∇f (2, 0) = (1, 2).
The maximum rate of change in f at P is
p √
k∇f (2, 0)k = k(1, 2)k = 12 + 22 = 5.
At P, the function f increases fastest in the direction of the
gradient vector ∇f (2, 0) = (1, 2). The corresponding unit vector
u is
1 1
u= ∇f (2, 0) = √ (1, 2)
k∇f (2, 0)k 5
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 80
Physical
/ 82
IMPORTANT CONCLUSION
1 The gradient vector ∇f is orthogonal to the level curve
f (x, y ) = k and it is the direction where f increases most
rapidly (largest rate).
2 The gradient vector ∇F is orthogonal to the level surface
F (x, y , z) = k and it is the direction where F increases most
rapidly (largest rate).
Remark The direction −∇f (P) is used in the gradient descent
algorithm for finding a minimum value of f .
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 81
Physical
/ 82
Quiz
https://forms.gle/PoixiU1fbS8K3kKo6
Main instructor — Dr Duzhin Fedor, slides mostly developed
MH1811
by DrMathematics
Tan Geok Choo
2 (Division of Mathematical Sciences School of 82
Physical
/ 82