Multivariable Function Derivatives Guide
Multivariable Function Derivatives Guide
In first year we started to extend the basic concepts, such as convergence, limits, continuity and deriva-
tives in calculus for single variable functions to calculus of several variables. For example, we can use
Newton’s law of cooling to model the temperature T = T (t) of a cup of coffee over time t. However,
we could model the temperature over time throughout the volume of the cup of coffee, thus requiring
four independent variables; x, y, z, t. Therefore, we would have T = T (x, y, z, t). In this section we
will continue that journey into multivariable calculus.
Recall that occasionally this derivative may be denoted as f ′ (x), which makes it explicit that the
derivative is a function of x itself.
For a function of several variables, say f = f (x, y, z, t), consider the first order partial derivatives of f
with respect to any one of the independent variables:
Example 1.2.1
Consider the four-variable function
f (x, y, z, t) = x2 + yz t
Recall that in single-variable calculus, if z = f (y) and y = g(x) are two functions of a single variable,
then the derivative of the composite function f ◦ g(x) = f (g(x)) is
dz df dy
=
dx dy dx
It is important to remember; we are not cancelling out the “dy” differentials, since derivatives are not
fractions. This is more obvious when written in Newton’s notation
We can extend the chain rule to a function of n-variables, where each variable depends upon m-variables.
Let f (x1 , x2 , . . . , xn ) be a differentiable function dependent upon n variables, where each vari-
able xk (u1 , u2 , . . . , um ) is a differentiable function dependent upon m variables. The first order
derivative of f with respect to uk is given by the chain rule
n
∂f X ∂f ∂xi
=
∂uk i=1
∂xi ∂uk
that is,
∂f ∂f ∂x1 ∂f ∂x2 ∂f ∂xn
= + + ··· +
∂uk ∂x1 ∂uk ∂x2 ∂uk ∂xn ∂uk
▶ again; we are not cancelling out the “∂xi ” symbol, since derivatives are not fractions.
▶ if a specific function depends upon only one variable then the partial derivative is just an ordinary
∂
derivative, for example x3 (u1 ) only depends upon one variable u1 , thus we write x3 (u1 ) =
∂u1
dx3
.
du1
12
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.2.2
2
Let z = f (y) = y 2 and y = g(x) = sin(x), then the composite function f ◦g(x) is z = f (g(x)) = (sin(x)) .
By chain rule the derivative of z with respect to x is
dz df dy
=
dx dy dx
d 2 d
= y sin(x)
dy dx
= (2y) (cos(x))
= 2 sin(x) cos(x) .
Now, consider a function of three independent variables w = f (x, y, z) and let x = x(t), y = y(t),
z = z(t) be functions of a single variable t. The composite function w = f (x(t) , y(t) , z(t)) = F (t) is
a function of the (single) independent variable t. Using the chain rule, the derivative of the function
w = F (t) with respect to t is
dF ∂f dx ∂f dy ∂f dz
= + + .
dt ∂x dt ∂y dt ∂z dt
Example 1.2.3
1
Let w = f (x, y, z) = xy 2 + x2 z, and let x(t) = t2 , y(t) = t, z(t) = then applying the chain rule, the
t
derivative of w with respect to t is
dw ∂f dx ∂f dy ∂f dz
= + +
dt ∂x dt ∂y dt ∂z dt
∂ 2 d ∂ 2 d ∂ 2 d 1
2 2 2 2
= xy + x z t + xy + x z t + xy + x z
∂x dt ∂y dt ∂z dt t
1
= y 2 + 2xz (2t) + (2xy) (1) + x2 − 2
t
2 1
2 2 1
(2t) + 2 t (t) (1) + t2
2
= (t) + 2 t − 2
t t
= 4t3 + 3t2 .
The chain rule for functions of several variables can get more complicated. Consider, for example, w =
f (x, y, z), which is a function of three independent variables, and assume that x = x(u, v), y = y(u, v)
and z = z(u, v), are functions of two independent variables u and v. Hence the composite function
13
ENG2005 Advanced Engineering Mathematics Monash University
w = f (x(u, v) , y(u, v) , z(u, v)) = F (u, v) is a function of the independent variables u and v. Using the
chain rule, the partial derivative of the function w = F (u, v) with respect to u is
∂F ∂f ∂x ∂f ∂y ∂f ∂z
= + +
∂u ∂x ∂u ∂y ∂u ∂z ∂u
and the partial derivative of the function w = F (u, v) with respect to v is
∂F ∂f ∂x ∂f ∂y ∂f ∂z
= + +
∂v ∂x ∂v ∂y ∂v ∂z ∂v
Example 1.2.4
Let w = f (x, y) = x2 − y 2 , and x(r, θ) = r cos(θ) and y(r, θ) = r sin(θ). Using the chain rule, the partial
derivative of the function w = F (r, θ) with respect to r is
∂F ∂f ∂x ∂f ∂y
= +
∂r ∂x ∂r ∂y ∂r
∂ 2 ∂ ∂ 2 ∂
= x − y2 r cos(θ) + x − y2 r sin(θ)
∂x ∂r ∂y ∂r
= (2x) (cos(θ)) + (−2y) (sin(θ))
= (2r cos(θ)) (cos(θ)) + (−2r sin(θ)) (sin(θ))
= 2r cos2 (θ) − sin2 (θ)
= 2r cos(2θ)
and the partial derivative of the function w = F (r, θ) with respect to θ is
∂F ∂f ∂x ∂f ∂y
= +
∂θ ∂x ∂θ ∂y ∂θ
∂ 2 ∂ ∂ 2 ∂
= x − y2 r cos(θ) + x − y2 r sin(θ)
∂x ∂θ ∂y ∂θ
= (2x) (−r sin(θ)) + (−2y) (r cos(θ))
= (2r cos(θ)) (−r sin(θ)) + (−2r sin(θ)) (r cos(θ))
= −4r2 cos(θ) sin(θ)
= −2r2 sin(2θ)
= r2 cos(2θ)
Therefore, the derivative of w = F (r, θ) with respect to r is
∂w ∂ 2
= r cos(2θ)
∂r ∂r
= 2r cos(2θ)
and the derivative of w = F (r, θ) with respect to θ is
∂w ∂ 2
= r cos(2θ)
∂θ ∂θ
= −2r2 sin(2θ)
The chain rule allows us to determine how a partial derivative in one coordinate system, such as
Cartesian coordinates, is described in another coordinate system, such as polar coordinates.
14
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.2.5
Find the first order partial derivatives of a function u(x, y) with respect to x and y in terms of the polar
coordinates r and θ.
The polar coordinates are defined by
x(r, θ) = r cos(θ) and y(r, θ) = r sin(θ)
where
y
r2 = x2 + y 2 and tan(θ) =
x
Using the chain rule, the first order partial derivative of u with respect to x is given by
∂u ∂u ∂r ∂u ∂θ
= +
∂x ∂r ∂x ∂θ ∂x
and the first order partial derivative of u with respect to y is given by
∂u ∂u ∂r ∂u ∂θ
= +
∂y ∂r ∂y ∂θ ∂y
Applying implicit differentiation we can find the first order partial derivative of r with respect to x and
the first order partial derivative of r with respect to y.
∂ 2 ∂ 2 ∂ 2 ∂ 2
r = x + y2 r = x + y2
∂x ∂x ∂y ∂y
∂r ∂r
2r = 2x 2r = 2y
∂x ∂y
∂r x ∂r y
= =
∂x r ∂y r
∂r ∂r
= cos(θ) = sin(θ)
∂x ∂y
Applying implicit differentiation we can find the first order partial derivative of θ with respect to x and
the first order partial derivative of θ with respect to y.
∂ ∂ y ∂ ∂ y
tan(θ) = tan(θ) =
∂x ∂x x ∂y ∂y x
∂θ y ∂θ 1
sec2 (θ) =− 2 sec2 (θ) =
∂x x ∂y x
∂θ y ∂θ 1
=− 2 2 =
∂x x sec (θ) ∂y x sec2 (θ)
∂θ y ∂θ 1
=− 2 =
x 1 + tan2 (θ)
2
∂x x 1 + tan (θ) ∂y
∂θ y ∂θ 1
=− 2 = 2
∂x x2 1 + y ∂y x 1+ y
x x
∂θ y ∂θ x
=− 2 = 2
∂x r ∂y r
∂θ sin(θ) ∂θ cos(θ)
=− =
∂x r ∂y r
Hence, by using the chain rule, the first order partial derivative of u with respect to x is given by
∂u ∂u sin(θ) ∂u
= cos(θ) −
∂x ∂r r ∂θ
and the first order partial derivative of u with respect to y is given by
∂u ∂u cos(θ) ∂u
= sin(θ) +
∂y ∂r r ∂θ
15
ENG2005 Advanced Engineering Mathematics Monash University
A scalar field (or scalar function) is a function f defined in a region of either two-dimensional
space (R2 ) or three-dimensional space (R3 ) which assigns a unique scalar value (that is, a real
number) to each point P in the domain of f
f = f (P ) = f (r)
where r denotes the position vector from the origin to the point P .
Any point P in R3 with Cartesian coordinates (x, y, z) has a corresponding position vector r = xi +
yj + zk, and then the scalar field can be written as
f = f (P ) = f (r) = f (x, y, z) .
Example 1.2.6
Atmospheric pressure at points on the surface of the Earth is a scalar field.
Example 1.2.7
The temperature at points throughout the volume of the Sun is a scalar field.
Example 1.2.8
The distance function p
d(x, y, z) = x2 + y 2 + z 2
describing the distance from the origin to any three-dimensional point P : (x, y, z) is a scalar field.
Example 1.2.9
The function
f (x, y) = x2 + y 2
is a (two-dimensional) scalar field.
Let f (x, y) be a two-dimensional scalar function. A level curve (or contour) of height c is the
set of all points (x, y) such that f (x, y) = c.
Geometrically, a level curve of height c is the intersection of the z = c plane with the surface z = f (x, y).
16
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.2.10
Consider the scalar field
f (x, y) = x2 + y 2 .
The surface represented by this function is
The surface f(x,y) = x2+y2
50
40
30
z
20
10
0
5
5
0
0
y −5 −5
x
3 9
16
25
2
9
25
4
1
16
1
4
0
y
9
25
1
9
−1
16
−2 4
25
16
−3 9
−4 25 16
−5 25
−6 −4 −2 0 2 4 6
x
17
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.2.11
Consider the scalar function
f (x, y) = x2 − y 2 .
The surface represented by this function is
The surface f(x,y) = x2−y2
30
20
10
0
z
−10
−20
−30
5
5
0
0
y −5 −5
x
−9
9
3
−4 −4 4
4
2 −1
−1
1
1
0
y
−1
4
−1
−2 1 −1 1
−4 −4
−3 −9
−1
9
−4 4 −9 4
−9 −1 1
1 −4 −4
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
x
Let f (x, y, z) be a three-dimensional scalar function. A level surface of value c is the set of all
points (x, y, z) such that f (x, y, z) = c.
18
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.2.12
Consider the scalar field
f (x, y, z) = x2 + y 2 − z.
The level surfaces of f (x, y, z) are nested paraboloids x2 + y 2 − z = c for any c ∈ R.
2
z
−1
−2
−2 −2
0 0
2 2
x
y
19
1.3 Double Integrals
For the moment, we will assume that the region of integration is in the xy-plane, that is, a region of
the two-dimensional plane. To define a region in the plane, we need to be able to define the “edges” of
the region.
Example 1.3.1
The rectangular region in the xy-plane
(x, y) ∈ R2 : −1 ≤ x ≤ 2, 0 ≤ y ≤ 1 .
R=
Example 1.3.2
The region bounded by the curves y = x2 and x = y 2 in the xy-plane
could be described as √
(x, y) ∈ R2 : 0 ≤ x ≤ 1, x2 ≤ y ≤
R= x
or equivalently as
√
(x, y) ∈ R2 : 0 ≤ y ≤ 1, y 2 ≤ x ≤
R= y
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.3.3
The region bounded by the lines x = 0, y = 4 and the curve y = x2 in the xy-plane
could be described as
(x, y) ∈ R2 : 0 ≤ x ≤ 2, x2 ≤ y ≤ 4
R=
or equivalently as
√
(x, y) ∈ R2 : 0 ≤ y ≤ 4, 0 ≤ x ≤
R= y
Example 1.3.4
The region bounded by the lines y = x, y = 2x and x = 2 in the xy-plane
could be described as
(x, y) ∈ R2 : 0 ≤ x ≤ 2, x ≤ y ≤ 2x
R=
or equivalently as R = R1 ∪ R2 where R is split into two regions
n y o n y o
R1 = (x, y) ∈ R2 : 0 ≤ y ≤ 2, ≤ x ≤ y and R2 = (x, y) ∈ R2 : 2 ≤ y ≤ 4, ≤x≤2
2 2
21
ENG2005 Advanced Engineering Mathematics Monash University
Let R be a bounded region in the xy-plane, which is completely contained within a rectangular
region D. We divide D into M × N uniform small rectangles each with area ∆A = ∆x∆y and
centre points (xi , yj ). Then define the function
(
f (xi , yj ), if (xi , yj ) is in R,
F (xi , yj ) = .
0 otherwise.
Theoretically, if the integrand and the region of integration are “suitably behaved”, then the order of
integration does not matter. However, in practice the order of integration often matters in deriving an
analytic solution.
In Cartesian coordinates, a double integral may be expressed as either the iterated integrals
ZZ Z x=b Z y=g2(x) !
f (x, y) dA = f (x, y) dy dx
R x=a y=g1(x)
Example 1.3.5
Consider the double integral ZZ
x + 2y dA
R
over the region bounded by the curves y = x2 and x = y 2 in the xy-plane. We could evaluate this
double integral by first integrating over y
√
R = (x, y) ∈ R2 : 0 ≤ x ≤ 1, x2 ≤ y ≤ x
22
ENG2005 Advanced Engineering Mathematics Monash University
For this double integral, the order of integration is irrelevant, the double integral could be evaluated by
integrating over x first
√
R = (x, y) ∈ R2 : 0 ≤ y ≤ 1, y 2 ≤ x ≤ y
Example 1.3.6
Consider the double integral ZZ
(4 − x − y) dA
R
over the region bounded by the lines y = x, y = 2x and x = 2 in the xy-plane. We could evaluate this
double integral by first integrating over y
R = (x, y) ∈ R2 : 0 ≤ x ≤ 2, x ≤ y ≤ 2x
We could evaluate this double integral by changing the order of integration to first integrate over x
which would require splitting R into two regions
n y o n y o
R1 = (x, y) ∈ R2 : 0 ≤ y ≤ 2, ≤ x ≤ y and R2 = (x, y) ∈ R2 : 2 ≤ y ≤ 4, ≤x≤2
2 2
and then the double integral becomes
ZZ ZZ ZZ
(4 − x − y) dA = 4 − x − y dx dy + 4 − x − y dx dy
R R1 R2
Z 2 Z y ! Z 4 Z 2 !
= 4 − x − y dx dy + 4 − x − y dx dy.
y y
0 2 2 2
23
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.3.7
Consider the double integral ZZ
xy dA
R
over the region R
We could evaluate this double integral by first integrating over y which would require splitting R into
two regions R1 ∪ R2 where
√ √
R1 = (x, y) ∈ R2 : 0 ≤ x ≤ 1, − x ≤ y ≤ x
and √
R2 = (x, y) ∈ R2 : 1 ≤ x ≤ 4, x − 2 ≤ y ≤ x
Instead we can evaluate the double integral by changing the order of integration to first integrate over
x. For this situation the region can be described as
R = (x, y) ∈ R2 : −1 ≤ y ≤ 2, y 2 ≤ x ≤ y + 2 .
1 2 3
Z
= y + 4y 2 + 4y − y 5 dy
2 −1
45
= .
8
24
ENG2005 Advanced Engineering Mathematics Monash University
Example 1.3.8
Consider the double integral ZZ
sin(y)
dA
R y
over the region R
R = (x, y) ∈ R2 : 0 ≤ x ≤ 1, x ≤ y ≤ 1
sin(y)
However we would have to integrate with respect to y, therefore it is best to change the order
y
of integration. We will evaluate this double integral by first integrating with respect to x, where the
region is described as
R = (x, y) ∈ R2 : 0 ≤ y ≤ 1, 0 ≤ x ≤ y
25