Module 1 was about functions of one variable. But area, volume, temperature on a metal plate and the height of a hill depend on two or more inputs. Module 2 takes the same story to more variables, in the same order: limits → derivatives → using derivatives.
The only new difficulty is that with two inputs you can move in many directions. So every idea has one extra question: in which direction?
Functions of two variablesz=f(x,y): what they are and where they are defined.
Limits and continuity: now we can reach a point along infinitely many paths, not just from the left and the right.
Partial derivatives: change one input and keep the others fixed.
Chain rule and implicit differentiation: how a change passes through a chain of dependent variables.
Applications: slopes of surfaces, related rates, and level curves.
What you will be able to do
State the domain and range of a function of two variables.
Find a two-variable limit, and prove that a limit does not exist by comparing two paths.
Check whether a function is continuous at a point.
Find first, second and mixed partial derivatives, and check that fxy=fyx.
Use the chain rule with one or two parameters, and draw the tree diagram that helps you organise it.
Find dxdy for an implicit curve using partial derivatives.
Solve related-rates problems with many changing quantities.
Sketch the level curves of a function.
How to use these notes
Every topic has the same shape: idea → rule → worked example → common mistakes.
Try each worked example yourself first. Cover the answer, solve it, and then compare.
Green boxes hold key ideas. Amber boxes marked Watch out show the mistakes that make you lose marks.
The last page has practice questions with answers, and then a one-page formula sheet for revision.
Where each topic sits
Part
Topics
Functions
Domain, range
Limits and continuity
Limits along paths, the two-path test, continuity
Partial derivatives
First order, slope of a surface, second order, mixed partials
Chain rule
One parameter, two parameters, related rates
Implicit functions
dy/dx=−fx/fy
Pictures
Level curves
Before you start. You should know the differentiation from Module 1: the power, product, quotient and chain rules, and the derivatives of ex, lnx, sinx, cosx, tanx and tan−1x. Partial derivatives are just ordinary derivatives with a little extra care, so these rules do all the work.
Page 2 of 13
Functions of two variables
The idea
A function of two variables gives exactly one number for each pair (x,y) in its domain:
z=f(x,y)
Examples you already know: the area of a rectangle A=xy, the volume of a cone V=31πr2h, the distance from the origin x2+y2.
The graph of z=f(x,y) is a surface in space: above each point (x,y) of the plane, there is a point at height z.
Domain and range
The domain is the set of all (x,y) for which f(x,y) is defined. It is a region of the plane, not an interval.
The range is the set of all values f(x,y) can take.
The conditions are the same as in one variable:
Trouble
Rule
Division
the denominator must not be 0
Even root
the expression under it must be ≥0
Logarithm
the expression inside must be >0
Example 1.f(x,y)=x2−y2.
There is no problem anywhere, so the domain is all of R2. Every real number is a value: to get k≥0 take (k,0), and to get k<0 take (0,−k). So the range is R.
Example 2.f(x,y)=x−yx+y.
The denominator becomes zero when x=y. The domain is the whole plane except the liney=x:
R2∖{(x,y):x=y}
Every real k is a value: for k=−1 take x=1,y=k+1k−1, and for k=−1 take (0,1). So the range is R.
Example 3.f(x,y)=9−x2−y2.
The root needs 9−x2−y2≥0, that is x2+y2≤9. The domain is the closed disc of radius 3 centred at the origin. The largest value is f(0,0)=3 and the smallest is 0 (on the edge of the disc), so the range is [0,3]. This is the upper half of a sphere. You will see it again in level curves.
Watch out. Write the domain as an equation or inequality in x and y (like "x=y" or "x2+y2≤9"). Writing only a one-variable condition like "x=0" is not enough, because the condition usually involves both variables together.
Page 3 of 13
Limits of functions of two variables
The idea
(x,y)→(a,b)limf(x,y)=L
means: f(x,y) comes as close to L as we like when the point (x,y) is close enough to (a,b), but not equal to it.
On a number line you can reach a point from only two sides, left and right. In the plane you can reach (a,b) along infinitely many paths: straight lines, parabolas, spirals.
Key idea. The limit exists only if f goes to the same number along every path to (a,b). If even one path gives a different answer, the limit does not exist.
Easy case: just substitute
The limit laws from Module 1 work in the same way for (x,y)→(a,b): you can take limits through sums, differences, constant multiples, products, quotients (when the limit of the denominator is =0), powers and roots.
So for a polynomial, or a rational function whose denominator is not 0 at the point, substitute.
Example 1.(x,y)→(0,1)limx2y+5xy−y3x−xy+3
02⋅1+5⋅0⋅1−130−0⋅1+3=−13=−3
Example 2.(x,y)→(3,−4)limx2+y2
32+(−4)2=9+16=25=5
This is the distance from (3,−4) to the origin.
Example 3.(x,y)→(π/2,0)lim(sinxx−ysiny)
Take the two terms separately. The first is sin(π/2)π/2=2π. The second gives 0/0 on substitution, but it is the standard limit ysiny→1 from Module 1. So the answer is
2π−1
When substitution gives 0/0
Do the same as in Module 1: factorise and cancel, or use the difference of squares.
Example 4.(x,y)→(0,0)limx−yx2−xy
Substituting gives 0/0. Factorise the top as x(x−y) and write x−y=(x−y)(x+y):
x−yx(x−y)=x−yx(x−y)(x+y)=x(x+y)
Now substitute: 0⋅(0+0)=0. (The square roots need x,y≥0, and x=y keeps the original fraction defined.)
Showing a limit does not exist: the two-path test
Two-path test. If f goes to different values along two different paths to (a,b), then (x,y)→(a,b)limf(x,y) does not exist.
For the origin, the usual choice is the family of lines through it, y=mx. Put y=mx, let x→0, and see whether the answer depends on m. If it does, the limit does not exist.
Example 5. Show that (x,y)→(0,0)limx2+y2x2−y2 does not exist.
Substitution gives 0/0, so the limit laws do not help. Put y=mx:
The answer depends on m. Along the x-axis (m=0) it is 1, and along y=x (m=1) it is 0. Different paths give different values, so the limit does not exist.
Example 6. Show that (x,y)→(0,0)limx2+y2xy does not exist.
Put y=mx:
x→0limx2+m2x2x⋅mx=1+m2m
This is 0 for m=0 and 21 for m=1. The limit does not exist.
Watch out. The two-path test can only prove that a limit does not exist. If every straight line gives the same value, that does not prove that the limit exists, because some curve may give a different value. For example x2+y4xy2 gives 0 along every line y=mx, but along the parabola x=y2 it equals 2y4y4=21. So its limit at the origin does not exist.
Page 4 of 13
Continuity
The idea
A function is continuous at a point when its graph has no break there: the value we expect from the nearby points is the value the function actually has.
Definition.f(x,y) is continuous at (x0,y0) when all three hold:
f(x0,y0) is defined.
(x,y)→(x0,y0)limf(x,y) exists.
(x,y)→(x0,y0)limf(x,y)=f(x0,y0).
f is continuous if it is continuous at every point of its domain.
What you can take for granted
Polynomials are continuous everywhere.
A rational function is continuous everywhere its denominator is not 0.
Sums, products, quotients (denominator =0) and compositions of continuous functions are continuous.
So a problem can come only where the formula changes (a piecewise function), or where a denominator becomes zero. These are the points to check.
Method
Away from the doubtful point, the function is made of continuous parts, so it is continuous there.
At the doubtful point, check the three conditions. Most of the time, condition 2 fails. Use the two-path test.
Examples
Example 1. Show that
f(x,y)=⎩⎨⎧x2+y22xy,0,(x,y)=(0,0)(x,y)=(0,0)
is continuous everywhere except the origin.
Away from the origin it is a rational function with a non-zero denominator, so it is continuous.
At the originf(0,0)=0 is defined. Along y=mx:
x→0limx2+m2x22x⋅mx=1+m22m
This depends on m, so the limit does not exist and f is not continuous at the origin. Changing the value of f(0,0) cannot fix this, because there is no single limit to match.
Example 2. Show that
f(x,y)=⎩⎨⎧x2+y2y,0,(x,y)=(0,0)(x,y)=(0,0)
is discontinuous at (0,0).
Along y=mx with x>0 we have x2+m2x2=x1+m2, so
x→0+limx1+m2mx=1+m2m
This depends on m (it is 0 for m=0 and 21 for m=1), so the limit does not exist and f is discontinuous at (0,0).
Example 3. Let f(x,y)=x2+y2 for (x,y)=(0,0), and f(0,0)=1. Is f continuous at the origin?
Conditions 1 and 2 hold: f(0,0)=1 is defined, and the limit is 02+02=0. But condition 3 fails because 0=1. So f is not continuous at the origin. This is a removable break: if we redefine f(0,0)=0, it is fixed.
Watch out. "The limit exists" and "the function is continuous" are different things. Example 3 has a limit but is still discontinuous. All three conditions must be true.
Page 5 of 13
Partial derivatives
The idea
For z=f(x,y) there are two natural questions: how fast does z change if we move in the x direction (keeping y fixed), and how fast does it change if we move in the y direction (keeping x fixed)? The answers are the partial derivatives.
Each one is just the Module 1 definition of a derivative, applied to one variable while the other is kept fixed.
Name
Common symbols
partial derivative with respect to x
∂x∂z,∂x∂f,fx
partial derivative with respect to y
∂y∂z,∂y∂f,fy
The curly ∂ means "there are other variables also". The straight d is only for functions of one variable.
Method
Steps.
For fx: treat y as a constant and differentiate with respect to x using the usual rules.
For fy: treat x as a constant and differentiate with respect to y.
A constant multiplier stays as it is. A term with only the other variable is a constant, so it becomes zero. For example, for x2y: differentiating in x gives 2xy (the y just stays as a multiplier), and differentiating in y gives x2.
Examples
Example 1.f(x,y)=x2y+3xy2
fx=2xy+3y2fy=x2+6xy
Example 2.f(x,y)=2x2−3y−4
fx=4xfy=−3
The −3y is constant with respect to x, so it disappears from fx. The 2x2 and −4 disappear from fy.
Example 3.f(x,y)=(x+1)(y−2). Treat the other bracket as a constant factor.
fx=y−2fy=x+1
Example 4.f(x,y)=x2+y2. Use the chain rule on the root.
Nothing changes. For u=f(x,y,z), to find ux treat bothy and z as constants, and similarly for the others.
Watch out. Students often forget the chain-rule factors. In Example 5 the 3 and the 4 come from differentiating the inside part 3x+4y. In Example 8 the −1 comes from differentiating −y. Also, never write d where you should write ∂.
Page 6 of 13
Slope and rate of change
The idea
Take the surface z=f(x,y) and a point (a,b) in the plane.
Cut the surface with the vertical plane y=b. You get an ordinary curve z=f(x,b). Its slope at x=a is fx(a,b).
Cut with the plane x=a. The slope of that curve at y=b is fy(a,b).
Meaning.∂x∂z is the slope of the surface in the x-direction, and also the rate of change of z with respect to x while y is held fixed. Likewise ∂y∂z for the y-direction.
To find the value at a point, differentiate first and then substitute. The notation for "value at (a,b)" is
∂x∂z(a,b)
The sign tells the story. A positive value means z is increasing as you move in the positive direction. A negative value means it is decreasing. Zero means the surface is flat in that direction.
Examples
Example 1. Find the slope of the surface z=10−4x2−2y2 at (1,2) in the x-direction and the y-direction.
Cosine is an even function, so cos(−11)=cos11. In radians this is about 0.009, so at that point z is almost flat in the y-direction.
Watch out. Put the point after differentiating. If you put y=1 in z first, then y becomes a constant and differentiating with respect to y just gives 0.
Page 7 of 13
Second-order partial derivatives
The idea
A partial derivative is also a function of x and y, so we can differentiate it again. A function of two variables has four second-order partial derivatives.
Symbol
Means
In words
fxx=∂x2∂2f
∂x∂(∂x∂f)
differentiate with respect to x twice
fyy=∂y2∂2f
∂y∂(∂y∂f)
differentiate with respect to y twice
fxy=∂y∂x∂2f
∂y∂(∂x∂f)
x first, then y
fyx=∂x∂y∂2f
∂x∂(∂y∂f)
y first, then x
The last two are the mixed derivatives. The subscripts in fxy are read left to right, but the ∂ notation is read right to left. Some books swap the names. This is not a problem here because of the next fact.
Mixed partials are equal. If fxy and fyx are continuous, then fxy=fyx. Every function in this module satisfies this, so the order of differentiation does not matter. Use it to check your answer: find both mixed derivatives and see that they are equal.
Examples
Example 1. Find all second-order partial derivatives of f(x,y)=x3y+2xy2.
Study tip. Simplify after the first derivative, before differentiating again. In Example 6 the whole expression becomes x−2ytan−1(x/y), which makes the second step easy.
Watch out. For fxx you differentiate with respect to xagain and still treat y as a constant. Also, do not confuse fxx with (fx)2. They are different things.
Page 8 of 13
Chain rule, part 1: one parameter
The idea
If z=f(x,y) and both x and y depend on one variable t, then z becomes a function of t alone. The chain rule gives dtdz without substituting first.
Chain rule (one parameter). If z=f(x,y), x=x(t), y=y(t), then
dtdz=∂x∂z⋅dtdx+∂y∂z⋅dtdy
The tree diagram
Draw the dependencies as a tree: z at the top, the variables it depends on below it, and the parameter at the bottom.
graph TD
z -->|∂z/∂x| x
z -->|∂z/∂y| y
x -->|dx/dt| t
y -->|dy/dt| t
How to read the tree. For each path from z down to t, take the product of the derivatives along its branches. Then add all the paths. Here there are two paths (z→x→t and z→y→t), so there are two terms.
With three variables w=f(x,y,z) there are three paths:
dtdw=∂x∂wdtdx+∂y∂wdtdy+∂z∂wdtdz
Method
Draw the tree.
Find the partial derivatives of the outer function with respect to each middle variable.
Find the derivative of each middle variable with respect to t.
Multiply along each path, and then add.
Put x(t), y(t), … so that the answer is in terms of t (or put the given value of t).
Examples
Example 1.z=5x3y2, x=t3, y=t5. Find dtdz, and check by substituting first.
Watch out. Use ∂ for the outer function (it has many variables) and d for the inner ones (each has only t). Do not forget the second path. Stopping after the x term is the most common mistake.
Page 9 of 13
Chain rule, part 2: two parameters
The idea
Now let the middle variables depend on two parameters. If z=f(x,y) with x=x(u,v) and y=y(u,v), then z is a function of u and v, and we need partial derivatives with respect to each.
Chain rule (two parameters).
∂u∂z=∂x∂z⋅∂u∂x+∂y∂z⋅∂u∂y
∂v∂z=∂x∂z⋅∂v∂x+∂y∂z⋅∂v∂y
flowchart TD
Z[z] --- X[x]
Z --- Y[y]
X --- U1[u]
X --- V1[v]
Y --- U2[u]
Y --- V2[v]
The tree rule is the same. For ∂u∂z: take every path from z down to u, multiply along each path, and add. For ∂v∂z: take every path down to v.
Examples
Example 1.z=x2−ytanx, x=vu, y=uv. Find ∂u∂z and ∂v∂z.
Sometimes the last variable also appears directly in the function. Then it gives both a direct path and the paths through the other variables.
Example 5. Find dxdw at x=0 for w=xy+yz, with y=sinx and z=ex.
flowchart TD
W[w] --- X1[x]
W --- Y[y]
W --- Z[z]
Y --- X2[x]
Z --- X3[x]
There are three paths from w to x: directly, through y, and through z.
dxdw=∂x∂w+∂y∂w⋅dxdy+∂z∂w⋅dxdz
With ∂x∂w=y, ∂y∂w=x+z, ∂z∂w=y, dxdy=cosx, dxdz=ex:
dxdw=y+(x+z)cosx+yex
At x=0 we have y=sin0=0 and z=e0=1, so
dxdwx=0=0+(0+1)(1)+0=1
Check. If we substitute first, w=xsinx+exsinx. Its derivative at 0 is 0+0+1+0=1. ✓
Watch out. In Example 5, ∂x∂w (treat y and z as constants) and dxdw (let them change with x) are different quantities. Also, the point (0,1,2) in the original question does not lie on this curve. The curve passes through (0,0,1) at x=0.
Page 10 of 13
Related rates
The idea
If a quantity z depends on x and y, and x and y are changing with time, the chain rule gives the rate of change of z:
dtdz=∂x∂z⋅dtdx+∂y∂z⋅dtdy
Method
Name the variables and write the formula z=f(x,y) that connects them.
Write the given ratesdtdx, dtdy. A quantity that is decreasing has a negative rate. A quantity that is constant has rate 0.
Find ∂x∂z and ∂y∂z.
Use the chain rule, and then put the values at that moment.
Write the answer with units, and say whether the quantity is increasing or decreasing.
Examples
Example 1. Area of a rectangle. The length and width of a rectangle are increasing at 1.5cm/s and 0.5cm/s. How fast is the area increasing when the length is 40cm and the width is 30cm?
Let x = length, y = width, A=xy. Then dtdx=1.5 and dtdy=0.5, with ∂x∂A=y and ∂y∂A=x.
dtdA=y⋅1.5+x⋅0.5=30(1.5)+40(0.5)=45+20=65cm2/s
The unit is square centimetre per second, because A is an area.
Example 2. Volume of a cone. The height of a right circular cone is increasing at 0.2cm/s and the radius of its base is decreasing at 0.3cm/s. How fast is the volume changing when the height is 15cm and the radius is 10cm?
Let x = radius, y = height, V=31πx2y. The radius is decreasing, so dtdx=−0.3, and dtdy=0.2.
The volume is decreasing: the decreasing radius (which is squared in the formula) has more effect than the increasing height.
Example 3. A quantity kept constant. Given z=2xy2−3x2y and that x is increasing at 2cm/s, find the rate at which y changes when x=3 and y=1, if z stays constant.
Constant z means dtdz=0. With ∂x∂z=2y2−6xy and ∂y∂z=4xy−3x2:
0=(2y2−6xy)⋅2+(4xy−3x2)dtdy
At (3,1): ∂x∂z=2−18=−16 and ∂y∂z=12−27=−15. So
0=(−16)(2)+(−15)dtdy⇒dtdy=−1532cm/s
So y is decreasing at about 2.13cm/s.
Note on the source. The handwritten page moved a bracket to the other side of the equals sign without changing its sign, and ended with +1532. When we put the numbers first (as above), we get −1532. The page also gave the rate of the cone's height as 0.2m/s, but it must be 0.2cm/s to match the other units. One middle line in the cone problem had 3140π before reaching the correct 370π.
Watch out. Check signs and units at the end. A decreasing quantity needs a negative rate in the beginning. Also, all rates must be in the same units (here all in cm and seconds).
Page 11 of 13
Implicit differentiation
The idea
Sometimes y is given implicitly by an equation such as x3+y3=3axy, which cannot be solved easily for y. Partial derivatives give a one-step formula for dxdy.
Implicit differentiation formula. If f(x,y)=c defines y as a function of x, then
dxdy=−∂f/∂y∂f/∂x=−fyfx(fy=0)
Why it works
Along the curve f(x,y)=c the value of f does not change, so dxdf(x,y)=0. The chain rule (with x having both roles, as on the previous page) gives
fx⋅1+fy⋅dxdy=0
and solving for dxdy gives the formula.
Method
Take everything to one side so that the equation becomes f(x,y)=0 (or =c).
Find fx and fy as normal partial derivatives.
Write dxdy=−fyfx. Keep the minus sign in front of the whole fraction.
Examples
Example 1. Using partial derivatives, find dxdy if x3+y3=3axy. Then verify using ordinary implicit differentiation.
Note on the source. The handwritten page wrote the first answer as 3y2−3ax−3x2−3ay, where the minus sign was applied wrongly. It should be −(3x2−3ay)=−3x2+3ay. The second method on the page gave the correct result.
Example 2. Find dxdy for the circle x2+y2=a2.
Let f(x,y)=x2+y2−a2, so fx=2x and fy=2y:
dxdy=−2y2x=−yx
This is the slope of the circle at (x,y). It agrees with geometry: the tangent to a circle is perpendicular to the radius, which has slope y/x.
Watch out. Students make three mistakes here. (1) Missing the minus sign. (2) Writing fy on top and fx at the bottom. It is fx over fy. (3) Forgetting that the formula needs the equation in the form f(x,y)=c, with all terms taken to one side first.
Page 12 of 13
Level curves
The idea
A level curve is the set of points where a function has one fixed value. Think of the contour lines on a map: each line joins the places that have the same height.
Definition. A level curve of f(x,y) is the curve
f(x,y)=k
for a constant k.
Level curves never cross (a point cannot have two different values of f). Where the curves are close together, the surface is steep. Where they are far apart, the surface is gentle.
Method
Set f(x,y)=k for each requested value of k.
Simplify each equation to a known curve: a line, circle, parabola, ellipse, and so on.
Draw all the curves together, and write the k value on each.
To find the level curve through a given point, put the point in f. That value is k.
Examples
Example 1. Find the level curves of f(x,y)=9−x2−y2 for c=0,1,2,3.
Set 9−x2−y2=c and square both sides:
9−x2−y2=c2⇒x2+y2=9−c2
c
Equation
Curve
0
x2+y2=9
circle of radius 3
1
x2+y2=8
circle of radius 22≈2.83
2
x2+y2=5
circle of radius 5≈2.24
3
x2+y2=0
the single point (0,0)
{
"boundingBox": [-3.5, 3.5, 3.5, -3.5],
"axis": true,
"points": [
{ "id": "O", "x": 0, "y": 0, "label": "c = 3" }
],
"segments": [],
"circles": [
{ "center": "O", "radius": 3 },
{ "center": "O", "radius": 2.8284 },
{ "center": "O", "radius": 2.2361 }
],
"functions": [],
"title": "Level curves of f(x, y) = √(9 − x² − y²): from the outside in, c = 0, 1, 2; the point at the centre is c = 3"
}
The graph of f is the upper half of a sphere of radius 3, and its level curves are the circles at each height. Notice that they come close together near the edge, where the surface is steepest.
Watch out. For c>3 there is no level curve, because x2+y2=9−c2 would be negative. This agrees with the range [0,3] found on the domain page. Also, c must be ≥0, because a square root cannot be negative.
Example 2. Find the level curves of f(x,y)=x2+2y for k=−2,0,2.
k=4+4=8. The level curve is x2+4y2=8, that is 8x2+2y2=1: an ellipse with semi-axes 22 (along x) and 2 (along y).
Simplify first: y=9+x15+x26+x310. Then y′=−x215−x312−x430 and y′′=x330+x436+x5120=x530x2+36x+120.
Study tip. In 15, if you expand and divide before differentiating, you can use the simple power rule instead of a long quotient rule. Use this shortcut whenever the denominator has only one term.
Formula sheet
Functions, limits and continuity
Domain
no zero denominators, no even roots of negative numbers, no logs of zero or negative numbers
Limit
lim(x,y)→(a,b)f=L along every path
Substitution
works for polynomials, and for rational functions with non-zero denominator