You are on page 1of 30

Mathematical Economics

Hasin Yousaf

Week 3

Differentiation (cont’d)
Overview of today’s lecture

Differentiation

• Function of multiple variables

• Implicit functions
Partial Differentiation

Consider a function
y = f (x1 , x2 , · · · , xn )
where the variables xi i = 1, · · · , n are all independent of one another,
so that each can vary by itself without affecting the others. If the
variable x1 undergoes a change ∆x1 while x2 , · · · , xn all remain fixed,
there will be a corresponding change in y, ∆y.

Definition: The Difference Quotient

Given the function y = f (x1 , x2 , · · · , xn ), the difference quotient


of a change in x1 is

∆y f (x1 + ∆x1 , x2 , · · · , xn ) − f (x1 , x2 , · · · , xn )


=
∆x1 ∆x1
Partial Differentiation

For example, given y = f (x1 , x2 ) = 3x21 + x1 x2 + 4x22

• The difference quotient with respect to x1 is,

∆y 3(x1 + ∆x1 )2 + (x1 + ∆x1 )x2 + 4x22 − 3x21 − x1 x2 − 4x22


=
∆x1 ∆x1
6x1 ∆x1 + 3(∆x1 )2 + ∆x1 x2
=
∆x1
= 6x1 + 3∆x1 + x2

• The difference quotient with respect to x2 is,

∆y 3x2 + x1 (x2 + ∆x2 ) + 4(x2 + ∆x2 )2 − 3x21 − x1 x2 − 4x22


= 1
∆x2 ∆x2
x1 ∆x2 + 8x2 ∆x2 + 4∆x22
=
∆x2
= x1 + 8x2 + 4∆x2
The Partial Derivative

Frequently, we are interested in the rate of change of y where ∆x1 is


very small. In such a case, it is possible to obtain an approximation of
∆y/∆x1 by dropping all the terms in the difference quotient involving
the expression ∆x1 .

Definition: The Partial Derivative

For a function y = f (x1 , x2 , · · · , xn ), the partial derivative with


respect to x1 , if it exists, is defined as
∂y ∆y
= f1 = lim
∂x1 ∆x1 →0 ∆x1

where the symbol lim∆x1 →0 is read as ”The limit of ... as ∆x1


approaches 0“.
The Partial Derivative

For example, referring to the function y = f (x1 , x2 ) = 3x21 + x1 x2 + 4x22


again, we have found the difference quotients. Then,

• The partial derivative of the function with respect to x1 is


∂y ∆y
= f1 = lim
∂x1 ∆x1 →0 ∆x1

= lim 6x1 + 3∆x1 + x2


∆x1 →0

= 6x1 + x2

• The partial derivative of the function with respect to x2 is


∂y ∆y
= f2 = lim
∂x2 ∆x2 →0 ∆x2

= lim x1 + 8x2 + 4∆x2


∆x2 →0

= x1 + 8x2
Techniques of Partial Differentiation

• To calculate the partial derivative of a function f with respect to


any variable, pretend that the other variables are constant and
differentiate.

• For example, given y = f (x1 , x2 ) = 3x21 + x1 x2 + 4x22 , when finding


∂y/∂x1 , bear in mind that x2 is to be treated as a constant during
differentiation. Thus we have,
∂y
= f1 = 6x1 + x2
∂x1

Exercise

Find all the partial derivatives of the function


3x1 − 2x2
f (x1 , x2 , x3 ) = + x3
x21 + 3x2

Click for Detailed Solution


Gradient Vector

Definition: Gradient Vector

Consider the function f (x1 , x2 , · · · , xn ). We define the gradient


vector of f as the vector of partial derivatives

∇f (x1 , x2 , · · · , xn ) = (f1 , f2 , · · · , fn )

Note that since the function f has n arguments, there are altogether n
partial derivatives, hence ∇f is a 1 × n vector.

Exercise

Find the gradient vector at the point x = (1, 1, 1) of the function

f (x1 , x2 , x3 ) = 3x1 x2 + 4x1 x3 + 5x2 x3

Click for Detailed Solution


Applications to Comparative Static Analysis

Consider again the simple one-commodity market model

Qd = a − bP (a, b > 0)
Qs = −c + dP (c, d > 0)

We found the solutions


a+c
P∗ =
b+d
∗ ad − bc
Q =
b+d
These solutions are referred to as being in the reduced form: The two
endogenous variables have been reduced to explicit expressions of the
four mutually independent parameters a, b, c, d.
Change in the Parameter a

∂P ∗ 1 ∂Q∗ d
= >0 = >0
∂a b+d ∂a b+d
Hence, when the parameter a increases, both the equilibrium quantity
and the equilibrium price increase.

S
a

Q∗0
Q∗

D0
D
0 P
P ∗P ∗0
-c
Change in the Parameter d

∂P ∗ −(a + c) ∂Q∗ ab + bc
= <0 = >0
∂d (b + d)2 ∂d (b + d)2
Hence, when the parameter d increases, the equilibrium quantity
increases and the equilibrium price decreases.

