Lecturenotes Weeks1 4 2320
Lecturenotes Weeks1 4 2320
Consider the right-angled triangle formed by the points (x1 , y1 ), (x2 , y2 ) and
(x1 , y2 ). By the Pythogoras Theorem, it is quite easy to see that the distance
d between (x1 , y1 ) and (x2 , y2 ) is
p
d = (x2 − x1 )2 + (y2 − y1 )2 .
1
Using a similar argument (see online lecture video), the distance d between
two points (x1 , y1 , z1 ) and (x2 , y2 , z2 ) is :
p
d= (x2 − x1 )2 + (y2 − y1 )2 + (z2 − z1 )2 .
2. Introduction to vectors
• Length
• Direction
Two vectors are equal if they have the same length and the same direction.
• a position vector u = ha, b, ci, where (a, b, c) is the terminal point when
the initial point is placed at the origin; or
−→
• a directed line segment u = AB when we want to emphasize on the
initial point A(a1 , a2 , a3 ) as well as the terminal point B(b1 , b2 , b3 ).
Let us now turn to the question on adding two vectors. This can be defined
geometrically as follows: The sum u + v is the resulting vector that starts at
the initial point of u and ends at the terminal point of v when we place the
initial point of v at the terminal point of u:
2
This defining rule of addition is known as the Triangle Law of Addition.
By the same token, we can define the sum v + u, which turns out to be the
same as u + v. So, vector addition is commutative, i.e. the order in which
we compute the addition does not matter.
a + b = ha1 + b1 , a2 + b2 , a3 + b3 i.
The zero vector, denoted by 0, has length 0. It is the only vector with no
specific direction.
If c = 0 or u = 0, then cu = 0.
Just like vector addition, it is easier to compute scalar multiple using position
vectors: If c ∈ R, and u = hu1 , u2 , u3 i, then
3
3. Sphere & Midpoint
Solution. Let (x, y, z) be a point of the sphere. Then the distance between
(x, y, z) and the centre (1, 1, 1) is 2. Hence, by the distance formula,
p
(x − 1)2 + (y − 1)2 + (z − 1)2 = 2
Example 2. Prove that the midpoint of the line segment from A(x1 , y1 , z1 )
and B(x2 , y2 , z2 ) is
x1 + x2 y1 + y2 z1 + z2
, , .
2 2 2
Solution. Let M (a, b, c) be the midpoint.
Note that
−−→ −−→
AM = M B
−−→ −→ −−→ −−→
OM − OA = OB − OM
ha − x1 , b − y1 , c − z1 i = hx2 − a, y2 − b, z2 − ci
Comparing components:
a − x1 = x2 − a
b − y1 = y2 − b
c − z1 = z2 − c
4
Solving for a, b, c:
x1 + x2
a =
2
y1 + y2
b =
2
z1 + z2
c =
2
Example 3. Find the position vector which is equal to the vector directed
from the point A(1, 2, 3) to the point B(3, −2, 0).
Solution. Let O(0, 0, 0) be the origin. Then
−→ −→ −−→
AB = AO + OB
−→ −−→
= −OA + OB
4. Length of Vector
5
The length of the vector u = hu1 , u2 , u3 i is
q
||u|| = u21 + u22 + u23 .
a 1 1
||u|| = = ||a|| = ||a|| = 1.
||a|| ||a|| ||a||
So u is the unit vector in the same direction as a.
6
Theorem 3 (Properties of Dot Product). For vectors a, b and c and any
scalar d,
(i) a · b = b · a (commutativity)
(ii) a · (b + c) = a · b + a · c (distributive law)
(iii) (da) · b = d(a · b) = a · (db)
(iv) 0 · a = 0
(v) a · a = ||a||2 .
For two nonzero vectors a and b in R3 , we define the angle θ between them
to be the smaller angle between a and b when placing their initial points
together.
0 ≤ θ ≤ π.
7
Example 4. Find the angle between the vectors a = h2, 1, −3i and b =
h1, 5, 6i.
Solution.
a·b −11
cos θ = =√ √ .
||a|| ||b|| 14 62
−11
θ = cos−1 √ √ ≈ 1.953 radian.
14 62
6. Projections
−→
Let S be the foot of the perpendicular line from R to the line containing P Q.
−→
The vector P S is called the vector projection of b onto a, denoted by
proja b.
8
The scalar projection of b onto a (also called the component of b along a)
is defined to be the signed magnitude of the vector projection:
a·b
compa b = ||b|| cos θ = .
||a||
π
This value is negative if 2
< θ ≤ π, where θ is the angle between a and b.
Therefore,
a a·b a a·b
proja b = compa b × = = a
||a|| ||a|| ||a|| ||a||2
a·b
= a.
a·a
Example 5. Let a = h−2, 3, 1i and b = h1, 1, 2i. Find the scalar projection
and vector projection of b onto a.
Solution.
a·b (−2)(1) + 3(1) + 1(2) 3
compa b = = √ =√ .
||a|| 14 14
3 a 3 3 9 3
proja b = √ = a = h− , , i.
14 ||a|| 14 7 14 14
7. Cross product
For two vectors a = ha1 , a2 , a3 i and b = hb1 , b2 , b3 i, define the cross product
of a and b to be
i j k
a×b = a1 a2 a3
b1 b2 b3
a2 a3 a a a a
= i− 1 3 j+ 1 2 k
b2 b3 b1 b 3 b 1 b2
= (a2 b3 − a3 b2 )i − (a1 b3 − a3 b1 )j
+(a1 b2 − a2 b1 )k.
9
To compute a × b, we must write the components of a in the second row of
the determinant, and the components of b in the third row. The order is
important!
(i) a × b = −b × a
10
(iii) a × (b + c) = a × b + a × c
(iv) (a + b) × c = a × c + b × c
Notice that if we take the base of the parallelogram to given by a, then the
height of the parallelogram is
||b|| sin θ
where θ is the angle between a and b. Hence, the area of the parallelogram
is
height × base = ||a|| × ||b|| sin θ = ||a × b|| .
11
The distance from the point Q to the line L is always the shortest distance
between Q and the line. Suppose P and R are two points on L. Hence, this
distance is just the length of the straight line joining Q and a point on the
line L in such a way that it is perpendicular to the given line L. From the
figure above, the distance is
−→
P Q sin θ
−→ −→
where θ is the angle between P Q and P R.
Using the cross-product angle formula, this can be written as
−→ −→
−→ PQ × PR
P Q sin θ = −→
PR
8. Equation of a line
12
By Triangle Law of Addition,
r = r0 + a
Hence,
r = r0 + tv, t ∈ R.
Then
r = r0 + tv
hx, y, zi = hx0 , y0 , z0 i + tha, b, ci.
Remarks:
• Usually the parameter t (in the parametric equation of line) takes values
on the entire R or an interval I.
• The vector equation and parametric equations of a line are not unique.
13
Example 7. Find an equation of the line passing through P (1, 2, −1) and
Q(5, −3, 4).
Solution. A vector parallel to the line is
−→
P Q = h5 − 1, −3 − 2, 4 − (−1)i = h4, −5, 5i.
A fixed point on the line is P (1, 2, −1). Thus a set of parametric equations
for the line is
L2 : x − 1 = s, y − 2 = −s, z − 1 = 3s,
are skew.
14
Solution. A vector parallel to L1 is a = h−1, 2, 2i and a vector parallel to
L2 is b = h1, −1, 3i. Since a is not a scalar multiple of b, these lines are not
parallel.
Rearranging, we have
L1 : x = 2 − t, y = 1 + 2t, z = 5 + 2t,
L2 : x = 1 + s, y = 2 − s, z = 1 + 3s,
Assume for a contradiction that L1 and L2 intersect.
Then there must exist a choice of the parameter t and s such that the values
of x, y and z are the same.
2 − t = 1 + s,
so that s = 1 − t.
y = 1 + 2t = 2 − s.
t = 0, s = 1.
z = 5 + 2t = 5,
z = 1 + 3s = 4,
which is absurd!
Hence our assumption that L1 and L2 intersects was wrong. So the lines are
skew, as desired.
15
9. Equation of a plane
Let r and r0 denote the position vectors of P and P0 respectively. The aim
is to describe the position vector r of the point P .
−−→
Notice that r − r0 is represented by P0 P .
16
In terms of the components, we have
Then n · r = n · r0 becomes
ax + by + cz = d,
where
d = ax0 + by0 + cz0 .
Example 9. Find an equation of the plane that passes through the points
P (1, 3, 2), Q(3, −1, 6), R(5, 2, 0).
17
Notice
−→ −→
P Q = h2, −4, 4i, P R = h4, −1, −2i.
So
i j k
n = 2 −4 4
4 −1 −2
= 12i + 20j + 14k.
With the point P (1, 3, 2) and the normal vector n, an equation of the plane
is:
12(x) + 20(y) + 14(z) = 12(1) + 20(3) + 14(2)
or after simplifications,
6x + 10y + 7z = 50.
• An angle between the two planes is the angle θ between their normal
vectors. Notice π − θ is also an angle between the planes.
Example 10. (a) Find the angle between the planes x + 2y + z = 3 and
x − 4y + 3z = 5.
18
Solution. (a) The normal vectors of these planes are
x = 3 − 2y − z and x = 5 + 4y − 3z.
3 − 2y − z = 5 + 4y − 3z
z = 3y + 1
x = 3 − 2y − (3y + 1) = −5y + 2.
Let y = t be the parameter, we obtain a parametric equation for the line of
intersection
x = −5t + 2, y = t, z = 3t + 1.
Example 11. Find an equation of the plane containing the point (0, 1, 2)
and the line given by
x = t, y = t, z = 2t + 5, t ∈ R.
19
Solution. A point on the line is (0, 0, 5) (choose t = 0).
Two vectors on the plane are h0, 0, 5i − h0, 1, 2i = h0, −1, 3i, and h1, 1, 2i.
A normal to the plane is
5x − 3y − z + 5 = 0.
Example 12. Find the (shortest) distance between the following planes:
x + 2y + 5z = 6, x + 2y + 5z = 11.
Let
u = h11, 0, 0i − h6, 0, 0i = h5, 0, 0i.
A normal vector to the planes is
n = h1, 2, 5i.
u·n 5
||u|| | cos θ| = =√ .
||n|| 30
20
11. Finding angle between planes
Example 13. Find the angle between adjacent sides i.e. the angle between
the plane OP T S and the plane P QU T of the following symmetric-looking
chute.
Solution. Here is the view from the top of the symmetric-looking chute:
Place the chute in our coordinate system so that O(0, 0, 0), P (6, 0, 0), Q(6, 6, 0)
and R(0, 6, 0).
Then we have:
S(−1, −1, 8), T (7, −1, 8), U (7, 7, 8), V (−1, 7, 8).
We need to find the angle between the plane Π1 which contains the vector
−→ −→ −→ −→
OP and OS and the plane Π2 which contains the vector P Q and P T .
21
Let
−→ −→
u = OP × OS = h0, −48, −6i,
−→ −→
v = P Q × P T = h48, 0, −6i.
The goal of this section is to define and visualize vector function of one
variable r(t).
A vector-valued function is
22
We say that r(t) is a parametrization of C.
r(t) = ht, t2 i, t ∈ R
r(t) = ht3 , t6 i, t ∈ R
Example 14. Sketch the curve traced out by the vector-valued function
Solution.
y 2
2
x + = sin2 t + cos2 t = 1
3
which is the equation of an ellipse in 2-D. In 3-D, however, it becomes the
equation of an elliptic cylinder whose axis is the z-axis.
The curve will wind its way up the cylinder anticlockwise as t increases. We
call this curve an elliptical helix.
23
13. Tangent vectors
f (a + 4x) − f (a)
f 0 (a) = lim
4x→0 4x
can be regarded as the rate of change of f at x = a.
r(a+4t)−r(a)
Notice that for 4t > 0, the vector 4t
points in the same direction
as r(a + 4t) − r(a).
r(a+4t)−r(a)
As 4t → 0, 4t
approaches r0 (a).
This is a vector tangent to the curve at r(a). We also call r0 (a) a tangent
vector to the curve at t = a.
24
An interpretation:
‘component-wise’ !!!
(i) d
dt
(r(t) + s(t)) = r0 (t) + s0 (t)
(ii) d
dt
(cr(t)) = cr0 (t)
(iii) d
dt
f (t)r(t) = f 0 (t)r(t) + f (t)r0 (t)
25
(iv) d
dt
r(t) · s(t) = r0 (t) · s(t) + r(t) · s0 (t)
(v) d
dt
(r(t) × s(t)) = r0 (t) × s(t) + r(t) × s0 (t).
Example 15. Find the tangent line L to the curve r(t) = hcos t, sin t, ti at
(0, 1, π/2).
Since r0 (t) = h− sin t, cos t, 1i, a direction of the tangent line L is given
by the tangent vector
So a parametric equation of L is
Recall the folllowing example in the previous section. Both of the following
vector functions parameterize the same parabola f (x) = x2 on the xy-plane.
r(t) = ht, t2 i, t ∈ R
r(t) = ht3 , t6 i, t ∈ R
However, their respective tangent vectors are different:
26
Hence, the ‘velocities’ of the tracing of the curve are different. For example,
at t = 0, the first vector function gives the velocity h1, 0i, whereas the second
vector function gives the velocity h0, 0i at the same point (0, 0).
A natural question about a curve in space is ‘How long is it?’. This is the
arc length of the curve. Our formula for arc length only applies to smooth
curves, i.e. curves that do not have sharp corners at their interior points.
27
We can approximate the arc length of this curve as follows:
Step 1.
Partition the interval [a, b] into n subintervals of equal size: a = t0 < t1 <
· · · < tn = b, where ti − ti−1 = 4t = b−a
n
for all i = 1, 2, . . . , n.
Step 2.
Let si denote the arc length of that portion of the curve traced out as t in-
creases from ti−1 to ti .
We can approximate si by the distance of the point (f (ti ), g(ti ), h(ti )) from
(f (ti−1 ), g(ti−1 ), h(ti−1 )) (since f , g and h are continuous).
28
for some points ci , di and ei in the interval (ti−1 , ti ).
This yields
p
si ≈ (f (ti ) − f (ti−1 ))2 + (g(ti ) − g(ti−1 ))2 + (h(ti ) − h(ti−1 ))2
p
≈ (f 0 (ci )4t)2 + (g 0 (di )4t)2 + (h0 (ei )4t)2
p
≈ f 0 (ci )2 + g 0 (di )2 + h0 (ei )2 4t.
Notice that when 4t is small, ci , di and ei are very close to each other.
29
Example 16. Find the arclength of the curve traced out by the endpoint of
the vector-valued function r(t) = h2t, ln t, t2 i for 1 ≤ t ≤ e.
s 2
Z e
1
s = 22 + + (2t)2 dt
1 t
Z er
1 + 4t2 + 4t4
= dt
1 t2
Z er
(1 + 2t2 )2
= dt
1 t2
Z e Z e
1 + 2t2
1
= dt = + 2t dt
1 t 1 t
e
ln |t| + t2 1
=
= (ln e + e2 ) − (ln 1 + 1) = e2 .
30
MA1104 Week2
Functions of Two Variables, Quadric
Surfaces, Limits & Continuity
So far we have seen functions of one variable, i.e. the domain is a subset of
R
function Domain D Range R
(scalar) f (t) D⊆R R⊆R
(vector) r(t) D⊆R R ⊆ V2 or V3
In this section, we shall define two-variable function f (x, y), and learn how
to visualize it
• as a surface z = f (x, y) in the xyz-space
1
Solution. The function ln is only defined for positive real. So f (x, y) is
defined for all x, y such that
y 2 − x > 0.
The domain of f is
D = {(x, y) : x < y 2 }.
The graph of a function f of two variables is also called the surface S with
equation z = f (x, y).
We can visualize the graph S of f as lying directly above or below its domain
D in the xy-plane.
2
Graphing functions f (x, y) is not easy!
Horizontal traces (level curves): resulting curves when we intersect the sur-
face z = f (x, y) with horizontal planes.
Sometimes we can identify a surface by examing these traces. Let us see one
example.
Example 2. Match the functions f (x, y) = ln(x2 +y 2 ) and g(x, y) = cos(x2 +
y 2 ) to the surfaces shown below:
f (x, y) = ln(x2 + y 2 ) = c
√ 2
x2 + y 2 = ec = ec
√
corresponds to the circle of radius ec centred at the origin.
3
Hence z = f (x, y) is the surface on the left, and z = g(x, y) is the surface on
the right in the above figure.
To sketch contour plots, we use values of k that are equally spaced. The
surface is:
Solution.
4
2. Cylinder & Quadric Surfaces
We now introduce some special type surfaces, namely the cylinders and
quadric surfaces. These surfaces will be used later on to explain the the-
ory.
5
Example 4. The surface given by
y2 + z2 = 1
is a cylinder.
In fact, any equation in x, y and z where one of the variable is missing is a
cylinder.
Solution.
6
Another common surfaces we shall use frequently are the quadric surfaces.
By translation and rotation, a quadric surface can be brought into one of the
two standard forms:
Ax2 + By 2 + Cz 2 + J = 0 or Ax2 + By 2 + Iz = 0
7
3. Elliptic Paraboloid
For this section and the subsequent ones, it may be helpful to make use of
the following websites for visualization:
http://matkcy.github.io/MA1104-implicitplot.html
http://matkcy.github.io/MA1104-3dgrapher.html
2
x2
The figure below is an example of the graph of the elliptic paraboloid a2
+ yb2 =
z
c
when c > 0.
The point (0, 0, 0) is called the vertex of the elliptic paraboloid above .
(x − x0 )2 (y − y0 )2 (z − z0 )
+ =
a2 b2 c
8
4. Hyperbolic Paraboloid
x2 y 2 z
− = .
a2 b2 c
Horizontal traces: hyperbolas.
Vertical traces: parabolas.
The following website can draw two surfaces in space. If we intersect a given
surface using a horizontal plane z = k (or vertical planes x = k or y = k),
then the intersection curve will be a horizontal (vertical) trace. Try it out
on the hyperbolic paraboloid!
http://matkcy.github.io/MA1104-intersection.html
9
5. Ellipsoid, Cones & Hypeboloid
Definition 8 (Ellipsoid).
x2 y 2 z 2
+ 2 + 2 =1
a2 b c
10
Definition 9 (Elliptic cone – symmetric about the z-axis).
x2 y 2 z 2
+ 2 − 2 =0
a2 b c
Horizontal traces: ellipses.
x2 y 2 z 2
+ 2 − 2 =1
a2 b c
Horizontal traces: ellipses.
11
Definition 11 (Hyperboloid of Two Sheets - symmetric about the z-axis).
x2 y 2 z 2
+ 2 − 2 = −1
a2 b c
Horizontal traces in z = k are ellipses if k > c or k < −c.
12
Example 6. Identify and sketch the surface
x2 + 2z 2 − 6x − y + 10 = 0.
Solution. By completing squares, we rewrite the equation as
z2
(y − 1) = (x − 3)2 +
1/2
z 2 x2
y2 + − = −1.
2 4
This is a hyperboloid of two sheets symmetrical about the x-axis.
13
If the point (x, y, z) moves along a level surface, the value of f (x, y, z) remains
fixed.
14
Example 8. Find the level surfaces of the function
f (x, y, z) = x2 + y 2 + z 2 .
Solution. Each level surface f (x, y, z) = t for some t can be regarded as one
instance of the function at time t. We can then think of f (x, y, z) as evolving
spheres.
8. Limit of f (x, y)
If we write
lim f (x) = L
x→a
we mean as x gets closer and closer (but not equal) to a, the function f (x)
gets closer and closer to L.
Informally, if we write
lim f (x, y) = L
(x,y)→(a,b)
we mean as (x, y) gets closer and closer (but not equal) to (a, b), f (x, y) gets
closer and closer to L.
For two variable function f (x, y), we can get close to a point (a, b) in the
domain via infinitely many directions!
15
Here is the formal definition:
lim f (x, y) = L
(x,y)→(a,b)
p > 0 there exists a number δ > 0 such that |f (x, y)−L| <
if for any number
whenever 0 < (x − a)2 + (y − b)2 < δ.
The definition says that the distance between f (x, y) and L can be made
arbitrarily small by making the distance from (x, y) to (a, b) sufficiently
small (but not 0).
16
• its value L is unique, and
This means that as long as we have two paths through the point (a, b) along
which the limits are different, then the function cannot have limit at (a, b).
lim f (x, y)
(x,y)→(a,b)
17
Solution. Consider the vertical line (path) x = 1, and compute the limit as
y → 0 along this path:
y
lim = lim 1 = 1.
(1,y)→(1,0) 1 + y − 1 y→0
Next, consider the path along the horizontal line y = 0, and compute the
limit as x → 1 along this path:
0
lim = lim 0 = 0.
(x,0)→(1,0) x + 0 − 1 x→1
Since the function approaches different values along two different paths pass-
ing through (1, 0), the limit does not exist at (1, 0).
In general, some of the paths (passing through a given point (a, b)) that we
can try are:
• x = a, y → b (vertical lines);
• y = b, x → a (horizontal lines);
Example 10. Show that the following limit does not exist.
xy
lim .
(x,y)→(0,0) x2 + y 2
18
Similarly, for the path y = 0, we have
0
lim = lim 0 = 0.
(x,0)→(0,0) x2 + 0 x→0
Be careful! Just because these two limits are the same does not mean that
the limit exists.
For a limit to exist, the limit must be the same for ALL paths through (0, 0),
not just the two we had considered.
x2 1 1
lim = lim = .
(x,x)→(0,0) x2 + x2 x→0 2 2
Since this limit does not match the limit along the first two paths we con-
sidered, the limit does not exist.
Example 11. Show that the following limit does not exist:
xy 2
lim
(x,y)→(0,0) x2 + y 4
Solution. Lets approach (0, 0) along the path y = mx, where m is a real
number.
xy 2 x · (mx)2
lim = lim 2
(x,mx)→(0,0) x2 + y 4 x→0 x + (mx)4
xm2
= lim
x→0 1 + m4 x2
limx→0 xm2 0
= = = 0.
limx→0 1 + m4 x2 1
19
2
The function x2xy+y4 approaches the same number 0 as (x, y) → (0, 0) along
y = mx. But this does not imply that the limit of the function is 0.
xy 2 y2 · y2 1
lim 2 4
= lim 4 4
= .
(y ,y)→(0,0) x + y
2 y→0 y + y 2
Since this limit along y 2 = x is different from the one we had previously for
y = mx, we conclude that the limit does not exist.
Theorem 16 (Limit Theorems). Suppose f (x, y) and g(x, y) both have lim-
its as (x, y) approaches (a, b). Then
lim f (x, y)g(x, y) = lim f (x, y) lim g(x, y) .
(x,y)→(a,b) (x,y)→(a,b) (x,y)→(a,b)
20
Theorem 17 (Limit Theorems: continued).
provided
lim g(x, y) 6= 0.
(x,y)→(a,b)
sin(xπ) + cos(yπ)
lim .
(x,y)→(1,1) x2 + y 2
• lim g(x, y) = 0
(x,y)→(a,b)
Then
lim f (x, y) = L.
(x,y)→(a,b)
3x2 y
lim = 0.
(x,y)→(0,0) x2 + y 2
21
3x2 y
Solution. We begin by finding an upper bound for x2 +y 2
− 0 . Notice that
3x2 y x2
− 0 = 3 |y| ≤ 3|y|,
x2 + y 2 x2 + y 2
x2
since x2 +y 2
≤ 1.
Now, since lim(x,y)→(0,0) |y| = 0, the result follows from the Squeeze theorem.
22
Subsequently, the following classes of functions are continuous in its domain.
• Polynomial in x and y;
Example:
x2 + x 3 y
f (x, y) =
x+y
is continuous on
D = {(x, y) : x + y 6= 0}.
x2
For (x, y) 6= (0, 0), since x2 +y 2
≤ 1, we deduce that
x4
|g(x, y)| = 2 2
≤ |x2 | = x2 .
(x + y )
Since lim(x,y)→(0,0) x2 = 0, we deduce from Squeeze theorem that
23
MA1104 Week 3
Partial Derivatives, Chain Rule,
Directional Derivatives
1. Partial Derivative
f (x + h) − f (x)
f 0 (x) = lim
h→0 h
1
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
The curve C1 is the graph of the function g(x) = f (x, b), which is the inter-
section curve of the surface and the vertical plane y = b.
The curve C2 is the graph of the function h(x) = f (a, y), which is the inter-
section curve of the surface and the vertical plane x = a.
2
2. Higher order partial derivatives
Thus, the notation fxy means that we first differentiate with respect to x
and then with respect to y. Notice that the order the variables appear in the
denominator is reversed when using the curly ∂ notation.
3
Example 2. Find all second-order partial derivatives of f (x, y) = x2 y − y 3 +
ln x.
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.
4
3. Tangent plane equation
Recall that we use the derivative f 0 (a) to get the tangent line to the curve
y = f (x) at x = a:
Since the point P (a, b, c) has been given, we just need to look for a normal
vector n to the plane.
5
Thus, a vector normal to the plane is given by the cross product:
Solution. Notice
fx (x, y) = 4x, fx (1, 1) = 4,
z = 4x + 2y − 3.
The figure shows the elliptic paraboloid and its tangent plane at (1, 1, 3) that
we found in the preceding example:
6
4. Differentiability of f (x, y)
7
Then the increment in z at (a, b) is defined by
4z = f (a + 4x, b + 4y) − f (a, b).
Example 4. Let z = 2x2 − xy.
= 0.44.
Informally, differentiability can be defined as follows:
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).
But how good is good? Although the above definition is not rigorous, it does
give an intuition about differentiability: The more we ‘zoom’ into the point
(a, b), the more the surface looks like the tangent plane at that point!
8
Notice that
4z
|{z}
change in the function at (a, b)
Notice that
fx (x, y) = 4x − y, fy (x, y) = −x
So at (1, 2), we have
fx (1, 2) = 2, fy (1, 2) − 1.
Hence we can write
1 , 2 → 0 as 4x, 4y → 0
9
and
2(4x)2 − 4x4y = 1 4x + 2 4y.
There are many choices. Here, we can choose
1 = 24x, 2 = −4x.
5. Linear approximation
Notice that the above result follows immediately from the definition of dif-
ferentiability. Since 4z = f (a + 4x, b + 4y) − f (a, b), we have
Example 5. 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.
10
Using linear approximation, estimate the magnitude of maximum error in
the calculated volume of the cone.
Solution. The volume of the cone is V = πr2 h/3. So
2πrh πr2
4V ≈ Vr 4r + Vh 4h = 4r + 4h.
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 .
• a temperature of 900◦ C
Also, experiments show that
• with no change in temperature, an increase in speed of 0.2 m/s increases
the thickness by 0.06mm,
11
Solution. Let T (s, t) be the thickness function (in mm) depending on the
speed s (in m/s) and temperature t (in ◦ C). Based on the information given,
we have
T (10, 900) = 4
∂T 0.06
≈ = 0.3
∂s 0.2
∂T −0.04
≈ = −0.004
∂t 10
4s = 0.1
4t = −20
Hence, by Linear Approximation:
∂T ∂T
T (10.1, 880) ≈ T (10, 900) + 4s + 4t
∂s ∂t
≈ 4 + 0.3(0.1) − 0.004(−20)
≈ 4.11
6. Chain Rule
The Chain Rule is a very useful tool for differentiation. Recall that for
functions of one variable, the Chain Rule says that:
It turns out that for multivariable functions, there are many different versions
of Chain Rule. We begin with the simplest one.
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
12
Sketch of proof: Since z = f (x, y) is differentiable, for small 4x and 4y,
we have
4z ≈ fx 4x + fy 4y.
Dividing throughout by 4t:
4z 4x 4y
≈ fx + fy .
4t 4t 4t
In the limit, we have the Chain Rule:
dz dx dy
= fx + fy .
dt dt dt
dz ∂z dx ∂z dy
= +
dt ∂x dt ∂y dt
= 2xey (2t) + x2 ey cos t
= 2(t2 − 1)esin t (2t) + (t2 − 1)2 esin t cos t.
13
Theorem 9 ( Chain Rule - Case 2). Suppose that z = f (x, y) is a differ-
entiable 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
Here there are three types of variables:
∂z ∂z
Example 9. If z = ex sin y, where x = st2 and y = s2 t, find ∂s
and ∂t
.
∂z ∂z ∂x ∂z ∂y
= +
∂s ∂x ∂s ∂y ∂s
= (ex sin y)(t2 ) + (ex cos y)(2st)
2 2
= t2 est sin(s2 t) + 2stest cos(s2 t).
∂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).
14
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.
Example 10. Write out the Chain Rule for w = f (x, y, z, t) where
• x = x(u, v),
• y = y(u, v),
• z = z(u, v),
• t = t(u, v).
15
Solution.
∂w ∂w ∂x ∂w ∂y ∂w ∂z ∂w ∂t
= + + + .
∂u ∂x ∂u ∂y ∂u ∂z ∂u ∂t ∂u
∂w ∂w ∂x ∂w ∂y ∂w ∂z ∂w ∂t
= + + + .
∂v ∂x ∂v ∂y ∂v ∂z ∂v ∂t ∂v
∂w ∂w
y +x = 0.
∂x ∂y
Solution. Introduce intermediate variables:
u = x2 − y 2 , v = y 2 − x2 .
16
∂w ∂w ∂w ∂w
= (2xy) + (−2xy) + (−2xy) + (2xy) = 0.
∂u ∂v ∂u ∂v
7. Implicit Differentiation
x2 + y 2 + z 2 − 4 = 0.
ln(x2 yz + xy) + z = 0.
17
Solution. The idea is to use Chain Rule.
∂F
Therefore, if ∂z
6= 0, then
∂F
∂z ∂x Fx
= − ∂F =− .
∂x ∂z
Fz
∂F
Likewise, if ∂z
6= 0, then
∂F
∂z ∂y Fy
= − ∂F = − .
∂y ∂z
Fz
∂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) 6= 0.
∂z
Example 12. Find ∂x
if
x3 + y 3 + z 3 + 6xyz = 1.
18
Therefore, by the Implicit Differentiation Theorem,
∂z Fx 3x2 + 6yz
=− =− 2 .
∂x Fz 3z + 6xy
8. Directional Derivatives
Question: What is the rate of change of f given any direction u = ha, bi?
The discussion below attempts to clarify the rationale behind this definition.
19
Consider the surface S with equation z = f (x, y) (the graph of f ) and we let
z0 = f (x0 , y0 ).
Then, the point P (x0 , y0 , z0 ) lies on S. The vertical plane that passes through
P in the direction of u intersects S in a curve C.
The slope of the tangent line T to C at the point P is the rate of change of
z in the direction of u.
To compute this slope, we need another point on the curve C, say Q(x, y, z).
Let P 0 , Q0 be the projections of P , Q on the xy-plane.
−−→
The vector P 0 Q0 is parallel to u. So
−− →
P 0 Q0 = hu = hha, hbi for some scalar h.
Therefore,
−− →
P 0 Q0 = hx − x0 , y − y0 i = hha, hbi
and so
x = x0 + ha, y = y0 + hb.
20
4z z − z0
=
h h
f (x0 + ha, y0 + hb) − f (x0 , y0 )
= .
h
If we take the limit as h → 0, we obtain the rate of change of z (with respect
to distance) in the direction of u.
This is called the directional derivative of f in the direction of u, provided
the limit exists:
Based on the figure above, we can interpret Du f (x0 , y0 ) as the slope to the
tangent line T in the direction given by u. Hence,
Examples:
21
In the figure above, Du f (x0 , y0 ) < 0.
Proof.
g(h) − g(0)
Du f (x0 , y0 ) = lim
h→0 h
0
= g (0).
22
We now compute g 0 (0) in a different way.
Substituting h = 0:
Notice that
Du f = hfx , fy i · u.
The vector hfx , fy i is so important that we will give it a special name.
Of is read ‘del f ’.
Du f (x, y) = Of (x, y) · u
• if u = i = h1, 0i then
Di f = hfx , fy i · h1, 0i = fx .
23
• if u = j = h0, 1i then
Dj f = hfx , fy i · h0, 1i = fy .
So the partial derivatives of f with respect to x and y are just special cases
of the directional derivative.
24
As in the 2D case, we compute 3D-directional derivative using the gradient
vector.
Du f (x0 , y0 , z0 ) = Of (x, y, z) · u
where
∂f ∂f ∂f
Of = hfx , fy , fz i = i+ j+ k
∂x ∂y ∂z
is the gradient vector.
25
MA1104 Week 4
Gradient Vector, Extrema & Lagrange
Multiplier
1
Let us now see a proof of this theorem.
Proof. Let r(t) = hx(t), y(t)i be a parametrization of the level curve f (x, y) =
k containing the fixed point (x0 , y0 ), i.e. f (x0 , y0 ) = k.
The main idea is to differentiate (with respect to t) both sides of the equa-
tionof the level curve:
f (x, y) = k
Doing this, we get
dx dy
fx + fy =0
dt dt
where the left-hand side follows from the Chain Rule. Since Of = hfx , fy i
and h dx , dy i = r0 (t), we can rewrite the above as
dt dt
hfx , fy i · r0 (t) = 0,
Example 1. Find the equation of the normal line (on the xy-plane) at the
point (2, 1) to the ellipse
x2
+ y 2 = 2.
4
Solution. Let f (x, y) = x2 /4 + y 2 . Then
x = 2 + t, y = 1 + 2t, t ∈ R.
2
Example 2. Find the equation of the tangent line (on the xy-plane) at the
point (2, 1) to the ellipse
x2
+ y 2 = 2.
4
Solution. From previous example, we know that the gradient vector at (2, 1)
is
Of (2, 1) = h1, 2i.
Thus, a vector tangential to the ellipse at (2, 1) is
h2, −1i.
Using this vector as the direction vector for the tangent line, a set of para-
metric equations for the tangent line is:
x = 2 + 2t, y = 1 − t, t ∈ R.
The proof is very similar to the two-variable case. However, we shall omit
the proof here (although it is given in the online lecture videos).
As before, we can visualize this fact in the figure below. Notice that the
gradient vector 4F at the given point P (x0 , y0 , z0 ) is always perpendicular
to the level surface of the function containing that point. In the figure, the
3
gradient vector is pointing away from the level surface, however in general,
it could also be pointing in the opposite direction into the level surface,
depending on the function involved. The point is, the gradient vector must
be perpendicular to the level surface.
Consequently, we can use the gradient vector as a normal vector to the tan-
gent plane to the level surface F (x, y, z) = k at the given point.
OF (x0 , y0 , z0 ) · hx − x0 , y − y0 , z − z0 i = 0
Example 3. Find the equation of the tangent plane at the point (−2, 1, −3)
to the ellipsoid
x2 z2
+ y2 + = 3.
4 9
Solution. The ellipsoid is the level surface (with k = 3) of the function
x2 z2
F (x, y, z) = + y2 + .
4 9
Therefore,
x 2z
Fx (x, y, z) = , Fy (x, y, z) = 2y, Fz =
2 9
2
Fx (−2, 1, −3) = −1, Fy (−2, 1, −3) = 2, Fz (−2, 1, −3) = − .
3
4
The equation of the tangent plane at (−2, 1, −3) is
2
−1(x + 2) + 2(y − 1) − (z + 3) = 0,
3
which simplifies to
3x − 6y + 2z + 18 = 0.
Notice that the same question can beaked for a two-variable function f (x, y).
To fix the idea, consider the rate of change of f (x, y, z) along a unit vector
u at (x0 , y0 , z0 ). Recall that this is just the directional derivative of f along
u at this point:
Du f (x0 , y0 , z0 ) = Of (x0 , y0 , z0 ) · u.
Here is the main Idea: Note that the function f has been fixed by the
context, consequently, its gradient vector Of (x0 , y0 , z0 ) at the fixed point
(x0 , y0 , z0 ) has also been fixed. What can change is the direction u. So we
are going to vary u and see which one gives the maximum or minimum value
of Du f .
5
Let θ be the angle between Of and u. Then
Du f = Of · u
= ||Of || ||u|| cos θ
= ||Of || cos θ (since u is a unit vector)
6
• f increases fastest in the direction of the gradient vector
• Local maximum
• Local minimum
• Saddle points
7
Definition 6 (Local Minimum). Let f (x, y) : D → R. Then f has a local
minimum at (a, b) if
The following is a property that both local max and local min must have.
fx (a, b) = fy (a, b) = 0.
We shall not provide a formal proof here. Instead, we shall establish the
intuition behind this fact. Just imagine you are standing at a local minimum
on the surface of a two-variable function. All the points around you in the
vicinity must be ‘higher’ than where you are standing. This says that you
must be standing upright or on a flat plane, as shown in the figure below.
This implies that the tangent plane at local minimum must be flat! In other
words, the equation of the tangent plane is z = c, where c is some constant.
The same can be said when you are standing on a local max:
8
But now, recall that the tangent plane equation at the point you are standing,
say (a, b), is
fx (a, b) = fy (a, b) = 0.
However, the converse of the preceding theorem is NOT true! The fact that
the tangent plane is flat at (a, b) DOES NOT imply that the point is a local
max or local min.
In the following figure, we notice that the tangent plane at which we are
standing is flat, but there points in the vicinity which are larger as well as
smaller than the value of our function at that point.
9
The last figure above suggests that we consider another type of points, called
the Saddle Points.
Definition 9 (Saddle Point). Let f (x, y) : D → R. Then A point (a, b) is
called a saddle point of f if
• fx (a, b) = fy (a, b) = 0; AND
10
So the only candidate is (0, 0).
• If y = 0 and x 6= 0, then
• If x = 0 and y 6= 0, then
11
5. Finding Absolute Maximum/Minimum
12
Examples of closed and bounded sets in R2 :
The following are the basic steps for finding Absolute Maximum/Minimum
- The Closed Interval Method:
13
Example 6. Find the absolute maximum and absolute minimum values of
the function f (x, y) = x2 − 2xy + 2y on the rectangle
D = {(x, y) : 0 ≤ x ≤ 3, 0 ≤ y ≤ 2}.
Solution.
fx = 2x − 2y = 0, fy = −2x + 2 = 0,
we obtain only one critical point (1, 1), which yields f (1, 1) = 1.
On L1 , we have y = 0, so
f (x, 0) = x2 0 ≤ x ≤ 3.
14
On L2 , we have x = 3, so
f (3, y) = 9 − 4y 0 ≤ y ≤ 2.
On L3 , we have y = 2, so
f (x, 2) = x2 − 4x + 4 0 ≤ x ≤ 3.
Finally, on L4 , we have x = 0, so
f (0, y) = 2y 0 ≤ y ≤ 2.
point value of f
(1, 1) 1
(0, 0) 0
(3, 0) 9
(3, 2) 1
(0, 2) 4
(2, 2) 0
15
Instead of proving this method in a rigorous manner, I will just explain the
idea behind this technique by using the following example.
Let us assume that the function f has a maximum on the constraint g(x, y) =
k. Instead of visualising the function as surface, we can look at its level
curves. This way, we can visualise the level curves of f and the constraint
curve g(x, y) = k simultaneously on the xy-plane as shown below.
16
Starting from a point on the constraint curve g(x, y) = k, we are going to move
along the curve as to maximise the function value.
Each time we arrive at a new point, we shall answer the question ‘Are we at the
maximum yet?’.
If the answer is ‘No’, we will keep moving in the direction that can increase our
function value.
Let the red dot represent the point (x0 , y0 ), which is our current position.
Suppose we are now at the following point:
The function value at this point cannot be maximum, since it lies between
the level curves f (x, y) = 7 and f (x, y) = 8. Its value must be somewhere
between 7 and 8. This can be increased slightly if we move towards the right.
17
Again, the function value at this point cannot be maximum, since it lies
between the level curves f (x, y) = 9 and f (x, y) = 10. Its value must be
somewhere between 9 and 10. This can be increased slightly if we move
towards the right.
Again, the function value at this point cannot be maximum, since it lies
between the level curves f (x, y) = 8 and f (x, y) = 9. Its value must be
somewhere between 8 and 9. This can be increased slightly if we reverse the
direction from which we cam from just now.
18
Again, the function value at this point cannot be maximum, since it lies
between the level curves f (x, y) = 9 and f (x, y) = 10. Its value must be
somewhere between 9 and 10.
It is not hard to believe that at the maximum (or minimum) point (x0 , y0 ),
the level curve f (x, y) containing (x0 , y0 ) and the constraint curve g(x, y) = k
must have the same tangent line!
This means that at the maximum (minimum) point (x0 , y0 ), the gradient
vectors are parallel to each other:
Of (x0 , y0 ) = λOg(x0 , y0 )
19
The following are the steps of the method of Lagrange Mutiplier for two-
variable functions:
20
• x = 0: Then it follows from (e3) that y = ±1. So the solutions are
(0, 1) and (0, −1).
Summary:
21
Problem: Find the extrema of f (x, y, z) subject to a given the constraint
g(x, y, z) = k.
Again, we can answer this question by using the Method of Lagrange Multi-
pliers.
Then
Of (x0 , y0 , z0 ) = λOg(x0 , y0 , z0 )
for some constant λ (called a Lagrange Multiplier).
s
Below are steps of the method of Lagrange Multipliers in the three-variables
case:
Of (x, y, z) = λOg(x, y, z)
and
g(x, y, z) = k.
By comparing components of the gradient vectors in the first equation, we
have to solve the following system of equations:
fx = λgx
fy = λgy
fz = λgz
g(x, y, z) = k.
22
Our aim is to find the point(s) (x, y, z) satisfying the above equations. Oc-
casionally, we still have to solve for λ first before we can get to the solutions
for (x, y, z).
We wish to maximize
V (x, y, z) = xyz
subject to the constraint
yz = λ(2z + y) (E1)
xz = λ(2z + x) (E2)
23
Note that none of x, y, z can be 0 (why?).
Hence
x = 2, y = 2, z = 1.
24