MATB41 - Full Course Note
MATB41 - Full Course Note
MATB41 - Full Course Note
To find the slant asymptotes when x and y are both large, change the
number 1 on the right side of the equation to 0.
Curved Surfaces
An equation involving x, y, z, gives a curved surface in 3D space.
In general, this surface is difficult to imagine and sketch in 3D.
x2 + y 2 + z 2 = R 2
Question 1
Sketch the following curves.
1. x = 2y 2 4. x2 + 3y 2 + 2x 12y + 10 = 0
x2 y 2 5. y 2 x2 = 1
2. + =1
2 9
(x 2)2 (y + 2)2
2 2
3. x + 2y = 4 6. =1
4 9
Question 2
Sketch the following surfaces.
1. x2 + y 2 = 1 z2
4. x2 + y 2 + =1
4
2. z = x2 + y 2 p
5. z = ( x2 + y 2 1)2
3. z 2 = x2 + y 2 6. x2 + y 2 + z 2 = 2z
The point can also be interpreted as a vector, written in the same way.
We can also think of a vector as an arrow from the origin to the point.
Matrix
A matrix is a block of numbers written in a rectangle (or square) in a specific
order. For example, A is a 2 ⇥ 3 (2 by 3)matrix, with 2 rows and 3 columns:
1 2 0
A=
0 5 2
We may think of vectors as 1 ⇥ n or n ⇥ 1 matrix. (for n = 2 or 3)
We can add matrices, and multiply matrices by a scalar (number).
1 2 5 6 1+5 2+6 6 8
+ = =
3 4 7 8 3+7 4+8 10 12
1 2 c·1 c·2 c 2c
c = =
3 4 c·3 c·4 3c 4c
Standard arithmetic rules apply. For matrices A, B, and scalar c:
A+B =B+A cA = Ac c(A + B) = cA + cB
3 Determinant
The determinant of a square matrix is a number.
Start at the first row, first position, write down this value, and remove this
row and this column from the original matrix. Multiply this value to the
determinant of the remaining matrix.
2 3
1 2 3
4 5 5 6
det 4 5 6 = 1 · det ...
8 9
7 8 9
Now move right, write down this value, and remove this row and this column
from the original matrix. Multiply this value to the determinant of the
remaining matrix with a minus sign.
2 3
1 2 3
4 5 5 6 4 6
det 4 5 6 = 1 · det 2 · det ...
8 9 7 9
7 8 9
Now move right again and repeat until we reached the last column. The
positive and negative sign need to alternate.
2 3
1 2 3
5 6 4 6 4 5
det 44 5 6 5 = 1 · det 2 · det + 3 · det
8 9 7 9 7 8
7 8 9
Each time we apply the algorithm, we end up with several new determinants
to calculate, but with matrices of smaller sizes.
a b
det = ad bc
c d
Determinant does not behave well with addition and scalar multiplication:
Question 3
Find the determinant. 2 3 2 3
1 3 3 3 1 0
3 1 4
1. 2. 3 5 25 3. 41 3 45
2 5
4 4 6 0 0 4
4 Dot product
2 vectors can form a dot product, and the result is a scalar (number).
2 3 2 3
x1 y1
6 x2 7 6 y2 7
~x · ~y = 4 5 · 4 5 = x1 y1 + x2 y2 + ...
.. ..
. .
Note that this dot product is di↵erent from scalar multiplication, as we are
multiplying 2 vectors together, not a scalar with a vector.
Question 4
Find the length of the vectors. Find ~a · ~b and the angle between them.
1. ~a = (4, 3), ~b = (2, 1).
2. ~a = (4, 0, 2), ~b = (2, 1, 0).
5 Cross product
2 vectors (in 3D) can form a cross product, and the result is a vector (in 3D).
Question 5
Let ~x = (3, 2, 1), ~y = (1, 1, 1). Find ~x ⇥ ~y .
Plane
For a plane to be defined, we need a normal vector ~n = (a, b, c) and a point
on the plane r~0 .
~n · ~r = ~n · r~0
ax + by + cz = ~n · r~0
where ~r is the same as above and does not need to be determined.
The normal vector ~n is orthogonal to the plane.
~n and r~0 are not unique, any correct pair would give the right equation.)
Question 6
Find the equation of the line or plane.
1. The line through ( 8, 0, 4) and (3, 2, 4).
2. The plane through the origin and perpendicular to the vector (1, 5, 2).
3. The plane through (2, 4, 6) parallel to the plane x + y z = 5.
4. The plane through (0, 1, 1), (1, 0, 1), (1, 1, 0).
5. The plane equidistant from point (3, 1, 5) and ( 2, 0, 0).
7 Multivariable Function
In first year, we study 1D functions: functions of one variable, as f (x).
This can be plotted in 2D plane, with y = f (x).
Now, we can study functions of multiple variables.
2D Function
A 2D function, f (x, y), has 2 inputs being x, y, and 1 output.
3D Function
A 3D function, f (x, y, z), has 3 inputs being x, y, z, and 1 output.
It is possible to label the output as w = f (x, y, z), but this is typically not
useful as this introduces a 4th variable. The ”plot” of this function would be
in 4D space, which does not exist.
Level Set
The level set of f at k is given by setting f to be equal to the constant k.
This will reduce the dimension of f by 1.
Question 7
1. Draw the level set of f (x, y) = 4x2 + y 2 + 1 for k = 2, k = 5.
2. Draw the level set of f (x, y, z) = x2 + y 2 z for k = 0 and k = 2.
It turns out that it is much easier to show a limit does not exist.
3. Try with several di↵erent g(x) and h(y) to attain many (1D) limits.
Since most limit evaluation techniques does not work for 2D functions, it is
a very fortunate fact that Squeeze Theorem does work for 2D functions. The
formulation is almost the same as the 1D version.
Squeeze Theorem
To attain lim f (x, y), can try to find g(x, y) and h(x, y) so that:
(x,y)!~a
Start at |f (x, y)|, create a chain of inequality, and simplify |f (x, y)| to
attain |g(x, y)|, which has limit 0 as (x, y) approaches ~a :
|f (x, y)| ... |g(x, y)| ! 0 i.e. lim |g(x, y)| = 0
(x,y)!~a
Question 8
x2 y
f (x, y) = 4 and f (0, 0) = 0
x + y2
Show the limit at (x, y) = (0, 0) does not exist.
Question 9
xy
f (x, y) = p and f (0, 0) = 0
x4 + y 2
Show the function is continuous at (0, 0).
Question 10
x2 sin2 y
Find lim
(x,y)!(0,0) 2x4 + y 2
9 Derivative
Consider multivariable function f (x, y) or f (x, y, z).
Define the derivative to be:
@f @f
For f (x, y) rf = ( , )
@x @y
@f @f @f
For f (x, y, z) rf = ( , , )
@x @y @z
where rf is called ’del’ f, or gradient of f.
We can interpret rf as a vector, even though f (x, y) or f (x, y, z) is a scalar.
@f
The quantities in rf such as , are called partial derivatives.
@x
When taking partial derivatives with respect to a variable,
we regard all other variables as constants and take derivative as usual.
@f @f @f
Sometimes, we use the notation: = fx = fy = fz
@x @y @z
Example
Let f (x, y) = x2 y 3 + x.
@f
To take the partial derivative with respect to x, , we view y as constant.
@x
@f
To take the partial derivative with respect to y, , we view x as constant.
@y
@f @f
= 2xy 3 + 1 = 3x2 y 2
@x @y
Let f (x, y, z) = x2 z + yz 2 .
@f
To take the partial derivative with respect to x, , we view both y, z as constants.
@x
Similarly, for other partial derivatives:
@f @f @f
= 2xz = z2 = x2 + 2yz
@x @y @z
Question 11
Compute rf .
2
1. f (x, y) = (x2 1)(y + 1) 2. f (x, y) = (xy 2)2 3. f (x, y) =
x + 3y
4. f (x, y) = ex+4y 5. f (x, y, z) = x2 + 2z 1 6. f (x, y, z) = yexz
10 Directional Derivative
Remember one dimensional derivatives in first year?
f (a + h) f (a)
f 0 (a) = lim
h!0 h
where f is defined on the real line.
We start at the point x = a, and we ask, if we move just a tiny bit, away
from x = a, how much does the function change?
Facts:
1. Partial derivatives are directional derivatives with ~u being in a
coordinate direction. Example, for f (x, y):
@f @f
= D~u f = D~u f
@x @y
with ~u = (1, 0) with ~u = (0, 1)
2. If f is di↵erentiable, then all directional derivative exist and
D~u f = rf · ~u
where ~u is a unit vector.
This formula gives an easy way to calculate directional derivative.
Question 13
f (x, y, z) = x2 y + z. At the point (2, 2, 1), find the maximum rate of change,
and the direction with the maximum.
(The direction with maximum rate of change is rf , and the value of this
maximum rate of change is |rf |.)
Question 14
f (x, y, z) = xy 2 ez . Let f (x, y, z) = e.
At the point (1, 1, 1), find the equation of the tangent plane.
Question 15
Find all directional derivatives at (0, 0) (including the partials), if they exist.
Is the function continuous at (0, 0)?
8
< xy (x, y) 6= (0, 0)
a) f (x, y) = x2 + y 2
:0 (x, y) = (0, 0)
p
b) f (x, y) = |xy|
Strategy:
When the function has division by 0, or some other problems at the origin
(such as absolute value or square root), we must use the definition of di-
rectional derivative, because f may not be di↵erentiable at (0, 0) so the
formula rf ·~u does not work. Set ~a = (0, 0) and ~u = (a, b), where a2 +b2 = 1.
11 Di↵erentiation
f is di↵erentiable if the gradient vector rf (~a) satisfies
f (~a + ~h) f (~a) rf (~a) · ~h
lim =0
~h!0 |~h|
Note: This is a 2D limit. This limit is typically used when ~a = (0, 0), so
we may set ~h = (x, y), and show the limit is zero (using Squeeze Theorem).
Facts:
1. If f is C 1 at ~a, then f is di↵erentiable at ~a (rf exists).
C 1 : All partial derivatives exist near ~a and including at ~a,
and the partial derivatives are continuous (as functions) at ~a.
2. Being di↵erentiable is a stronger condition than having directional derivative.
Recall, if rf exist, the directional derivative is given by D~u f = rf · ~u
3. If a function is di↵erentiable at ~a, then f is continuous at ~a.
Question 16 8 2
< xy (x, y) 6= (0, 0)
f (x, y) = x4 + y 2
:
0 (x, y) = (0, 0)
Show the directional derivatives exist at (0,0), but f is not di↵erentiable at (0,0).
Strategy:
There are 2 ways to approach the problem.
1. If the function is not continuous at (0, 0), then it is not di↵erentiable at (0, 0).
So we may try to show it is not continuous at (0, 0). However, some functions
are continuous at (0, 0), so we can attain no conclusion in such cases.
2. Compute all the directional derivatives. If f is di↵erentiable, then
every directional derivative should satisfy D~u f = rf · ~u.
1 1
Check this equation for ~u = (1, 0), ~u = (0, 1), ~u = ( p , p ) (easy unit vectors)
2 2
Question 17
Show whether the function is di↵erentiable at (0, 0).
8 8 4
< p x|y|
> 4
(x, y) 6= (0, 0) <x + y (x, y) 6= (0, 0)
a) f (x, y) = x2 + y 2 b) f (x, y) = x2 + y 2
>
:0 :
(x, y) = (0, 0) 0 (x, y) = (0, 0)
C 2 : All 2nd order partial derivatives exist near ~a and including at ~a,
and the 2nd order partial derivatives are continuous (as functions) at ~a.
(In practice, a function can fail to be continuous when there is division by zero.)
We can also construct the Hessian for f (x, y, z), which will be a 3 ⇥ 3 matrix.
We can also construct higher order derivatives, such as 3rd order fxyz or fxyy .
In general, if f is C k , then mixed partial derivatives commute (up to order k).
Question 18
Find the Hessian Matrix.
1. f (x, y) = 3x2 + 4xy + 5y 2 2. f (x, y) = cos(x + 2y) 3.f (x, y) = e2x+y
x2 +y
4. f (x, y) = e 5. f (x, y) = e sin(y) 6. f (x, y, z) = x2 y + xz + z 2
x
Question819
3 3
< x y xy (x, y) 6= (0, 0)
f (x, y) = x2 + y 2
:
0 (x, y) = (0, 0)
Find fx , fy at (x, y) = (0, 0) and (x, y) 6= (0, 0) . Then show fxy 6= fyx at (0, 0).
i.e. Taking 2nd derivatives in di↵erent order give di↵erent answers.
Is f C 2 at (0, 0)? (and have we reached a contradiction?)
13 Critical Points
In first year, we found critical points of functions by setting the derivative
to zero. Then we check their second derivative to conclude whether critical
points are max or min. In higher dimensions, it is very similar.
@yx @y 2
Note that H can contain x and y, so H would be di↵erent for di↵erent points.
For each critical point ~a,
if Det(H (~a)) > 0, look at the top left entry:
@ 2f
if (~a) > 0, then it is a local minimum.
@x2
2
@ f
if (~a) < 0, then it is a local maximum.
@x2
if Det(H (~a)) < 0, then it is a saddle point.
if Det(H (~a)) = 0, then it is inconclusive.
Question 20
Find and classify all critical points.
1. f (x, y) = 3x2 + 4xy + 5y 2
2. f (x, y) = x2 + 3y 4 + 4y 3 12y 2
3. f (x, y) = (x 1)(x2 y 2 )
2 2
4. f (x, y) = (x2 + 2y 2 )e x y
Question 21
Let f (x, y) = x2 + y 2 4x.
Find the max and min inside the triangle D defined by (0, -3), (0, 3), (3, 0).
14 Lagrange Multiplier
Sometimes, we want to maximim/minimize a function on some specific curve,
or there are some constraints on the variables that the function takes in.
and µ are constants that you need to solve for, along with n variables of f .
The equation is an equation for vectors, so each of the components are equal.
So, there are n equations in the formula since rf has n components.
For each constant like or µ, there is a equation of constraint for each.
So if there are 2 constraints, there are n + 2 variables that you need to solve,
and you have n + 2 equations to do it.
You are not allowed to divide by zero when you cancel terms.
When attempting to divide a quantity x, you need to split into 2 cases:
Case 1: when x 6= 0 and you can divide
Case 2: when x = 0
Question 22
Find the max and min of the function f (x, y) subject to constraints given.
f (x, y) = 3x 6y with constraint 4x2 + 2y 2 = 25
Question 23
Consider the curve in R2 , C : y = x2
Find the point p on C so that the distance between p and (0, -1) is smallest.
2
Strategy: We minimize f (x, y) = distance2 = (x 0)2 + y ( 1)
Question 24
Consider 2 curves in R2 , C1 : y = x2 and C2 : y = x 1
Find points p on C1 and q on C2 so that the distance between them is smallest.
15 Regular Integral in 2D
1 Dimensional Integration
In 1 dimensional integration, we have a function that depends only on x.
We can plot the function in 2D, by letting the y = f (x).
This is called the graph of the function.
The result of the integral represents the (2 dimensional) area under the curve
y = f (x) above the interval [a, b]. (if f (x) > 0)
2 Dimensional Integration
In 2 dimensional integration, we have a function that depends on x and y.
For example, f (x, y) = xy + x2 , f (x, y) = ex sin(xy + 1).
z = sin(y) + 2x
The value of the integral over the domain corresponds to the 3D volume
under the curved surface f (x, y) above the domain of integration.
Thus, when we try to integrate a 2D function f (x, y) over any domain that
is a 1D curve in the xy-plane, we would be trying to find the volume above
the 1D curve. By agreeing that a curve is infinitely thin, we conclude that
the volume above the curve must be zero.
This is why our domain of integration for f (x, y) must be a 2D area.
Compute 2D Integrals
A 2D integral typically will look like this:
Z
f (x, y)
D
2. For all points inside the domain, determine the maximum and minimum
values of x. These two values will be constant numbers xmin , xmax .
4. Repeat step 3 several times. For di↵erent values of x chosen, the max
and min values of y would be di↵erent. Typically, all the minimum
values of y would lie on a smooth curve, ymin = m(x). Similarly, the
maximum values would be the same, ymax = M (x). In other words,
the max and min of y is a function of x.
In the above steps, we first fixed x, and let y vary between the lower bound
curve and the upper bound curve while integrating. Then we add (integrate)
all possible values of x.
We can also do the reverse by first attaining the min and max values of y in
the domain.
1. Draw the domain in the xy-plane.
2. For all points inside the domain, determine the maximum and minimum
values of y. These two values will be constant numbers ymin , ymax .
3. Pick a random value of y between the minimum and maximum. Con-
sider the horizontal line that passes through the point y. Consider
the maximum and minimum values of x on the horizontal line.
4. Repeat step 3 several times. For di↵erent values of y chosen, the max
and min values of x would be di↵erent. Typically, all the minimum
values of x would lie on a smooth curve, xmin = m(y). Similarly, the
maximum values would be the same, xmax = M (y). In other words,
the max and min of x is a function of y.
5. Thus the integral can be evaluated as
Z Z y=ymax Z x=M (y) !
f (x, y) = f (x, y) dx dy
D y=ymin x=m(y)
This is not a good name since, when the order is changed, the limits of
integrationg are almost never the same. In fact, the outer integral would
always have limits that are constant numbers.
Fubini’s Theorem tells us that the 2 results will always be the same regard-
less of the order we choose, so we are free to choose the order of integration
to our convenience when calculating 2D integrals.
(Fubini’s Theorem requires all relevant integrals to be integrable.
Typically no division by zero will ensure the function is integrable.)
Properties of Integrals
For integrals over some domain D in Rn with integrable functions:
Z Z Z Z Z
(f + g) = f+ g cf = c f
D D D D D
If f g on all of D, then Z Z
f g
D D
|f | is integrable and Z Z
f |f |
D D
If domain C is contained in D and f 0, then
Z Z
f f
C D
Notice that all properties of integral are shared with the integral in 1D.
n-dimensional Volume
For any set D in Rn , define the n-dimensional volume of D:
Z
V = 1
D
Example 1
Let f (x, y) = 10. Let D be the unit square between 0 and 1.
By noticing that the function is constant, we can see that the plot in 3D
space will be a flat surface.
The integral will represent the volume of the rectangular prism, which
can be calculated as base area ⇥ height.
Thus, the answer will be 10 · 1 = 10.
Example 2
Let f (x, y) = x. Let D be the triangle with vertices (0, 0), (1, 0), (1, 2).
Example 3
Let x > 0, y > 0. Let D be the domain defined by y > x3 .
Example 4
Let f (x, y) be a function. Let D be bounded by y = x and y = x2 .
After drawing the curve, we see that the intersection is at (0, 0) and (1, 1).
We see that the min value of y lie on the curve y = x2 = m(x).
The max value of y is y = x = M (x).
Z Z x=1 ⇣ Z y=x ⌘
f (x, y) = f (x, y) dy dx
D x=0 y=x2
Example 5
Let D be bounded by y = x and y = x + 2, y = 0.
The max value of y is not a smooth curve due to the sharp point at x = 1.
We can split the integral in 2 pieces, with x 2 [0, 1], and x 2 [1, 2].
Z Z x=1 ⇣ Z y=x ⌘ Z x=2 ⇣ Z y= x+2 ⌘
f (x, y) = f (x, y) dy dx + f (x, y) dy dx
D x=0 y=0 x=1 y=0
We can also interchange the order of integration.
Question 25
Let D be bounded by y = x and y = x + 2, y = 0.
Compute the integral by changing the order of integration.
Compare with example 5, notice that we no longer need to split up the
domain, because the sharp point is now the endpoint of the integral.
QuestionR 26
Integrate D f (x, y).
1. Let D be bounded by x = 0, y = 0, y = 2x + 2.
2. Let D be bounded by y = x + 1, y = x2 + 1.
3. Let D be the triangle defined by (0, 2), (0, -2), (2, 0).
4. Let D = {(x, y) 2 R2 | x 2 [0, 1], y 2 [0, 1], y > x2 }
Question 27
Evaluate Z y=1 ⇣Z x=y 4
sin x ⌘
y p dx dy
y=0 x=0 (1 x)
Strategy:
The function looks difficult. What is the region of integration?
Try changing the order of integration.
Question 28
Evaluate.
1. Z x=8 ⇣Z y=2
x ⌘
dy dx
x=0
p
y= 3 x y7 + 1
2. Z x=4 ⇣Z y=2 ⌘
p
y cos(y 4 + 3) dy dx
x=0 y= x
3. Z y=1 ⇣Z p
x= y
sin x ⌘
dx dy
y=0 x=y x
4. Z y=1 ⇣Z x=arccos y ⌘
e2 sin x dx dy
y=0 x=0
16 Regular Integral in 3D
To compute integral of f (x, y, z) over a 3 dimensional domain D, it is similar.
1. Draw the domain in 3D. (This is difficult)
2. Take the projection of the 3D domain onto one of the 3 planes created
by the axis. This creates a 2D domain.
Suppose in this case, we take the projection onto the xy-plane.
3. Compute the limits of integration for the 2D domain in xy-plane
(as a 2D integral). These will be the limits of the outer most integrals.
Match dx and dy according to the order used.
4. Pick a random point (x, y) in the projection. Consider the vertical
line in the z direction. Consider the maximum and minimum values of z.
5. Repeat step 4 several times. The min and max values of z usually
will be on a smooth surface that depend on the point (x, y). Thus
zmin = m(x, y) and zmax = M (x, y).
These are the limits of the inner most integral, with dz.
Z Z Z z=M (x,y) !
f (x, y, z) = f (x, y, z) dz dx dy
D 2D z=m(x,y)
where the order of dxdy depends upon the order chosen for the 2D integral.
In general, inner limits can depend on variables from outer integrals, but
limits of outer integrals never depend on variables from inner integrals.
17 Vector Function
So far, we have considered multi-variable functions.
The function takes in 2 (or 3) inputs, and gives out 1 output:
f (x, y) : R2 ! R
f (x, y, z) : R3 ! R
We can also have vector functions, which gives multiple outputs.
In general, we can have
f : Rm ! Rn
2 3
x1 2 3
6 x2 7 y1
6 7 6 y2 7
6 7 6 7
f 6 x3 7 = 6 .. 7
6 .. 7 4 . 5
4 . 5
yn
xm
It is called a vector function, since f have many outputs, so the outputs as
a whole can be regarded as a vector.
f (~x) = ~y
Each output, may depend on all of the inputs, and so each output is a
coordinate function that depends on all of the input variables.
In other words, a vector function is made up of many multi-variable functions.
2 3
x1 2 3 2 3
6 x2 7 f 1 (x 1 , x 2 , ..., x m ) y1
6 7 6 f2 (x1 , x2 , ..., xm ) 7 6 y2 7
6 7 6 7 6 7
f 6 x3 7 = 6 .. 7 = 6 .. 7
6 .. 7 4 . 5 4.5
4 . 5
fn (x1 , x2 , ..., xm ) yn
xm
Parametrization
When f goes from a lower dimensional space, to a higher dimensional space,
we sometimes call f a parametrization.
1D Parametrization
f (t) : R ! R2 OR f (t) : R ! R3
where we have used the variable t as the input of f .
Thus for each t, f (t) = (x, y) is a point in 2D, or f (t) = (x, y, z) in 3D.
In fact, this is one of the most important ways to describe a curve in higher
dimensions, and finding a parametrization for a given curve is an important
skill in Calculus.
Example
Given a circle of radius R at the origin, we can choose the parametrization
to be:
f (t) = (R cos t, R sin t) = (x, y) t 2 [0, 2⇡]
where x = R cos t, y = R sin t in polar coordinates.
The parametrization starts at t = 0, which is the point (R, 0). Then as t
increases, f (t) traverses the circle counter-clockwise, as t = ✓ is the angle,
and back to (R, 0) when t = 2⇡.
However, parametrization is not unique. The same circle can be parametrized by:
f (t) = (R sin t, R cos t) = (x, y) t 2 [0, 2⇡]
where x = R cos t, y = R sin t is not the standard polar coordinates.
The parametrization starts at t = 0, which is the point (0, R). Then as t
increases, f (t) traverses the circle clockwise, since t is now the angle
between the point (x, y) and the positive y-axis.
We still traverse the whole circle, but this is the less natural parametrization.
2D Parametrization
f (u, v) : R2 ! R3
where we have used the variables u, v as the inputs of f .
Thus for each (u, v) in 2D, f (u, v) = (x, y, z) is a point in 3D.
Example
If we consider the plane z = x + y + 10 that is above the unit square on the
xy-plane, we may choose the parametrization to be:
f (u, v) = (u, v, u + v + 10) = (x, y, z) u 2 [0, 1] v 2 [0, 1]
This is called the natural parametrization, as we have set u = x and v = y.
For any point (x, y) = (u, v) on the xy-plane, f takes in this point, and gives
out the same point with a new 3rd coordinate, or height, with the 3rd
component defined by f : z = u + v + 10.
This lifts up the unit square from the xy-plane, onto the plane z = x+y+10.
However, notice that the square is now slanted, and also stretched.
In this case, the plane z = x + y + 10 is flat, but in general, f lifts up a flat
region in 2D, into a curved surface in 3D, with some stretching.
Coordinate Transformation
When f goes between spaces of the same dimension, we sometimes call f a
coordinate transformation.
f (u, v) : R2 ! R2 OR f (u, v, w) : R3 ! R3
where f (u, v) = (x, y), and f (u, v, w) = (x, y, z).
Example
Given a solid circle of radius R at the origin, x2 + y 2 R2 , it is a region in
2D. We know that representingp this region is complicated in (x, y), where we
get expressions such as y = R2 x2 .
For f to turn a rectangle into a circle, it must stretch the rectangle at multiple
places, at di↵erent rates, which is based on the definition of f .
18 Derivative Matrix
Given a vector function, for example f (x, y, z),
2 3 2 3
x f1 (x, y, z)
f 4y 5 = 4f2 (x, y, z)5
z f3 (x, y, z)
The derivative of a vector function is Df , called the derivative matrix.
For the first row of the matrix, we take the first coordinate function, and
take the partial derivative with respect to all possible variables (x, y, z) in
order, horizontally. Then for each coordinate function, we do the same thing
to get a new row of the matrix.
2 3
@ @ @
f f f
6 @x 1 @y 1 @z 1 7
6@ @ @ 7
6 7
Df = 6 f 2 f2 f2 7
6 @x @y @z 7
4@ @ @ 5
f3 f3 f3
@x @y @z
Relation to Gradient rf
For a multi-variable function f (x, y, z) : R3 ! R, it returns one value.
(For example, f (x, y, z) = xyz 2 )
@ @ @
Df = rf = ( f, f, f )
@x @y @z
where the derivative matrix has only 1 row.
On the other hand, for a vector function: f (x, y, z) = (f1 , f2 , f3 ), each row
of Df is the gradient of all the coordinate functions:
2 3
—rf1 —
Df = 4—rf2 —5
—rf3 —
where rfi are viewed as horizontal vectors in the matrix.
Question 30
f (x, y, z) = (3x + y, ey z, xyz)
First, state the dimension of the vector f takes in, and the dimension of the
vector f gives out. Then, compute Df .
1. Polar Coordinates
Need to integrate f (x, y)
Question 31
Integrate f (x, y) = x over D = {1 x2 + y 2 4} in the 2nd quadrant.
Question Z 32
+1 p
2
Show that e x dx = ⇡
1
Strategy: Z 1
x2 2
The normal distribution has no anti-derivative. Start with ( e ) and
1
write it as a product of 2 same things. Then change the variable in one
integral from x to y, and use the polar coordinate transformation.
Polar Curve
r represent the distance from the point (x, y) to the origin,
✓ represent the angle rotated counterclockwise from x-axis to the point.
Negative angles represent angles rotated clockwise.
Thus ✓ = ⇡ is the same as ✓ = ⇡.
Question 33
a) Find the area enclosed by polar curve h(✓), but ouside of polar curve k(✓):
h(✓) = r = 1 + cos(✓), k(✓) = r = 3cos(✓)
Strategy:
Plot the curve. Find the intersection between the polar curves. First choose
the min and max value of ✓ as the outer integral, then r would start from
the smaller value (inner polar curve) to the larger value (outer polar curve).
b) Sketch the curve r = 1 + 2cos✓ and find the area it encloses in the outer
loop but outside the inner loop.
Strategy:
This shape is complicated and it crosses itself. We can not apply the formula
directly , we need to use symmetry and subtract the inner area.
2. Cylindrical Coordinates
Need to integrate f (x, y, z)
Question 34 p
z = h(x, y) = a · ( (x2 + y 2 ) 1)2 a>0
Consider the volume:
inside the cylinder x2 + y 2 = 1, above z = 0, and below z = h(x, y)
Find a so that the volume is 1.
3. Spherical Coordinates
Need to integrate f (x, y, z)
For any specific point (x, y, z), it can be described by the radius and 2 angles:
⇢2 = x 2 + y 2 + z 2
Det(Dg ) = ⇢2 sin
Question 35
Find the 3D-volume of a solid hemisphere in R3 with radius R and x > 0.
Strategy:
Recall integrating the function f = 1 gives the volume of the domain.
Question 36 p p p
Consider the surface A characterized by z = 3 (x2 + y 2 ) = 3 · r, where
r is the radius in cylindrical coordinates.
Consider the surface B as the sphere of radius 2, x2 + y 2 + z 2 = 4.
Find the volume bounded by surface A and B in 2 ways:
Question 37 p
Compute the volume above the cone z = x2 + y 2 and below the sphere
x2 + y 2 + z 2 = 2z.
Strategy:
Since the sphere is not centered at the origin, the range of ⇢ is NOT 0 to 1.
Use the defining equation x2 + y 2 + z 2 = 2z and switch variables to spherical
coordinates to attain ⇢ = 2cos( ). Notice ⇢ varies in terms of the value in
3D, similar to polar curves in 2D, so we must put it as the innermost integral.
4. Ellipse Transformation
To integrate over an ellipse, we write the equation of ellipse as
⇣ x ⌘2 ⇣ y ⌘2
+ =1
a b
Similar to polar coordinates, we use
Det(Dg ) = abr
Since the stretching factors of the ellipse are included in function g, the range
of radius is always r : 0 ! 1.
✓ does not exactly represent the angle from polar coordinates anymore.
⇡ 3⇡
It still works as normal for these angles: ✓ = 0, , ⇡, , 2⇡...
2 2
A full ellipse is still ✓ : 0 ! 2⇡.
Question 38
Verify Det(Dg ) = abr.
Then find the area of the ellipse given by the standard equation above.
Question 39
Integrate f (x, y) = sin(2x2 + 4y 2 ) over the region bounded by 2x2 + 4y 2 = 4.
Question 40 p
Compute the volume above z = 2x2 + y 2 and below z = 2.
Strategy:
This surface is not given by a circular rotation, with r2 = x2 + y 2 .
However, it is similar. We may take the ”radius” to be r2 = 2x2 + y 2 , so
we can still plot on the r z plane and do an ellipse rotation. Taking
the projection of the volume onto the xy-plane gives an ellipse. Instead of
integrating the 2D projection integral directly, we first perform the inner z
integral, and use ellipse transformation onto the 2D integral.
5. Parallelogram Transformation
Given a parallelogram in R2 with one vertex being origin.
It is generated by 2 points/vectors, ~a and ~b.
We can turn the unit square into parallelogram by requiring that
1 0
g = ~a g = ~b
0 1
Since the parallelogram is linear, this is a linear transformation.
It is characterized by a matrix.
u u x
g =A· =
v v y
Due to the contraint on the unit vectors above, A must be
2 3
| |
4
A = ~a ~b5
| |
If the paralellogram does not have one vertex at origin, we can perform a
shift of the parallelogram, by subtracting the coordinates of one point from
all points of the parallelogram. We take note of ~a and ~b that generate the
shifted parallelogram. The transformation g would take 2 steps. First the
transformation of the square to the shifted parallelogram, then from the
shifted parallelogram to the original one.
Example
Given the parallelogram (1, 1), (2, 1), (2, 2), (3, 2) which is a
standard 45 degrees parallelogram that is shifted.
1 1
The standard 45 degrees parallelogram is defined by the vectors and .
0 1
We can use the above transformation, to turn the unit square into the
standard parallelogram:
u 1 1 u
h = ·
v 0 1 v
Then we need to shift the parallelogram upward and right by 1 unit. Thus
u 1 1 u 1
g = · +
v 0 1 v 1
In both the non-shifted and the shifted case, Dg = A.
6. Tetrahedron Transformation
Generalizing the idea of parallelogram, the tetrahedron transformation is
much more useful in practice.
Question 41
Find the volume bounded by x + 2y + z = 2, x = 2y, x = 0, z = 0.
Strategy:
(Take any 3 planes, they intersect at 1 point. 4 points form a tetrahedron.)
Question 42 R
Compute the integral D z x y where D is the tetrahedron given by
(0, 0, 0), (1, 2, 3), (0, 2, 2), ( 1, 1, 1).
If the curves only intersect at 4 points, we can transform the square onto
the domain by using
x f1 (x, y) u
h = =
y f2 (x, y) v
u
and since u = f1 (x, y) and v = f2 (x, y), the bounds of is exactly the
v
square A = {u 2 (a, b), v 2 (c, d)}.
20 Chain Rule in 1D
We typically think of chain rule as a rule for computation:
0
f g(x) = f 0 g(x) · g 0 (x)
2nd Derivative
We may use the above form of the chain rule to calculate the 2nd derivative.
d dy
We apply another di↵erential operator on top of :
dx dx
d2 y d ⇣ dy ⌘
=
dx2 dx dx
Plug in the above form of the chain rule,
d ⇣ dy dt ⌘
=
dx dt dx
We want to take the derivative of this product, so we need product rule,
d ⇣ dy ⌘ dt dy d ⇣ dt ⌘
= · + ·
dx dt dx dt dx dx
Notice that there are 2 types of derivatives here.
d ⇣ dt ⌘
The 2nd term involves the expression .
dx dx x
Recall that we assumed t = t(x). (such as t = e )
dt
So is also a function of x.
dx
We want to take the derivative of such function against x.
This results in the 2nd derivative of t = t(x) against x:
d ⇣ dt ⌘ d2 t
= 2
dx dx dx
d dy ⌘
⇣
The 1st term involves the expression .
dx dt
This term is more difficult. (and requires an additional expansion)
Recall that we assumed y = y(t). (such as y = sin t)
dy dy
So is also a function of t. (such as = cos t)
dt dt
We want to take the derivative of such function against x, on an expression
involving t.
dy
Notice that is an expression involving t, similar to y = y(t).
dt
So to take the derivative against x, on an expression involving t, we know
that for y = y(t):
d⇣ ⌘ dy dy dt d⇣ ⌘ dt
y(t) = = = y(t)
dx dx dt dx dt dx
dy
Since is also an expression involving t, it would behave in the same
dt
way as y(t) when taking derivative against x.
dy
We can substitue y(t) with in the above expression:
dt
d ⇣ dy ⌘ d ⇣ dy ⌘ dt
=
dx dt dt dt dx
dy
Since y = y(t) is a function of t, on the right is also a function of t.
dt
We want to take the derivative of such function against t.
This results in the 2nd derivative of y = y(t) against t:
d ⇣ dy ⌘ d2 y
= 2
dt dt dt
d ⇣ dy ⌘ dt dt dy d2 t
= · + ·
dt dt dx dx dt dx2
d2 y dt dt dy d2 t
= 2 · + ·
dt dx dx dt dx2
dt
Notice that we get a square of in the first term.
dx
Thus the chain rule formula for 2nd derivative:
d2 y d2 y ⇣ dt ⌘2 dy d2 t
= 2 + ·
dx2 dt dx dt dx2
⇣ dt ⌘2 d2 t
Note: 6= 2 .
dx dx
Of course, given a function y = y(x), one would not go through this long
and complicated process just to take 2nd derivative. It is much easier to just
take the derivative (twice) using the computation rules.
Example
x2 y 00 xy 0 3y = 0
Take y = xn , then y 0 = nxn 1
and y 00 = n(n 1)xn 2 .
Plugging into the ODE,
x2 n(n 1)xn 2
xnxn 1
3xn = 0
n(n 1) n 3=0
n2 2n 3=0
We will always get a quadratic of this form. In this case, we get
(n 3)(n + 1) = 0
y(x) = c1 x3 + c2 x 1
However, notice that given an equation with di↵erent numbers, the quadratic
we get may have only one (repeated) solution. In this case, we would be
”missing” the second solution. We can instead find the solution by using the
chain rule formula for 2nd derivative.
Example
x2 y 00 3xy 0 + 4y = 0
If we proceed using the previous approach, we would get (n 2)2 = 0, giving
one (repeated) solution.
x2 y 003xy 0 + 4y = 0
⇣ d2 y ⇣ 1 ⌘2 dy 1⌘ ⇣ dy 1 ⌘
x2 + · 3x + 4y = 0
dt2 x dt x2 dt x
Notice that all the x cancels out.
d2 y dy dy
3 + 4y = 0
dt2 dt dt
d2 y dy
4 + 4y = 0
dt2 dt
This is a 2nd order linear equation with constant coefficients.
The solution is given by y(t) = ert .
Plugging into the equation,
r2 4r + 4 = 0
(r 2)2 = 0
This is a repeated root solution.
Thus the general solution for y(t) is given by,
Question 44
Find the general solution to the ODE, where y = y(x).
1. x2 y 00 3xy 0 + 4y = 0
2. 2x2 y 00 5xy 0 + 5y = 0
3. x(1 x2 )2 y 00 (1 x2 )(1 + 4x2 )y 0 + 2x3 y = 0
1
with the change of variable t = ln(1 x2 ).
2
We start with the variable z on the top, and for each variable that z depends
on, we get an extra branch below. In this case, z = z(x, y) and we get 2
branches for x and y. The 2 branches correspond to the partial derivatives
@z @z
and as we will see.
@x @y
Similarly, we create branches for x and y, and get 4 branches for s and t. The
@x @x @y @y
branches correspond to the partial derivatives , , , .
@s @t @s @t
@z
To compute :
@s
Using the diagram, we start at z, and consider all possible ways to reach s.
The first way is, start from z, go to x, then from x to s.
This gives (using multiply)
@z @x
·
@x @s
The second way is, start from z, go to y, then from y to s.
This gives (using multiply)
@z @y
·
@y @s
The answer is the 2 ways added together
@z @z @x @z @y
= · + ·
@s @x @s @y @s
Similarly,
@z @z @x @z @y
= · + ·
@t @x @t @y @t
@z
Intuitively, asks how much would z change, if there is a small change in s.
@s
Given the variable dependence above, a small change in s would cause both
a small change in x and a small change in y. The small change in x would
in turn cause a small change in z, and the the small change in y would also
cause a small change in z. Thus the ”total” small change in z would be the
sum of the 2 changes caused by x and y.
Hence, we get the sum of 2 pairs of ”fractions” multiplied on the right.
Of course, given the functions z = z(x, y) and x = x(s, t), y = y(s, t), one
does not need go through this long and complicated process just to take the
derivative. It is much easier to just plug in the expression of x and y into z,
and take the derivative using the computation rules.
Question 45
@z
1. z = x y, x = sin(t), y = 3t. Find .
@t
@z @z
2. z = xy 2 , x = s cos(t), y = s sin(t). Find , .
@s @t
@u @u
3. u = xy + yz, x = s + t, y = s, z = 2t. Find , .
@s @t
Similar to the Chain Rule in 1D, the chain rule formula shines when at least
one of the function is unknown.
Question 46
Suppose that z = f (x, y), x = 2s + t and y = s 3t. Assume:
f (1, 1) = 2, f (3, 2) = 1, zx (1, 1) = 2, zx (3, 2) = 4, zy (1, 1) = 6, zy (3, 2) = 1.
Find zs and zt at (s, t) = (1, 1).
Similar to ODE, the function u(x, y) defined by an PDE often can not be
solved explicitly. Di↵erent from an ODE, the general solution of a PDE
would involves some unknown function, instead of unknown constants.
2ux + 3uy = 0
2ux + 3uy = 0
⇣ @u @u ⌘ ⇣ @u @u ⌘
2 2+ 3 +3 3+ ( 2) = 0
@s @t @s @t
@u
Notice that the terms involving cancels.
@t
@u
(22 + 32 ) =0
@s
Thus the partial derivative of u(s, t) against s is 0.
However, since we are in 2D, this does not mean u is constant.
@u
For example, u(s, t) = t2 , would have = 0.
@s
@u
Thus, = 0 implies that u must not depend on s, but can still depend on t.
@s
To signal this dependence, we get
u(s, t) = f (t)
Initial Condition
Indeed, one may check that u(x, y) = f (3x 2y) satisfy the original PDE,
without needing to know what the unknown function f is.
Question 47
Consider u = u(x, y). Find the solution to the PDE (general or particular).
1. ux + uy = 0 with u(x, 0) = x.
2. aux + buy = 0
3. ux + uy = 1
4. ux uy + u = 0.
5. ux + uy + u = ex+2y with u(x, 0) = 0
6. ux + 2uy + (2x y)u = 2x2 + 3xy 2y 2
Question 48
Consider 2ux + yuy = 0.
(First order linear equation with non-constant coefficients: a = 2, b = y)
Find the solution with the change of variables: s = x, t = e x/2 y.
dy y b
(C = e x/2 y is the solution to the ODE: = = )
dx 2 a