Q
S0

a
S

Q∗0
Q∗

D
0 P
-c P ∗0P ∗
General-Function Models

• To be able to use partial differentiation, a requirement is that there


must be functional independence among independent variables.

• For example, if we have y = f (x1 , x2 ) = 3x1 + 4x2 then, to use


partial differentiation, a key requirement is that when x1 changes, x2
remains constant. In other words, there is no functional relationship
between x1 and x2 that would causes x2 to change when x1 changes.

• Suppose instead that we have a function y = f (x1 , x2 ) but x2


changes when x1 changes and vice versa (i.e. there is interdepen-
dence). In this case we can no longer use partial differentiation.
Instead, we use total differentiation.
Total Differentials

We now extend the idea of a differential to a function that has more


than one independent variable. Consider the function

y = f (x1 , x2 )

The easiest way to proceed might be to find the two separate partial
derivatives fx1 and fx2 , and then substitute these into the equation:

∂y ∂y
dy = dx1 + dx2
∂x1 ∂x2

= fx dx1 + fx2 dx2


| 1{z } | {z }
change in y due change in y due
to change in x1 to change in x2

dy is called the total differential of the y function. It is the sum of the


change that occurs from a change in x1 and x2 .
Total Differentials

Example 1: Given z = 3x2 + 2xy − 2y 3 , find the total differ-


ential of z.

∂z ∂z
dz = dx + dy
∂x ∂y
= (6x + 2y)dx + (2x − 6y 2 )dy

x
Example 2: Given z = x+y
, find the total differential of z.

∂z ∂z
dz = dx + dy
∂x ∂y
   
(1)(x + y) − (x)(1) −(x)(1)
= dx + dy
(x + y)2 (x + y)2
   
y x
= dx − dy
(x + y)2 (x + y)2
Total Derivatives

The total derivative is just a ratio of two differentials. So, to find the
total derivative:
• Step 1: Find the total differential
• Step 2 : Divide by the relevant differential

Suppose we have y = f (x, w) where x = g(w).


• Step 1: First find the total differential:
∂y ∂y
dy = dx + dw
∂x ∂w
• Step 2: Divide the total differential by dw:
dy ∂y dx ∂y dw
= +
dw ∂x dw ∂w dw
∂y dx ∂y
= +
|∂x{zdw} ∂w
|{z}
indirect effect of w direct effect of w
Total Derivatives

dy
Example 1: Find dw given y = f (x, w) = 4x2 − 2w where
2
x = g(w) = w + w − 3.
• Step 1: First find the total differential:
∂y ∂y
dy = dx + dw
∂x ∂w
• Step 2: Divide the total differential by dw:
dy ∂y dx ∂y dw
= +
dw ∂x dw ∂w dw
∂y dx ∂y
= +
∂x dw ∂w
= (8x)(2w + 1) + (−2)
= 16wx + 8x − 2
= 16w(w2 + w − 3) + 8(w2 + w − 3) − 2
= 16w3 + 24w2 − 40w − 26
Implicit Functions

• A function given in the form of y = f (x), for example y = f (x) =


2x2 is called an explicit function, because the variable y is explicitly
expressed as a function of x.

• However, if the function is written in the equivalent form y−2x2 = 0


then we no longer have an explicit function. Rather, the function
is now implicitly defined and is referred to as an implicit function.

• While it is always possible to transform an explicit function y = f (x)


into an equation F (y, x) = 0, the converse need not hold true. In
other words, it is not necessarily the case that an equation of the
form F (y, x) = 0 implicitly defines a function y = f (x).
Implicit Functions

So how to check whether a given equation defines an implicit function?

Theorem: Implicit Functions

Given an equation of the form

F (y, x1 , ..., xn ) = 0

if
1. F has continuous partial derivatives Fy , F1 , · · · , Fn ,
2. at a point (y0 , x10 , ..., xn0 ) satisfying the equation, Fy 6= 0,
then there exists an n-dimensional neighbourhood of
(y0 , x10 , ..., xn0 ) in which y is an implicitly defined function of
the variables x1 , · · · , xn in the form of y = f (x1 , ..., xn ).
Implicit Functions

For example, suppose we have the equation F (y, x) = x2 + y 2 − 9 = 0.


We want to know whether it defines an implicit function. To do that,
we need to check the two conditions:
• Does F have continuous partial derivatives?
Here the answer is yes.
Fy = 2y Fx = 2x

• For the points that satisfy the equation F (y, x) = 0, is Fy 6= 0?


Fy = 2y. Clearly, this will equal zero when y is zero.
When y = 0, x values of −3 or 3 will satisfy F (y, x) = 0. So, for the
points (−3, 0) and (3, 0), Fy = 0. But for all other combinations of
(x, y), Fy 6= 0.

So for all possible combinations of (x, y) that satisfy F (y, x) = x2 + y 2 −


