Differential Calculus of Multivariable
Functions
Bui Le Trong Thanh
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 1 / 38
Content
Partial Derivatives and Total Differential
Definition of partial derivatives. Computing partial derivatives
Higher-order partial derivatives
Meaning of partial derivatives
Total differential
Applications of Partial Derivatives
Unconstrained extrema
Constrained extrema
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 2 / 38
Partial Derivatives
First-Order Partial Derivatives
Given the function z = f (x, y ).
The partial derivative of f (or z) with respect to variable x at
point (x0 , y0 ):
∂f
fx (x0 , y0 ) ≡ (x0 , y0 ) := g ′ (x0 ), where g (x ) = f (x, y0 ).
∂x
The partial derivative of f with respect to variable y at point
(x0 , y0 ):
∂f
fy (x0 , y0 ) ≡ (x0 , y0 ) := h′ (y0 ), where h (y ) = f (x0 , y ).
∂y
Remark: To compute the partial derivative of a multivariable function with
respect to a particular variable, we treat all other variables as constants
and use the known rules for single-variable functions.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 3 / 38
Partial Derivatives
Example
a/ z = f (x, y ) = 3x 2 y 3 + xexy
p
b/ z = g (x, y ) = x 2 + 3y − sin(2x + y 2 )
Solution
fx (x, y ) = 6xy 3 + e xy + xye xy = 6xy 3 + (1 + xy )exy
fy (x, y ) = 9x 2 y 2 + x 2 exy
x
gx (x, y ) = p − 2 cos(2x + y 2 )
2
x + 3y
3
gy (x, y ) = p − 2y cos(2x + y 2 )
2 x 2 + 3y
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 4 / 38
Partial Derivatives
Second-Order Partial Derivatives
Given the function z = f (x, y ). The second-order partial derivatives of
function f are defined as follows
∂ 2f ∂
fxx (x, y ) ≡ (x, y ) := (fx (x, y ))
∂ x2 ∂x
∂ 2f ∂
fyx (x, y ) ≡ (x, y ) := (fy (x, y ))
∂y∂x ∂x
∂ 2f ∂
fxy (x, y ) ≡ (x, y ) := (fx (x, y ))
∂ x∂ y ∂y
∂ 2f ∂
fyy (x, y ) ≡ 2
(x, y ) := (fy (x, y ))
∂y ∂y
Note: Usually we have
fxy = fyx .
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 5 / 38
Partial Derivatives
Compute the second-order partial derivatives of the function
z = f (x, y ) = x 1/3 y 2/3 + ln(2x − 3y 2 )
Solution
1 2
zx = x −2/3 y 2/3 + .
3 2x − 3y 2
r
1 y 2/3 2 1 3 y 2 2
Note: zx = + 2
= + .
3 x 2x − 3y 3 x 2x − 3y 2
2 4
zxx = − x −5/3 y 2/3 − .
9 (2x − 3y 2 )2
2 12y
zxy = x −2/3 y −1/3 + = zyx .
9 (2x − 3y 2 )2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 6 / 38
Partial Derivatives
2 6y
zy = x 1/3 y −1/3 − .
3 2x − 3y 2
2 6(2x − 3y 2 ) − 6y (−6y )
zyy = − x 1/3 y −4/3 −
9 (2x − 3y 2 )2
2 18y 2 + 12x
= − x 1/3 y −4/3 − .
9 (2x − 3y 2 )2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 7 / 38
Partial Derivatives
2
Compute the second-order partial derivatives of f (x, y ) = x 2 exy
Solution
2 2 2
fx = 2xe xy + x 2 y 2 e xy = (2x + x 2 y 2 )e xy
2 2 2
fxx = (2 + 2xy 2 )e xy + (2x + x 2 y 2 )y 2 e xy = (2 + 4xy 2 + x 2 y 4 )e xy .
2 2 2
fxy = 2x 2 ye xy + 2xy (2x + x 2 y 2 )e xy = (6x 2 y + 2x 3 y 3 )e xy = fyx .
2 2
fy = x 2 e xy 2xy = 2x 3 ye xy .
2 2 2
fyy = 2x 3 e xy + 2x 3 ye xy 2xy = (2x 3 + 4x 4 y 2 )e xy .
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 8 / 38
Partial Derivatives
Compute the second-order partial derivatives of Q (K , L) = 8K −3/4 L1/4
Solution
QK = −6K −7/4 L1/4
21
QKK = K −11/4 L1/4
2
3
QKL = − K −7/4 L−3/4 = QLK .
2
QL = 2K −3/4 L−3/4
3
QLL = − K −3/4 L−7/4
2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 9 / 38
Partial Derivatives
Derivative of Composite Functions
Given the function z = f (x, y ) where x = x (t ); y = y (t ). Then
dz ∂ z dx ∂ z dy
= . + . or zt = zx .xt + zy .yt .
dt ∂ x dt ∂ y dt
Given the function z = f (u, v ) where u = u (x, y ); v = v (x, y ). Then
∂z ∂z ∂u ∂z ∂v
= . + . or zx = zu .ux + zv .vx .
∂x ∂u ∂x ∂v ∂x
∂z ∂z ∂u ∂z ∂v
= . + . or zy = zu .uy + zv .vy .
∂y ∂u ∂y ∂v ∂y
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 10 / 38
Partial Derivatives
Given z = f (u, v ) = u 2 v − uv 2 and u = x sin y ; v = y cos x. Compute zx , zy .
Solution
zu = 2uv − v 2 ; zv = u 2 − 2uv
ux = sin y ; uy = x cos y ; vx = −y sin x, vy = cos x
zx = zu .ux + zv .vx = (2uv − v 2 ) sin y − (u 2 − 2uv )y sin x
zy = zu .uy + zv .vy = (2uv − v 2 )x cos y + (u 2 − 2uv ) cos x
Note:
If we need to compute zx at x = 0; y = π/2.
Note that u = x sin y = 0, v = y cos x = π/2.
We have zx (0; π/2) = −π 2 /4.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 11 / 38
Partial Derivatives
Derivative of Implicit Functions
Suppose the equation F (x, y ) = 0 defines an implicit function y =
y (x ), meaning F (x, y (x )) = 0. Then we have
dy Fx Fx
=− or y ′ = − .
dx Fy Fy
Note: At x = x0 , to compute y (x0 ) we solve the equation F (x0 , y (x0 )) =
0 to find y (x0 ).
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 12 / 38
Partial Derivatives
Compute y ′ (0) given that y sin x − cos(x − y ) = 0 and y (0) = π2 .
Solution
F (x, y ) = y sin x − cos(x − y ) ⇒ Fx = y cos x + sin(x − y ) and
Fy = sin x − sin(x − y ).
Fx (x, y ) y cos x + sin(x − y )
y ′ (x ) = − =− .
Fy (x, y ) sin x − sin(x − y )
Fx (0, π/2) π
y ′ (0) = − = 1− .
Fy (0, π/2) 2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 13 / 38
Partial Derivatives
Meaning of Partial Derivatives
⋄ Approximate partial rate of change
f (x, y0 ) ≈ f (x0 , y0 ) + fx (x0 , y0 )(x − x0 ).
f (x0 , y ) ≈ f (x0 , y0 ) + fy (x0 , y0 )(y − y0 ).
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 14 / 38
Partial Derivatives
Meaning of Partial Derivatives
⋄ Marginal values
Marginal value with respect to variable x at (x0 , y0 )
Mx z (x0 , y0 ) = zx (x0 , y0 ) ≈ z (x0 + 1, y0 ) − z (x0 , y0 )
Marginal value with respect to variable y at (x0 , y0 )
My z (x0 , y0 ) = zy (x0 , y0 ) ≈ z (x0 , y0 + 1) − z (x0 , y0 )
Example: Marginal product with respect to capital and labor, etc.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 15 / 38
Partial Derivatives
Meaning of Partial Derivatives
⋄ Partial elasticity
Partial elasticity with respect to variable x at (x0 , y0 )
x0
E x z ( x0 , y0 ) = zx ( x0 , y0 )
z ( x0 , y0 )
Partial elasticity with respect to variable y at (x0 , y0 )
y0
E y z ( x0 , y0 ) = zy ( x0 , y0 )
z ( x0 , y0 )
⋄ The partial elasticity Ex z is the quantity indicating the change
(in %) of z when x changes by 1%.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 16 / 38
Partial Derivatives
Meaning of Partial Derivatives
⋄ Example: Consider the demand function for a product
Q = 100 − 2P + PA + 0.1Y
where
Q is quantity demanded, P is the selling price of that product
PA is the selling price of a related product
Y is income
When P = 10, PA = 12, Y = 1000, find the elasticity of demand
with respect to income. If income increases by 5%, how does
quantity demanded change?
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 17 / 38
Solution Q = 192.
Y Y 1000 25
EY Q = QY = 0.1 = 0.1. = .
Q Q 192 48
Therefore, if income increases by 5%, then quantity demanded changes by
25
.5% = 2.6%
48
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 18 / 38
Total Differential
Definition
Given the function z = f (x, y ), dx = ∆x = x − x0 , dy = ∆y = y − y0 .
The total differential of f at (x0 , y0 ) is defined by
df (x0 , y0 ) = fx (x0 , y0 )dx + fy (x0 , y0 )dy
The second differential of f
d 2 f (x0 , y0 ) = fxx (x0 , y0 )dx 2 + 2fxy (x0 , y0 )dxdy + fyy (x0 , y0 )dy 2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 19 / 38
Total Differential
Application
Note: dx = ∆x = x − x0 ; dy = ∆y = y − y0 .
Linear approximation of two-variable functions
f (x, y ) ≈ f (x0 , y0 ) + fx (x0 , y0 )(x − x0 ) + fy (x0 , y0 )(y − y0 )
= f (x0 , y0 ) + df (x0 , y0 ).
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 20 / 38
Total Differential
Example
Given the function
z = f (x, y ) = 6x 2/3 y 1/2
a/ Write the expression for df (1000; 100).
b/ Use part a/ to approximate the value f (998; 101.5)
Solution
a) df = fx dx + fy dy = 4x −1/3 y 1/2 dx + 3x 2/3 y −1/2 dy .
Thus df (1000; 100) = 4dx + 30dy .
b) We have x = 998; x0 = 1000; dx = x − x0 = −2; y = 101.5, y0 =
100, dy = y − y0 = 1.5.
f (998; 101.5) = f (1000; 100) + 4(−2) + 30.1.5 = 6000 − 8 + 45 = 6037.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 21 / 38
Unconstrained Extrema
Method for Finding Extrema of Two-Variable
Functions z = f (x, y )
Find stationary points by solving the system of equations
(
fx′ (x, y ) = 0
fy′ (x, y ) = 0
Compute D1 (x, y ) = fxx (x, y ) and
fxx (x, y ) fxy (x, y )
D2 (x, y ) =
fyx (x, y ) fyy (x, y )
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 22 / 38
Unconstrained Extrema
At each stationary point M, check the sufficient condition
If D2 (M ) < 0, then f has no extremum at M
If D1 (M ) < 0 and D2 (M ) > 0, then f has a local maximum at M
If D1 (M ) > 0 and D2 (M ) > 0, then f has a local minimum at M
If D1 < 0 and D2 > 0 for all M ∈ D, then f achieves its maximum
on D at M
If D1 > 0 and D2 > 0 for all M ∈ D, then f achieves its minimum
on D at M
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 23 / 38
Unconstrained Extrema
Example
Find the extrema of the function
f (x, y ) = x 3 + y 3 − 12xy
Solution
fx = 3x 2 − 12y ; fy = 3y 2 − 12x.
y = 1 x 2
y = 1 x 2
(
3x 2 − 12y = 0
⇔ 4 ⇔ 1 4
3y 2 − 12x = 0 y 2 − 4x = 0 x 4 − 4x = 0
16
y = 1 x 2
y = 1 x 2
⇔ 4 ⇔ 4
1
x = 0 or x 3 − 4 = 0
x = 0 or x = 4
16
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 24 / 38
Solution
⇔ (x, y ) = (0, 0) or (x, y ) = (4, 4).
fxx = 6x; fxy = −12 = fyx ; fyy = 6y .
Thus D1 (x, y ) = fxx (x, y ) = 6x and
fxx (x, y ) fxy (x, y ) 6x −12
D2 (x, y ) = = = 36xy − 144.
fyx (x, y ) fyy (x, y ) −12 6y
We have D2 (0, 0) = −144 < 0 ⇒ f has no local extremum at (0, 0).
We have D2 (4, 4) = 432 > 0; D1 (4, 4) = 24 > 0 ⇒ f has a local minimum
at (4, 4).
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 25 / 38
Unconstrained Extrema
NOTE
1) A company produces two types of products with quantity of type
1 being Q1 and type 2 being Q2 . The unit price of type 1 is P1 ,
of type 2 is P2 . The total cost function is C (Q1 , Q2 ). We have
the profit function
π (Q1 , Q2 ) = P1 Q1 + P2 Q2 − C (Q1 , Q2 ). (0.1)
2) According to this understanding, the total cost function
C (Q1 , Q2 ) already includes the quantity t1 Q1 + t2 Q2 where t1 , t2
are respectively the additional costs per unit of product type 1
and type 2, so using formula (0.1) is sufficient.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 26 / 38
Unconstrained Extrema
Example
A monopoly company produces two types of products with demand
functions respectively
QD1 = 500 − P1 + P2 , QD2 = 2000 + P1 − 2P2 ,
where P1 , P2 are the prices of the two products. The cost function is
C (Q1 , Q2 ) = Q12 + Q1 Q2 + Q22 .
Find Q1 , Q2 such that the company obtains maximum profit.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 27 / 38
Solution
We have Q1 = QD1 = 500 − P1 + P2 ; Q2 = QD2 = 2000 + P1 − 2P2 .
We have P1 = 500 + P2 − Q1 . Substituting into Q2 we get
Q2 = 2000 + (500 + P2 − Q1 ) − 2P2 . Thus P2 = 2500 − Q1 − Q2 .
P1 = 500 + P2 − Q1 = 500 + 2500 − Q1 − Q2 − Q1 = 3000 − 2Q1 − Q2 .
Therefore the profit function
π (Q1 , Q2 ) = P1 Q1 + P2 Q2 − C (Q1 , Q2 ) =
(3000 − 2Q1 − Q2 )Q1 + (2500 − Q1 − Q2 )Q2 − Q12 − Q1 Q2 − Q22 ⇒
π (Q1 , Q2 ) = −3Q12 − 2Q22 − 3Q1 Q2 + 3000Q1 + 2500Q2 .
πQ1 = −6Q1 − 3Q2 + 3000;
πQ2 = −4Q2 − 3Q1 + 2500 = −3Q1 − 4Q2 + 2500. Thus
( (
−6Q1 − 3Q2 + 3000 = 0 Q1 = 300
⇔
−3Q1 − 4Q2 + 2500 = 0 Q2 = 400
πQ1 Q1 = −6; πQ1 Q2 = −3 = πQ2 Q1 ; πQ2 Q2 = −4
Therefore D1 (Q1 , Q2 ) = −6 < 0 and
−6 −3
D2 ( Q 1 , Q 2 ) = = 15 > 0, ∀(Q1 , Q2 ). Thus Q1 = 300, Q2 = 400
−3 −4
gives the company maximum profit.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 28 / 38
Constrained Extrema
Problem
Find the extrema of the function z = f (x, y ) subject to the constraint
ϕ (x, y ) = 0
Reduction to Single-Variable Function
From the constraint ϕ (x, y ) = 0, express y in terms of x or x in
terms of y
Substitute y = y (x ) into f (x, y ) to obtain z = h (x ) = f (x, y (x ))
Find extrema of the single-variable function h (x ). Note that if h
achieves an extremum at x0 , then the two-variable function f
achieves an extremum at (x0 , y (x0 ))
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 29 / 38
Constrained Extrema
Find the extrema of the function
z = f (x, y ) = x 2 − 3xy + 12x
subject to the constraint 2x + 3y = 6.
Solution
3y = 6 − 2x ⇒ z = x 2 − x (6 − 2x ) + 12x = 3x 2 + 6x.
Thus z ′ = 6x + 6 =0 ⇐⇒ x = −1.
′′ 8
z = 6 > 0, ∀x =⇒ −1; is a minimum point.
3
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 30 / 38
Constrained Extrema
Lagrange Multiplier Method
Form the Lagrange function L(x, y , λ ) = f (x, y ) + λ ϕ (x, y )
Solve the following system of equations to find stationary points
Lx (x, y , λ ) = 0
Ly (x, y , λ ) = 0
Lλ (x, y , λ ) = 0
Note: If (x, y , λ ) is a solution of the above system, then we say
(x, y ) is a stationary point corresponding to Lagrange multiplier
λ
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 31 / 38
Constrained Extrema
Lagrange Multiplier Method
Check sufficient condition: Suppose M is a stationary point
corresponding to Lagrange multiplier λ0 . Consider the bordered
Hessian matrix
Lxx Lxy Lxλ
Hb (x, y ) = Lyx Lyy Ly λ
Lλ x Lλ y Lλ λ
If |Hb (xM , yM , λ0 )| > 0, then f has a local maximum at M
If |Hb (xM , yM , λ0 )| < 0, then f has a local minimum at M
If |Hb (x, y , λ )| > 0, ∀(x, y , λ ), then f achieves its maximum at M
If |Hb (x, y , λ )| < 0, ∀(x, y , λ ), then f achieves its minimum at M
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 32 / 38
Constrained Extrema
Lagrange Multiplier Method
1
Find the extrema of the function f (x, y ) = √ (x − y ) subject to the
2
constraint
x2 + y2 = 1
Solution ϕ (x, y ) = x 2 + y 2 − 1. Form the Lagrange function
1
L(x, y , λ ) = f (x, y ) + λ ϕ (x, y ) = √ (x − y ) + λ (x 2 + y 2 − 1).
2
1
1
x = − √ x =− √
1
2 2λ
2 2λ
L = √ + 2λ x = 0
x
2
1 1
Ly = − √ + 2λ y = 0 ⇔ y= √ ⇔
y= √
1
2 2 2λ
2 2λ
2
Lλ = x 2 + y 2 − 1 = 0
1 1
= λ 2.
2 √ =1
2 2λ 4
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 33 / 38
Solution
√ √
1
x = − √ 2 2
x =− x=
2 2λ
2
2
√ √
1
⇔ y= √ ⇔ 2 or 2
y= 2 y =−
2 2λ
2
1
λ = or λ = − .
1 λ = 1.
λ = −1.
2 2 2 2
Lxx = 2λ ; Lxy = 0; Lxλ = 2x.
Lyx = 0; Lyy = 2λ ; Ly λ = 2y .
Lλ x = 2x; Lλ y = 2y ; Lλ λ = 0.
2λ 0 2x
|Hb | = 0 2λ 2y
2x 2y 0
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 34 / 38
√
√ √ ! 1 0 −√ 2
2 2 1
Hb − ; ; = 0
√ √1 2 ≈ −3.4 < 0
2 2 2
− 2 2 0
√ √ !
2 2
Thus − ; is a minimum point.
2 2
√
√ √ −1 0 √2
!
2 2 1
Hb ;− ;− = 0
√ −1
√ − 2 ≈ 3.4 > 0
2 2 2
2 − 2 0
√ √ !
2 2
Thus ;− is a maximum point.
2 2
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 35 / 38
Constrained Extrema
Lagrange Multiplier Method
To produce a certain product, two types of raw materials that can
substitute for each other are used. The production level is determined
by
Q = 3x 2/3 y 1/3 ,
where x is the quantity of the first raw material, y is the quantity of
the second raw material. The prices of these two raw materials are
respectively P1 = 2 and P2 = 1. Calculate x, y so that the cost of
producing 100 units of output is minimized.
Solution
The cost is f (x, y ) = 2x + y . The output is
3x 2/3 y 1/3 = 100 ⇔ ϕ (x, y ) = 3x 2/3 y 1/3 − 100.
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 36 / 38
Solution
Form the Lagrange function
L(x, y , λ ) = f (x, y ) + λ ϕ (x, y ) = 2x + y + λ (3x 2/3 y 1/3 − 100).
Lx = 2 + 2λ x −1/3 y 1/3 = 0
L = 1 + λ x 2/3 y −2/3 = 0 . Let a = x 1/3 ; b = y 1/3 . We have
y
Lλ = 3x 2/3 y 1/3 − 100 = 0
b 1 a
=− = −λ
−1 a
1+λa b = 0 λ
b
2 −2 ⇔
a 2 1 ⇔ 1
1+λa b = 0
b = −λ
λ2 = −
2
3a b = 100
2 λ
2 3a b = 100
3a b = 100
λ = −1 100 100 100
a 3= x =
x=
3
3 3
⇔ a=b ⇔ ⇔ ⇔ 100
a3 = b 3
x =y
y=
3
λ = −1 λ = −1
3
3a = 100
λ = −1
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 37 / 38
Solution
2 2
Lxx = − λ x −4/3 y 1/3 ; Lxy = λ x −1/3 y −2/3 ; Lxλ = 2x −1/3 y 1/3
3 3
2 −1/3 −2/3 2
Lyx = λ x y ; Lyy = − λ x 2/3 y −5/3 ; Ly λ = x 2/3 y −2/3
3 3
Lλ x = 2x −1/3 y 1/3 ; Lλ y = x 2/3 y −2/3 ; Lλ λ = 0
1 1
Lxx = ; Lxy = − ; Lxλ = 2
50 50
1 1
Lyx = − ; Lyy = ; Ly λ = 1
50 50
Lλ x = 2; Lλ y = 1; Lλ λ = 0
1/50 −1/50 2
100 100
Hb ; ; −1 = −1/50 1/50 1 = −9/50 < 0
3 3
2 1 0
100 100
Thus (x, y ) = ; is a minimum point.
3 3
Bui Le Trong Thanh Differential Calculus of Multivariable Functions 38 / 38