9 = 0 except the two points (−3, 0) and (3, 0), Fy = 0 and therefore we
will be able to find a neighbourhood of points for which the implicit
function y = f (x) is defined.
Derivatives of Implicit Functions

So how can we find the derivatives of an implicit function.

Theorem: Derivatives of Implicit Functions

Given an equation of the form

F (y, x1 , · · · , xn ) = 0

if an implicit function is defined, then its partial derivatives can


be found using the formula:
∂y Fi
fi = =− for i = 1, 2, · · · , n
∂xi Fy

This is a nice result because it means that even if you don’t know what
the implicit function looks like, you can still find its derivatives.
Derivatives of Implicit Functions

Example 1: Suppose the equation F (y, x) = y − 3x4 = 0 im-


dy
plicitly defines a function y = f (x). Find dx .

dy Fx (−12x3 )
=− =− = 12x3
dx Fy 1

Example 2: Suppose the equation F (y, x, w) = xy 2 − 2xwy +


10wx + 5 = 0 implicitly defines a function y = f (x, w). Find
dy dy
dx
and dw .

dy Fx y 2 − 2wy + 10w
=− =−
dx Fy 2xy − 2xw
dy Fw −2xy + 10x
=− =−
dw Fy 2xy − 2xw
Extension to the Simultaneous-Equation Case

A generalised version of the implicit function theorems deals with the


conditions under which a set of simultaneous equations

F 1 (y1 , ..., ym ; x1 , ..., xn ) = 0


F 2 (y1 , ..., ym ; x1 , ..., xn ) = 0
···
m
F (y1 , ..., ym ; x1 , ..., xn ) = 0

will define a set of implicit functions

y1 = f 1 (x1 , · · · , xn )
y2 = f 2 (x1 , · · · , xn )
···
m
ym = f (x1 , · · · , xn )
Extension to the Simultaneous-Equation Case

For example, consider the following three equations:

F 1 (x, y, w; z) = xy − w = 0
F 2 (x, y, w; z) = y − w3 − 3z = 0
F 3 (x, y, w; z) = w3 + z 3 − 2zw = 0

First, we take the total differential of the system

ydx + xdy − dw = 0
dy − 3w2 dw − 3dz = 0
3w2 dw + 3z 2 dz − 2zdw − 2wdz = 0
Extension to the Simultaneous-Equation Case

Moving the exogenous differential dz to the RHS and writing in matrix


form we get
    
y x −1 dx 0
 0 1 −3w2   dy  =  3  dz
0 0 3w2 − 2z dw 2w − 3z 2

Dividing both sides of the above equation by dz we get


   dx   
y x −1 dz 0
 0 1 −3w2   dy dz
= 3 
2 dw 2
0 0 3w − 2z dz
2w − 3z
Extension to the Simultaneous-Equation Case

Using Cramer’s rule, we solve



0 x −1

2

3 1 −3w

2 2
dx |Jx | 2w − 3z 0 3w − 2z
= =
dz |J| y x
−1

2
0 1
−3w

0 0 3w2 − 2z

−3x(3w2 − 2z) − 3xw2 (2w − 3z 2 ) + 2w − 3z 2


=
y(3w2 − 2z)

dy dw
We can solve for dz and dz in the same way.
Announcements

• No class next week (Week 4)

• Mid term: Wednesday 22 March, 2019

• Venue: Chemical Sciences Building (F10) M17

• Duration: 75 minutes

• The exam starts at 9:05am. Be seated by 9:00am.

• The exam covers materials in Weeks 1-3.


Midterm

• It’s a closed-book exam.

• You can bring one A4-sized cheatsheet (double-sided).

• A non-programmable calculator is allowed.

• There will be NO supplementary exam offered for the mid-session


exam. You should make every effort to take the mid-session exam.
Students who fail to attend the examination will need to apply for
Special Consideration.
Detailed Solutions
• The partial derivative with respect to x1 is

∂y 3(x21 + 3x2 ) − 2x1 (3x1 − 2x2 ) −3x21 + 4x1 x2 + 9x2


= f1 = 2 =
∂x1 (x1 + 3x2 ) 2 (x21 + 3x2 )2

• The partial derivative with respect to x2 is

∂y −2(x21 + 3x2 ) − 3(3x1 − 2x2 ) −x1 (2x1 + 9)


= f2 = =
∂x2 (x21 + 3x2 )2 (x21 + 3x2 )2

• The partial derivative with respect to x3 is


∂y
= f3 = 1
∂x3

Go Back
• The partial derivative with respect to x1 is
∂y
= f1 = 3x2 + 4x3
∂x1

• The partial derivative with respect to x2 is


∂y
= f2 = 3x1 + 5x3
∂x2

• The partial derivative with respect to x3 is


∂y
= f3 = 4x1 + 5x2
∂x3

Hence, the gradient vector is given as


∇f (x1 , x2 , x3 ) = (3x2 + 4x3 , 3x1 + 5x3 , 4x1 + 5x2 )

At the point (1, 1, 1), the gradient vector is given as


∇f (1, 1, 1) = (7, 8, 9)

Go Back