Calculus of Several Variables

Benjamin McKay
Calculus of Several Variables
Optimisation and Finance
May 16, 2016
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Preface
The course is divided into two main topics:
a. Functions of several variables and their derivatives
b. Optimisation (i.e., finding maxima and minima of functions of several
variables)
It is assumed that you all know how to differentiate standard functions of one
variable using the product rule, quotient rule and chain rule—for example I
fully expect you to be able to find the derivatives of functions such as
2
x
, e2x ln x.
(x3 +2x−5)4 , x2 sin 2x, sin2 x, e2x+3 , ex , x ln(5x2 +1), ln
1+x
These notes will make no use of a fixed textbook. If however you wish to
consult a supplementary textbook, feel free to look at almost any calculus book
in the Library, for example Stewart’s Calculus, or see the growing amount of
free calculus and economics material on the internet.
Several references in the notes will be made to various internet sites that
contain relevant material for this course. I do expect you to look at this internet
material. These links were working at the time of typing these notes but since
the internet is constantly changing if any of the website references are no longer
active please let me know and I will pass on this information to the class.
You will find plenty of other sites that are helpful for this course—search
the web for “calculus” or some particular topic such as “elasticity of demand.”
The only way to learn mathematics is to do exercises. Most sections in
these notes end with a collection of Exercises. You will be able to get help with
these at the tutorials.
iii
Contents
1
Functions of several variables
2
Partial derivatives
3
Partial derivatives in economics
4
Optimisation
5
Lagrange multipliers
Bibliography
List of notation
Index
49
iv
7
25
45
47
1
37
17
Chapter 1
Functions of several variables
In a previous course, you dealt with functions such as y = f (x), which can
also be written as y = y(x): here y, the dependent variable, is a function of a
single independent variable x. We graph functions of a single variable in two
dimensions using a diagram with x and y-axes like:
4
2
0
-2
-4
-2
-1
0
1
2
However as we shall come to see many functions depend on more than one
variable.
a. The volume, V , of a cylinder is given by V = πr2 h. We indicate
the dependence of the variable V on the independent variables r
and h by writing V = f (r, h) or more commonly V = V (r, h).
b. The temperature, T , on the earth’s surface at 12 noon Irish time
today depends on where you are, i.e. it is a function of both
your latitude x and longitude y; we would write T = f (x, y) or
T = T (x, y).
c. The production function is given by Q = f (K, L) or Q = Q(K, L).
Here Q is the output of an industry, K is the quantity of capital
invested in that industry and L is the quantity of labour used in
the industry.
d. The demand function is given by D = f (P, PA , Y ) or D =
D(P, PA , Y ) where D is the demand, P is the price of a product, PA is the price of an alternative related product and Y is the
income of the customers.
For functions of one variable, while any two letters can be used for the
dependent and independent variables, very often one works simply with y =
f (x). Similarly, for functions of two variables, one frequently uses z = f (x, y).
1
2
Functions of several variables
Here x, y are the independent variables while z is the dependent variable; once
x and y are specified, then z has no independence and must take a prescribed
value. For example, suppose we define z = x2 + 5y 3 ; if we are then told that
x = 3 and y = 1, it must follow that z = 32 + 5(1)3 = 9 + 5 = 14.
To graph the function z = f (x, y) we need x, y and z-axes: 3 dimensions.
Points in 3-dimensional space will have three coordinates (x, y, z). For example
the point (0, 1, 0) lies on the y-axis (because the other two coordinates are zero)
at the value y = 1.
(plotting some planes in 3 dimensions)
a. z = 0 is the xy-plane, i.e. all points that lie in the 2-dimensional
plane containing the x and y-axes. In two dimensions x = c
(constant) is a line perpendicular to the x-axis, y = c is a line
perpendicular to the y-axis; in three dimensions x = c is a plane
perpendicular to the x-axis, y = c is a plane perpendicular to the
y-axis, z = c is a plane perpendicular to the z-axis.
b. z = 2 is the plane consisting of all points at a height of 2 units
above the xy-plane. (Here and in the future, think of the xy-plane
as being horizontal, and the z-coordinate as giving the height
above the xy-plane.) Again it is perpendicular to the z-axis.
c. In fact all planes have an equation of the form c1 x+c2 y +c3 z = c4 ,
where the ci are constants. The constant c4 can take any value
while some (but not all) of c1 , c2 , c3 may be equal to zero. For
example, the plane z = y:
Functions of several variables
The x-axis lies on this plane because it comprises all points (x, y, z)
for which y = 0 and z = 0; and these are points that satisfy the
equation z = y and consequently they lie on our plane.
An easy-to-use interactive gallery that will aid your understanding of the
graphing of planes can be found at
http://www.univie.ac.at/future.media/moe/galerie.html
in “Planes in 3-space” under “Analytic geometry 2”, where you will be able to
rotate and zoom the graphs of 5 different planes and be challenged to identify
their equations (hint: start with plane number 2, it’s the easiest).
What is the graph of y = x? The answer depends on whether we are
working in two dimensions (x and y) or three dimensions (x, y and z).
In two dimensions the graph of y = x is a straight line, while in three
dimensions the graph of y = x is a plane.
From the examples we have looked at so far we now know that the graph
of a function of one variable, y = f (x), is a curve in 2-dimensional space. The
graph of a function of two variables, z = f (x, y), is a surface in 3-dimensional
space. A plane is simply a flat surface. In general it is difficult to draw surfaces
by hand but there are good computer packages available for this purpose (e.g.,
Maple, Mathematica, Matlab). The figures that I have plotted here for example
have been created using Matlab.
A typical surface z = f (x, y):
3
4
Functions of several variables
A handy aid to help visualize such surfaces without using a computer is the
use of level curves, which are the same as contour lines in geographical maps.
A level curve of z = f (x, y) is the set of points (x, y) in the xy-plane that
satisfies f (x, y) = k for some constant k.
Note here that while the surface z = f (x, y) lies in 3-dimensional space and
is usually difficult to draw, each level curve of this surface lies in the standard
xy-plane and so is often easy to draw.
Consider the surface z = x2 + y 2 . Its level curves are the points (x, y)
such that x2 + y 2 =√
k. Now for k > 0 this is simply a circle with centre
(0, 0) and of radius k. Level curves:
Try to visualize the surface z = f (x, y) by lifting each level curve to its
corresponding height k:
Functions of several variables
Consider the surface z = x2 + 2y 2 . Its level curves are the points (x, y)
such that x2 + 2y 2 = k. For each k > 0 the level curves in this case is
given by an ellipse:
The actual surface z = x2 + 2y 2 is obtained by lifting each level curve
to its height k:
Finally, to take a complicated example, consider the level curves:
What does the corresponding surface look like? In fact this is the surface
we saw on page 4 (a few of the level curves were already drawn in that
figure).
5
6
Functions of several variables
Inside each closed level curve, there is a maximum or a minimum. Where
two level curves cross there is neither a maximum nor a minimum, but a “saddle
point”.
Exercises
a. In three dimensions, sketch the graphs of the functions
1. z = 3
(b) z = −3
(c) x = 1
(e) y = x
(f) y = 2x
(g) z = x
(d) y = −1
b. By first plotting the points where each plane intersects the coordinate
axes, sketch in three dimensions the graphs of the functions
(a) z = 1 − x − y
(b) z = 2 − x + y
(c) x + y = 3
p
c. Plot some level curves of the surface z = x2 + y 2 . Hence sketch the
2
surface. Can you see how it differs from the surface z = x2 + y√
of
Example 1? Hint: what does the function of one variable graph y = x2
look like?
Chapter 2
Partial derivatives
Definition
Even without graphing the function z = f (x, y), one can still deduce extremely
important properties of the surface by making use of calculus. If you recall from
your earlier courses and leaving certificate mathematics courses there is a lot of
information that we can deduce from a function by using calculus, for example,
calculating the slope, points of inflection, whether the graph is increasing or
decreasing, etc. In this course we again follow similar trains of exploration
however in our case we have more than one variable. We begin this study in
this section.
Given a function z = f (x, y), the partial derivative of f with respect to x,
written fx or ∂f
∂x , is obtained by differentiating f (x, y) with respect to x while
treating y as a constant. Similarly, fy or ∂f
∂y is obtained by differentiating f (x, y)
with respect to y while treating x as a constant.
Take the function
z = f (x, y) = x3 + x2 y 3 − 2y 2 + exy .
Find fx (2, 1) and
∂f
(2, 1).
∂y
In order to do this, you must first calculate
fx (x, y) = 3x2 + 2xy 3 + yexy ,
fy (x, y) = 3x2 y 2 − 4y + xexy
and then plug in (x, y) = (2, 1).
7
8
Partial derivatives
Geometric interpretation of partial derivatives
For y = f (x), the derivative dy/dx is the slope of the tangent line to the curve
y = f (x). For z = f (x, y), the partial derivative ∂f
∂x is the slope of the tangent
line to the surface z = f (x, y) in the x-direction.
We see ∂f
∂x at the point (x0 , y0 ):
In computing ∂f
∂x one keeps y constant, so in the diagram all the action takes
place in the plane y = y0 , which is perpendicular to the y-axis (i.e., parallel
to the xz-plane). The intersection of this plane with the surface z = f (x, y) is
a curve (see the figure). Technically this curve is defined by z = f (x, y0 ), i.e.,
along the curve z is a function of a single variable x. Thus we find the slope of
the tangent to this curve in the standard 1-dimensional way, by differentiating
with respect to x. That is, fx (x0 , y0 ) is the slope of the line tangent to the
curve.
In this diagram the line is falling as x increases (i.e., as x moves from right
to left) so the slope of the line is negative. That is, fx (x0 , y0 ) < 0.
Similarly, fy (x0 , y0 ) gives the slope of the line that is tangent to the curve
where the surface z = f (x, y) intersects the plane x = x0 :
In this diagram the line appears to be horizontal as y increases (i.e., as y
moves from left to right) so the slope of the line is zero. That is, fy (x0 , y0 ) = 0.
At the webpage
http://www.math.umn.edu/∼rogness/multivar/partialderivs.shtml
9
Geometric interpretation of partial derivatives
you’ll find a nice interactive discussion of the geometric interpretation of partial
derivatives: at a point on a surface, two lines are drawn whose slopes are the
partial derivatives with respect to x and y. With the mouse you can drag this
point around on the surface and see how this changes the slopes of the two lines
(i.e., the values of the partial derivatives). Can you predict what positions the
lines will take when you drag the point to the flat part of the surface?
Analogously to functions of one variable, one can also interpret partial
derivatives as rates of change: ∂f
∂x is the rate of change of f with respect to x
when y is fixed, and ∂f
is
the
rate
of change of f with respect to y when x is
∂y
fixed.
Recall that for the function of one variable y = loge x = ln x (where
x > 0), one has dy/dx = 1/x. Hence for example we have
d(ln 2x)
1 d(2x)
1
1
=
·
=
·2= .
dx
2x
dx
2x
x
Take the function
z = f (x, y) = ln
x
1+y
.
Let’s find fx and fy . We could differentiate this immediately using the
chain rule for functions of one variable followed by the quotient rule:
x
∂z
1 ∂
1 + y (1 + y)(1) − (x)(0)
1+y 1+y
1
= x
=
=
= ,
2
2
∂x
∂x
1
+
y
x
(1
+
y)
x
(1
+
y)
x
1+y
but it’s easier to apply first a standard property of the ln function before
differentiating:
x
z = ln
= ln x − ln(1 + y)
1+y
so
∂z
1
1
= −0=
∂x
x
x
because 1 + y is a constant when we are differentiating with respect to
x.
Similarly, differentiating z = ln x − ln(1 + y) yields
∂z
1
−1
=0−
(1) =
.
∂y
1+y
1+y
For functions of three or more variables, partial derivatives are computed
with respect to an independent variable by holding all other variables constant.
10
Partial derivatives
Exercises
a. f (x, y, z) = exy ln z, find fx , fy and fz by using the chain rule.
b. f (x, y) = x3 y 5 , find fx (3, −1).
c. f (x, y) = xe−y + 3y, find
d. z = sin(y − x), find
e. z =
Ans: −27
∂f
∂y (1, 0).
∂z
∂x (3, 3)
Ans: −1
x3 + y 3
, find zy
x2 + y 2
Ans:
y
√
f. z = x y − √ , find zx
x
g. z = ln(x2 + y 2 ), find
3x2 y 2 − 2x3 y + y 4
(x2 + y 2 )2
Ans:
∂z
∂x
p
∂z
25 − x2 − y 2 , find ∂x
and
−y
−x
p
, p
25 − x2 − y 2
25 − x2 − y 2
h. z =
Ans: 2
√
y
y+ √
2 x3
Ans:
∂z
∂y
2x
x2 + y 2
Ans:
i. The temperature at a point (x, y) is given by T (x, y) = 60/(1 + x2 + y 2 ).
Find the rate of change of temperature with respect to distance at the
point (2,1) in (a) the x-direction (b) the y-direction.
Ans: (a) −20/3
(b) −10/3.
The tangent plane
Recall that for y = f (x), the slope of the tangent line is f 0 (x) and this information enables one to compute the equation of the tangent line: y − y0 =
f 0 (x0 ) (x − x0 ). Correspondingly, for any surface z = f (x, y), at each point one
has a unique tangent plane. The tangent plane is the plane that passes through
both tangent lines. Equivalently, it is the plane that just touches the surface
z = f (x, y) at the point (x0 , y0 , z0 ), where z0 = f (x0 , y0 ). See the tangent plane
y2
x2
+
at the point (x0 , y0 ) = (−4, 3):
to the surface z = 3 +
16
9
11
Differentials
Given z = f (x, y) and a point (x0 , y0 ), we can compute z0 = f (x0 , y0 ),
∂z
(x0 , y0 ) and ∂y
(x0 , y0 ). The equation of the tangent plane to z = f (x, y) at
the point (x0 , y0 , z0 ) is
∂z
∂z
z − z0 =
(x0 , y0 ) (x − x0 ) +
(x0 , y0 ) (y − y0 ) .
∂x
∂y
∂z
∂x
Know this formula.
∂z
∂z
Observe here that z0 , ∂x
(x0 , y0 ) and ∂y
(x0 , y0 ) are numbers; the only
variables in this formula are z on the left-hand side and x, y on the right-hand
side.
Exercises
a. Find the equation of the tangent plane to the surface z = 2x2 + y 2 at the
point x = 1, y = 1.
b. Find the equation of the tangent plane to the given surface at the specified
point:
1. z = x2 + 4y 2 , (2, 1, 8)
Ans: 4x + 8y − z = 8
2
2
2. z = 5 + (x − 1) + (y + 2) , (2, 0, 10)
Ans: 2x + 4y − z + 6 = 0
Ans: 2x + y − z = 1
3. z = ln(2x + y), (−1, 3, 0)
2
4. w = xy + 3y , (−2, 3, 21)
Ans: w = 3x + 16y − 21
5. z = cos(x − y), (π/2, 0, 0)
Ans: x − y + z = π/2
6. z = y cos(x − y), (2, 2, 2)
p
7. z = 4 − x2 − 2y 2 , (1, −1, 1)
Ans: z = y
Ans: x − 2y + z = 4
c. (MS3003 Autumn 2008 exam) Find the equation of the tangent plane to
the surface z = 4x2 − y 2 + 2y at the point (−1, 2, 4). Ans: z = −8x − 2y
Differentials
Let’s start with the function of one variable y = f (x). The derivative of this
function is
f (x + ∆x) − f (x)
f 0 (x) = lim
.
∆x→0
∆x
The definition of “limit” means that when ∆x is close to zero, we have
f 0 (x) ≈
f (x + ∆x) − f (x)
.
∆x
Rearranging this approximate equation, one gets
f (x + ∆x) ≈ f (x) + f 0 (x) · ∆x.
(2.1)
Thus if we know the values of f (x) and f 0 (x), then using (2.1) we can easily
compute the approximate value of f at the nearby point x + ∆x.
12
Partial derivatives
√
√
Let’s use
√ (2.1) and 9 = 3 to approximate √10. Here the key fact
is that 9 = 3, i.e., for the function f (x) = x and x = 9 we have
f (9) = 3. Now
1
f 0 (x) = x−1/2
2
so
1 1
1
1 1
f 0 (9) = · √ = · = .
2
2
3
6
9
√
We want 10 = f (10). Hence x + ∆x = 10, i.e., ∆x = 1 because from
above x = 9. From (2.1) we now get
√
10 = f (10) ≈ f (9) + f 0 (9) · (1) = 3 +
1
1
· (1) = 3 = 3.16666
6
6
√
A calculator will give 10 = 3.1623 (to 4 decimal places) so our approximation was fairly good.
Equation (2.1) computes (approximately) the change in the dependent variable y = f (x) when the independent variable x changes by ∆x. This change in
y is written ∆y, so ∆y = f (x + ∆x) − f (x), and (2.1) then becomes
∆y = f (x + ∆x) − f (x) ≈ f 0 (x) · ∆x.
This gives (approximately) the change ∆y in y as a result of a small change
∆x in x. The quantities ∆x and ∆y are called differentials.
Consider now a function of two variables z = f (x, y). We want to compute
(approximately) the change ∆z in the dependent variable z when the independent variable x changes by ∆x and the independent variable y changes by ∆y;
here ∆x and ∆y are both small.
∂z
Recall that ∂x
is computed using the rules for differentiating a function of one
variable, with y held constant. Thus it follows from our discussion of functions
of one variable above that a change ∆x in x will induce (approximately) a
change
∂z
∆x
∂x
in z. Similarly, a change ∆y in y will induce (approximately) a change
∂z
∆y
∂y
in z. Consequently the total change in z that will be caused by a small change
∆x in x and a small change ∆y in y is
∆z ≈
∂z
∂z
∆x +
∆y.
∂x
∂y
(2.2)
13
The chain rule
This approximation by differentials of the change in a dependent variable is
used frequently in various applications to Economics that we shall discuss later
in this module. When we are asked to “estimate the change in . . . ”, then
usually we shall use (2.2) or some variant of it.
Exercises
a. Let z = x3 y−y 3 x. Use differentials to find approximately the total change
in z when x increases from 1 to 1.1 and simultaneously y decreases from
3 to 2.8.
When differentials are used to compute approximately the change in z
induced by changes in x and y, we are in fact approximating the surface z =
f (x, y) by its tangent plane at the point (x, y) and computing the exact change
in z on this tangent plane that is induced by the changes in x and y. This
approximates the change in the surface z = f (x, y) because near the point (x, y)
the tangent plane is a good approximation of the surface.
Exercises
a. Let z = 7x4 y − 2x4 y 2 . Find the first-order partial derivatives of z and
evaluate these derivatives when x = 4 and y = 2. Hence estimate the
change in z that is associated with an increase in x to 4.001 and a decrease
∂z
∂z
in y to 1.999.
Ans: At x = 4, y = 2, get ∂x
= 1536, ∂y
= −256,
∆z ≈ 1.792.
b. Given the sales function S = (15000 − 1000P )A2/3 r1/4 where P is price,
A is spending on advertising, and r is the number of sales representatives,
use differentials to estimate the change in sales from
1. hiring an extra sales representative
2. a e1 increase in advertising
3. a e0.01 reduction in price
when P = 4, A = e6000 and r = 24.
Ans: 83742, 304.52, 182.33.
The chain rule
For functions of a single variable, the chain rule is: if y = f (x) and x = g(t),
then y = f (g(t)) and
dy
dy dx
=
.
dt
dx dt
For functions of more than one variable, the chain rule can take various forms,
as we shall see in the examples that follow. The idea is to sum up over all
possible dependencies of variables on one another.
14
Partial derivatives
Exercises
a. Suppose that
Thus z =
z = f (x, y), where x = g(t) and y = h(t).
∂z ∂z dg
f g(t), h(t) , i.e., z depends on t. Express dz
in
terms
of
,
dt
∂x ∂y , dt and
dy
dt .
(Recall that the ∂-notation is used for functions of two or more
variables while the d-notation is used only for functions of one variable.)
2
4
t
Use your formula to find dz
dt if z = x y + 3xy , x = e and y = sin t.
The chain rule formula for dz
dt : take the product of derivatives along each
possible chain of variable dependencies from z to t, then add these products:
dz
∂f dx ∂f dy
=
+
.
dt
∂x dt
∂y dt
Exercises
a. Suppose that z = ex sin y, where x = st2 and y = s2 t. (Thus z depends
ultimately on s and t.) Find ∂z
∂s .
b. Suppose that u = x4 y + y 2 z 3 , where x = rs, y = s2 and z = r2 s sin t.
∂u
Find ∂u
∂s and ∂t when r = 2, s = 1 and t = 0.
dz
dt .
c. z = x2 + y 2 , x = t3 , y = 1 + t2 , find
d. z = ln(x + y 2 ), x =
√
1 + t, y = 1 +
√
t, find
Ans: 6t5 + 4t3 + 4t.
dz
dt .
1
Ans:
x + y2
y
1
√
+√
2 1+t
t
.
e. w = xy 2 z 3 , x = sin t, y = cos t, z = 1 + e2t , find dw
dt .
Ans: y 2 z 3 cos t − 2xyz 3 sin t + 6xy 2 z 2 e2t .
f. z = x2 sin y, x = s2 + t2 , y = 2st, find
∂z
∂s
and
∂z
∂t .
Ans: 4sx sin y + 2tx2 cos y, 4tx sin y + 2sx2 cos y.
g. If z = x2 + xy, x = st + t2 and y = t3 − 1, use the chain rule to find
and ∂z
∂t when s = 2 and t = −1.
∂z
∂s
h. The radius of a cylinder is decreasing at a rate of 1.2 cm/sec while its
height is increasing at a rate of 3 cm/sec. At what rate is the volume of
the cylinder changing when the radius is 80 cm and the height is 150 cm?
Ans: −9600π cm3 /sec.
i. Sand is pouring onto a conical pile in such a way that at a certain instant
the height is 100 cm and increasing at 3 cm per minute while the base
radius is 40 cm and increasing at 2 cm per minute. How fast is the volume
increasing at that instant?
Ans: (20800π/3) cm3 /min
15
Higher-order derivatives
j. The pressure P (in kilopascals, i.e. kPa), volume V (in litres) and temperature T (in degrees kelvin) of a gas are related by the equation P V = 8.31T .
Find the rate at which the pressure is changing when the temperature is
300 K and increasing at a rate of 0.1 K/sec and the volume is 100 L and
increasing at a rate of 0.2 L/sec.
Ans: −0.04155 kP a/sec
k. Wheat production W in a given year depends on the average temperature
T and the annual rainfall R. It is estimated that the average temperature
is rising at a rate of 0.15◦ C per year and rainfall is decreasing at a rate
of 0.1 cm per year. They also estimate that at current production levels
∂W
∂W
∂T = −2 and ∂R = 8.
1. What is the significance of the signs of these partial derivatives?
2. Estimate the current rate of change of wheat production dW
dt .
Ans: decreasing at 1.1 units/year
l. (MS3003 Autumn 2008 exam) If z = f (x, y) where x = s + t and y = s − t,
show that
2 2
∂z
∂z
∂z ∂z
−
=
.
∂x
∂y
∂s ∂t
m. Suppose z = f (x, y) with x = r cos θ, y = r sin θ. Find ∂z
∂r and
show that
2 2 2
2
∂z
∂z
1 ∂z
∂z
+
=
+ 2
.
∂x
∂y
∂r
r
∂θ
∂z
∂θ
and
Higher-order derivatives
For y = f (x), recall that
d2 y
dx2
means
d dy
;
dx dx
it can also be written as (f 0 )0 (x), i.e., f 00 (x). Similarly, given z = f (x, y), if we
first compute ∂f
∂x , then we can differentiate this new function:
∂ ∂f
∂2f
=
= (fx )x = fxx ,
∂x ∂x
∂x2
∂2f
∂ ∂f
=
= (fx )y = fxy .
∂y ∂x
∂y ∂x
2
∂ f
Note that ∂y
∂x and fxy have the same meaning even though x and y appear
in different orders!
Similarly,
∂ ∂f
∂2f
=
= (fy )y = fyy ,
∂y ∂y
∂y 2
∂ ∂f
∂2f
=
= (fy )x = fyx .
∂x ∂y
∂x ∂y
16
Partial derivatives
Exercises
a. Find all second-order partial derivatives of
z = x3 + x2 y 3 − 2y 2 .
In this example it turns out that zxy = zyx . This is usually true; only for
certain exceptional functions is it false. (In this module it will be true for
all functions that we meet.)
b. Verify that z = e−4y sin x satisfies the equation
∂z
∂2z
− 4 2 = 0.
∂y
∂x
c. Find all second-order partial derivatives if
√
(i) z = x2 y + x y
1
x
Ans: zxx = 2y, zxy = 2x + √ , zyy = − √ 3
2 y
4 y
(ii) z = (x2 + y 2 )3/2
Ans: zxy =
(x2
3xy
,
+ y 2 )1/2
zyy = 3(x2 + y 2 )1/2 +
zxx = 3(x2 + y 2 )1/2 +
(x2
3x2
,
+ y 2 )1/2
3y 2
(x2 + y 2 )1/2
d. (Autumn 2008 MS3003 exam) Find all first-order and second-order partial
derivatives of z = sin(xy).
Ans: zx = y cos xy, zy = x cos xy, zxy = cos xy − xy sin xy,
zyy = −x2 sin xy, zxx = −y 2 sin xy
e. (Spring 2011 MA3301 exam) Find all the first-order and second-order
derivatives of the function
f (x, y) = xexy + 11y.
Ans: fx = (1 + xy)exy , fy = x2 exy , fxx = (2y + xy 2 )exy , fxy = (2x +
x2 y)exy ,
fyy = x3 exy .
2
2
∂ z
∂ z
f. Verify that ∂y
if
∂x = ∂x ∂y
√
(i) z = x y + ln(xy)
(ii) z = sin(2 + x2 y)
g. Verify that z = (x2 + y 2 )−1/2 satisfies the equation
∂2z
∂2z
+ 2 = (x2 + y 2 )−3/2 .
2
∂x
∂y
h. Verify that z = ln(x2 + y 2 ) and z = e−x cos y − e−y cos x both satisfy the
equation zxx + zyy = 0.
Chapter 3
Partial derivatives in economics
In this chapter we shall examine elasticity, production and utility.
Elasticity
Suppose that the demand Q for a good depends on its price P , the price PA of
an alternative good and the income Y of customers, i.e., Q = Q (P, PA , Y ).
First consider how the demand Q varies when P changes while PA and Y
do not vary [think. . . this is something to do with ∂Q
∂P ]. Two initial observations:
a. As P increases we expect Q to decrease, so we assume that
∂Q
∂P
< 0.
b. The effect of an increase in P by say 1 unit depends on the size of P ; e.g.,
increasing the price of a car by e 1 has no effect on demand but increasing
the price of a bar of chocolate by e 1 has a large effect. Thus instead of
considering the change ∆P in P we consider the percentage change in P ,
viz.,
∆P
.
100
P
Similarly it makes sense to consider the percentage change
100
∆Q
Q
in Q.
The own price elasticity of demand is
EP = −
100 ∆Q
percentage change in Q
∆Q P
∂Q P
Q
=−
=−
≈−
.
∆P
percentage change in P
∆P Q
∂P Q
100 P
One typically has EP > 0 (this is why the minus sign is included in the
formula). It is a measure of how sensitive— in percentage terms—the quantity
demanded is to changes in the price of the good.
Similarly, the income elasticity of demand is
EY =
∂Q Y
.
∂Y Q
∂Q
When EY > 0, i.e., increasing income Y increases demand Q so ∂Y
> 0, we
say the good is superior. But EY < 0 means that the good is inferior, i.e.,
17
18
Partial derivatives in economics
increased income Y leads consumers to switch to a better-quality alternative
good.
Similarly, the cross-price elasticity of demand is
EPA =
∂Q PA
.
∂PA Q
If EPA > 0 then we say that PA is a substitute good: when the price PA of
the alternative good goes up, demand for our good increases. For example,
consumers might switch from one brand of coffee to another when prices of
the first brand go up. If EPA < 0 then we say that PA is a complementary
good: when the price PA goes up, demand for our good decreases. For example,
suppose our good is DVDs and PA is the price of DVD players; if PA increases
then fewer DVD players will be sold, which means that fewer people will buy
our DVDs, i.e., demand for our good decreases.
Exercises
a. Given the demand function Q = 100 − 2P + PA + 0.1Y , find the partial
elasticities of demand at P = 10, PA = 12 and Y = 1000.
Elasticity in terms of the ln function
A straightforward partial derivative shows how one quantity depends on another:
∂z
if z = f (x, y), then ∂x
measures how z changes as x varies (with y held fixed).
But if we want to see the percentage change in z expressed in terms of the
percentage change in x, then (recall the derivation of EP ) this is given by the
elasticity
∂z x
∂ ln z
, which is often written as
,
∂x z
∂ ln x
the elasticity of z with respect to x, or the x-elasticity of z.
Exercises
a. Given the demand function Q = 150 − 5P1 + 15P2 + 0.2Y , where P1 =
5, P2 = 10 and Y = 800, calculate the own price elasticity of demand,
cross-price elasticity of demand, and the income elasticity of demand. Is
the good inferior or superior? Is the alternative good substitutable or
complementary?
Ans: 0.057, 0.34, 0.37, superior, substitutable.
b. Given the demand function Q = 500 − 3P − 2PA + 0.01Y , when P =
20, Pa = 30 and Y = 5000 find the own price elasticity of demand, crossprice elasticity of demand, and the income elasticity of demand. If income
rises by 5%, calculate the corresponding percentage change in demand.
Is the good inferior or superior? Is the alternative good substitutable or
complementary?
19
Partial derivatives in economics
Ans: (to 4 decimal places) EP = 0.1395, EPA = −0.1395, EY = 0.1163,
% change 0.5815, superior, complementary.
c. The demand functions for products A and B are functions of their prices
given by
√
50 3 PB
QA = √
PA
and
75PA
QB = p
.
3
PB2
Find the four price elasticities and determine whether the products are
complementary or substitutable.
−3/2 1/3 ∂QA
−1/2 −2/3
A
Ans: ∂Q
PB , ∂PB = 50
PB ,
∂PA = −25PA
3 PA
∂QB
∂PA
−2/3
= 75PB
,
∂QB
∂PB
−5/3
= −50PA PB
, substitutable.
d. Use the ln function formulation of elasticity to show the following: if
z = f (x, y), then the elasticity of z with respect to x is constant for all
x if and only if z = g(y)xk for some constant k and some function g(y)
with g(y) > 0. Note: this short theoretical exercise relies on standard
properties of the ln and exponential functions.
Production
Assume that output Q depends on capital K and labour L, so Q = Q(K, L).
Then we define
∂Q
∂K
∂Q
.
marginal product of labour: M PL .=
.
∂L
marginal product of capital: M PK ..=
The level curves of Q are called isoquants. These are curves in the (K, L)
plane along each of which Q is constant.
20
Partial derivatives in economics
Here the L axis is horizontal, the K axis is vertical, and isoquants are drawn
for Q = 100, 150 and 200. Three isoquants are drawn for the production
function Q = KL. The shapes of these curves are typical of many isoquants:
as capital K is reduced on any of the curves, in order to maintain production
at the same level Q (i.e., to remain on the isoquant) one must increase the
labour component L. Looking at this more closely, we observe that as K gets
small, a small decrease in K requires a large increase in L in order to stay on
the isoquant. This trade-off between capital and labour is quantified by the
marginal rate of technical substitution, which we shall define in a moment.
Consider a particular isoquant. On it one has K = K(L), e.g., the lowest
isoquant is 100 = Q = KL which gives K = 100/L on that isoquant. Thus it
makes sense to write dK/dL for the slope of our isoquant. The marginal rate
of technical substitution on this isoquant is
MRTS ..= −
dK
,
dL
(3.1)
which measures the slope of the isoquant (the minus sign is present to ensure
that MRTS > 0 as the isoquant is a decreasing function so its slope is negative).
We now derive a more practical formula for MRTS. As we just saw, when
moving along an isoquant one has K = K(L). Hence along the isoquant
∂Q dK
∂Q
dQ
=
+
.
dL
∂K dL
∂L
But Q is constant along the isoquant so dQ/dL = 0, i.e.,
0=
∂Q dK
∂Q
+
∂K dL
∂L
21
Partial derivatives in economics
which is easily rearranged to get
MRTS = −
dK
QL
M PL
=
=
,
dL
QK
M PK
(3.2)
∂Q
..
where QL ..= ∂Q
∂L and QK = ∂K , i.e., along each isoquant the marginal rate
of technical substitution equals the marginal product of labour divided by the
marginal product of capital.
Exercises
√
a. Evaluate M PK and M PL for the production function Q = 2LK + L,
given that the current values of K and L are 7 and 4 respectively. Hence
(a) Compute the value of MRTS.
(b) Use the value of MRTS to estimate the increase in capital needed to
maintain the current level of output if there is a 1-unit decrease in
labour.
We find an expression for MRTS for the Cobb–Douglas production function
Q = AK α Lβ
where A, α and β are positive constants. Taking partial derivatives, we
have
M PK =
∂Q
= αAK α−1 Lβ
∂K
Thus
MRTS =
and
M PL =
∂Q
= βAK α Lβ−1 .
∂L
βAK α Lβ−1
βK
M PL
=
=
.
M PK
αAK α−1 Lβ
αL
In production, the following question is of particular interest: what is the
effect on output if all inputs are scaled in the same way? For example, if we
double capital and double labour, what happens to output?
Consider the Cobb–Douglas production function Q(K, L) = AK α Lβ and
suppose that capital and labour are scaled by a factor λ > 0, i.e., K is replaced
by λK and L is replaced by λL. Then the output becomes
Q(λK, λL) = A(λK)α (λL)β = AK α Lβ λα+β = λα+β Q(K, L).
(3.3)
Any function f (K, L) is said to be homogeneous of degree n if f (λK, λL) =
λn f (K, L). Thus (3.3) shows that Cobb-Douglas production is homogenous of
degree α + β. If
(i) α + β = 1 we have constant returns to scale,
(ii) α + β > 1 we have increasing returns to scale,
(iii) α + β < 1 we have decreasing returns to scale.
22
Partial derivatives in economics
Exercises
a. (MA3301 Spring 2010 exam) The production function of a company is
given by
Q(K, L) = 3K 2 + 7L,
where Q is the number of units produced, K is the amount of capital
needed and L is the number of labour hours used. Suppose that K = 250
and L = 40.
1. Determine the values of the marginal products of capital and labour.
2. Estimate the change in output if K increases by 1 unit.
3. Estimate the increase in K required to maintain current output levels
if L decreases by 5 units.
Ans:
b. (MA3301 Spring 2011 exam) The production function of a company is
given by
Y (K, L) = 10K 0.4 L0.3 ,
where Y is the number of units produced, K is the amount of capital used
and L is the number of labour hours used. Let K = 100 and L = 20.
1. Determine the marginal products of capital and labour.
2. Estimate the change in output when K increases by 1 unit and L
decreases by 2 units.
3. Determine the elasticity of production with respect to capital and
labour.
4. Estimate the % change in output when K increases by 5% and L
decreases by 10%.
Ans:
c. Given the production function Q = K 2 + 2L2 , write down expressions for
the marginal products of capital and labour. Hence show that
MRTS =
2L
K
and K
∂Q
∂Q
+L
= 2Q.
∂K
∂L
Utility
To analyse quantitatively the behaviour of customers, we associate with each
set of options a number U , the utility—that indicates the level of satisfaction.
Suppose that there are two goods G1 and G2 and the consumer buys x1
and x2 units respectively of these two goods. Then U is a function of x1 and
x2 , i.e., U = U (x1 , x2 ). The marginal utility of the good Gi is defined to be
∂U
∂xi , for i = 1, 2.
23
Partial derivatives in economics
If x1 changes by a small amount ∆x1 , then the change in U is
∆U ≈
∂U
∆x1
∂x1
and similarly for x2 . If both x1 and x2 change, then
∂U
∂U
∆x1 +
∆x2 .
∂x1
∂x2
∆U ≈
This equation is just (2.2) written in different notation.
Exercises
1/2 3/4
a. Suppose that a utility function is given by U (x1 , x2 ) = x1 x2 . Determine the marginal utilities when x1 = 100 and x2 = 200. Hence estimate
the change in U when x1 decreases from 100 to 99 and x2 increases from
200 to 201.
In this example, one can show [exercise!] that
∂2U
3 −7/4 3/4
= − x1 x2
∂x21
16
and
∂2U
3 1/4 −5/4
= − x1 x2 .
∂x22
16
2
∂U
These are both negative. Now ∂∂xU2 < 0 implies that the marginal utility ∂x
is a
1
1
decreasing function. That is, as the consumption of the good G1 increases, each
additional item of G1 that is bought confers less utility than the previous item.
Similarly for G2 . This property, which holds true for many utility functions, is
known as the law of diminishing marginal utility.
The level curves of U are called indifference curves. These are curves in
the (x1 , x2 ) plane along each of which U is constant. This is exactly the
same mathematical situation as the isoquants of Section 3; only the English
terminology is different. Thus the graphs in of isoquants could be considered
indifference curves, with the x1 axis horizontal and the x2 axis vertical.
The marginal rate of commodity substitution on any particular indifference
curve is defined to be
MRCS ..= −
dx2
dx1
on that indifference curve.
This is the same as (3.1); only the letters used are different. Hence one can
show, in exactly the same way as (3.2) was derived, that
MRCS =
where Ux1 ..=
∂U
∂x1
and Ux2 ..=
∂U
∂x2 .
Ux1
Ux2
(3.4)
24
Partial derivatives in economics
Exercises
1/2 1/2
a. Given the utility function U (x1 , x2 ) = x1 x2 , find a general formula
for MRCS in terms of x1 and x2 . Calculate the particular value of MRCS
for the indifference curve that passes through the point (300, 500). Hence
estimate the increase in x2 needed to maintain the current level of U when
x1 decreases by 3 units.
b. Prove the formula (3.4) by imitating the derivation of (3.2).
1/2 1/3
c. Given the utility function U (x1 , x2 ) = x1 x2 , determine the value of
the marginal utilities when x1 = 25 and x2 = 8. Hence estimate the
change in utility when x1 and x2 both increase by one unit, and find the
marginal rate of commodity substitution at this point.
Ans:
0.2, 0.4166; 0.6166, 0.48
d. An individual’s utility function is U (x1 , x2 ) = 1000x1 + 450x2 + 5x1 x2 −
2x21 − x22 , where x1 is the amount of leisure measured in hours per week
and x2 is earned income measured in Euro per week. Determine the value
of the marginal utilities when x1 = 138 and x2 = 500. Hence estimate
the change in U if the individual works for an extra hour which increases
earned income by 15 Euro per week. Does the law of diminishing marginal
utility hold for this function U ? Calculate the value of the marginal rate
of commodity substitution when x1 = 138 and x2 = 500. Hence estimate
the increase in earned income required to maintain the current level of
utility if leisure falls by two hours per week.
Ans: 2948, 140; −848, yes, 21.057, 42.114
e. (MA3301 Spring 2011 exam) An individual’s utility function is given by
U (x1 , x2 ) = x21 + 10x22 − x1 x2 , where x1 is the number of cups of tea
drunk per week and x2 is the number of bottles of beer drunk per week.
Let x1 = 30 and x2 = 4.
1. Find the marginal utilities with respect to tea and beer.
2. Estimate the change in utility if x1 increases by 4 items per week
and x2 decreases by 1 item per week.
3. Derive the formula for the elasticity of substitution Rx2 x1 [This is
another name for the MRCS described above in the Notes; the exam
question is asking you to derive equation (3.4)]
4. Estimate the increase in tea drinking required to maintain the same
level of utility if beer drinking were reduced by 1 bottle per week.
Ans: (a) 56, 50, (b) 174, (d) 25/28.
Chapter 4
Optimisation
Maximum and minimum values for functions of two variables
In this section we show to use partial derivatives to examine a function z =
f (x, y) in order to determine the locations of maxima and minima (if there are
any) of z. A search for such points is often called optimisation of z.
A global maximum of f (x, y) is a point (x0 , y0 ) so that f (x0 , y0 ) ≥ f (x, y)
for all points (x, y) for which f (x, y) is defined. A local maximum of f (x, y) is
a point (x0 , y0 ) so that f (x0 , y0 ) ≥ f (x, y) for all points (x, y) near enough to
(x0 , y0 ) at which f (x, y) is defined.
A global minimum of f (x, y) is a point (x0 , y0 ) so that f (x0 , y0 ) ≤ f (x, y)
for all points (x, y) for which f (x, y) is defined. A local minimum of f (x, y) is
a point (x0 , y0 ) so that f (x0 , y0 ) ≤ f (x, y) for all points (x, y) near enough to
(x0 , y0 ) at which f (x, y) is defined.
Consider:
From the graph of the surface (or from the level curves, if they were
labelled) we can see that this function has three local maxima, one of
which is the only absolute maximum, and two local minima.
An extremum is a maximum or minimum. To help find local extrema we
use the following theorem, which is analogous to the corresponding result for
functions of one variable. A point (x0 , y0 ) where f (x0 , y0 ) is defined is a critical
point of f if
a. the point (x0 , y0 ) lies on the boundary of the points (x, y) where f (x, y)
is defined or
b. the partial derivatives fx and fy don’t exist at (x, y) = (x0 , y0 ) or
25
26
Optimisation
c. 0 = fx = fy at (x0 , y0 ).
Theorem 4.1. Local extrema of any function f (x, y), if they occur at all, can
only occur at critical points.
Theorem 4.1 says that to find extrema, one need consider only critical points.
As we shall see, a critical point might not be an extremum, or even a local
extremum, so after finding the critical points we then need to test each one
to determine if it gives a local extremum. (This is analogous to functions of
one variable, where putting dy/dx = 0 can give an extremum or a point of
inflection.)
Exercises
a. Find all extrema of the function
f (x, y) = x2 + y 2 − 2x − 6y + 14.
b. Find all extrema of the function
f (x, y) = y 2 − x2 .
A function g(x, y) is continuous in a region of the (x, y)-plane if its graph
z = g(x, y) has no gaps or tears there. (In practice, although we’ll mention
this condition in the next theorem, we won’t verify if it holds true, since all
functions appearing in these Notes are continuous.)
The ad hoc approach used to analyse critical points in our previous examples
cannot be used in most examples. Instead we shall use the following result,
which is an analogue of the related test used for functions of one variable.
Know the next theorem precisely.
Theorem 4.2. [Second Derivative Test for critical points] Take a critical point
(x0 , y0 ) of a function f (x, y). Assume that fxx , fyy and fxy are continuous
near (x0 , y0 ). Set
2 ∆ = fxx fyy − fxy
.
(x,y)=(x ,y )
0
0
a. If ∆ > 0 and fxx (x0 , y0 ) > 0, then f has a local minimum at (x0 , y0 ).
b. If ∆ > 0 and fxx (x0 , y0 ) < 0, then f has a local maximum at (x0 , y0 ).
c. If ∆ < 0, then f has a saddle point at (x0 , y0 ).
d. If ∆ = 0, then the test gives no information.
27
Applications to economics
Exercises
a. Find the local extrema of the function
f (x, y) = x4 + y 4 − 4xy + 1.
b. Find the local extrema and saddle points of f .
1. f (x, y) = x2 + y 2 + 4x − 6y.
2
Ans: minimum at (−2, 3, −13).
2
2. f (x, y) = 2x + y + 2xy + 2x + 2y. Ans: minimum at (0, −1, −1).
3. f (x, y) = 6x2 − 9x − 3xy − 7y + 5y 2 .
2
2
Ans: minimum at (1, 1, −8).
2
4. f (x, y) = x + y + x y + 4.
√
Ans: minimum at (0, 0, 4), saddle points at (± 2, −1, 5).
5. f (x, y) = x3 − 3x + xy 2 . Ans: minimum
at (1, 0, −2), maximum at
√
(−1, 0, 2), saddle points at (0, ± 3, 0).
x2 y 2 − 8x + y
, where x 6= 0 and y 6= 0.
xy
(− 21 , 4, −6).
6. f (x, y) =
7. f (x, y) = ex cos y.
Ans: max at
Ans: none.
8. (MS3003 Autumn 2008 examination) f (x, y) = x + y + x2 y + xy 2
Ans: saddle points at (1, −1, 0) and (−1, 1, 0)
c. (MA3301 Autumn 2011 examination) Find and classify the stationary
points of
f (x, y) = x3 + y 3 − 6xy.
[Note: “stationary point” is another name for “critical point”]
Ans: saddle point at (0, 0), minimum at (2, 2).
d. Let w = f (x, y) be a function of two variables. Give a detailed statement
of a test that can determine the nature of the critical points of f. Use this
test to examine the critical points of the function
f (x, y) = x3 + 2y 3 − 3x2 − 24y + 16.
Ans: minimum at (2, 2, −20), maximum at (0, −2, 48), saddle points at
(0, 2, −16) and (2, −2, 44).
Applications to economics
Exercises
a. A producer sells two goods G1 and G2 at e1,000 and e800 each respectively. The total cost of producing the goods is given by T C =
2Q21 + 2Q1 Q2 + Q22 where Q1 and Q2 denote the output levels of G1 and
G2 . Find the maximum possible profit and the values of Q1 and Q2 at
which this is achieved.
28
Optimisation
b. A firm is allowed to charge different prices to its domestic and industrial
customers. If P1 and Q1 denote the price and demand for the domestic
market then the demand equation is P1 + Q1 = 500. If P2 and Q2
denote the price and demand for the industrial market then the demand
equation is 2P2 + 3Q2 = 720. The total cost of production is T C =
50, 000 + 20(Q1 + Q2 ). Determine the pricing policy for the firm that will
optimise profit with price discrimination and calculate the value of the
maximum profit.
c. A firm is a monopolistic producer of two goods G1 and G2 . Their prices P1
and P2 are related to the quantities Q1 and Q2 produced by the demand
equations P1 = 50 − Q1 , P2 = 95 − 3Q2 . If the total cost of producing Q1
and Q2 is T C = Q21 + 3Q1 Q2 + Q22 , show that the firm’s profit function is
π = 50Q1 − 2Q21 + 95Q2 − 4Q22 − 3Q1 Q2 .
Hence find the values of Q1 and Q2 that maximize the profit of the firm
and deduce the corresponding prices of G1 and G2 .
Ans: Q1 = 5, Q2 = 10, max profit = 600, P1 = 45, P2 = 65.
d. A firm has the possibility of charging different prices P1 and P2 in its
domestic and foreign markets. The corresponding demand equations are
given by Q1 = 300 − P1 , Q2 = 400 − 2P2 . The total cost function is
T C = 5000 + 100Q, where Q = Q1 + Q2 . Determine the prices that the
firm should charge to optimise its profit with price discrimination and
calculate the value of this maximum profit.
Ans: P1 = 200, P2 = 150, maximum profit = 10,000.
e. (MA3301 Spring 2011 examination) A business sells two products. Product 1 sells for x Euro per item and the business sells 10000 − 5x units of
it. The business can sell 8000 − 4y units of Product 2 for y Euro per item.
What should be the prices of the two products to maximize revenue? Ans:
x = 1000, y = 1000.
f. (MA3301 Spring 2011 examination) A hotel charges different prices for
the same meal in two different markets. The demand function in each
market is given by p1 = 50 − 4q1 and p2 = 80 − 3q2 , where p1 , p2 are the
prices of the meal and q1 , q2 are the quantities demanded in each market.
The company’s total cost T C is given by T C = 120 + 8(q1 + q2 ). Find
1. the total sales revenue T R;
2. the total profit T P ;
3. the optimal prices that should be charged for the meal in each market
to maximize total profit.
Constrained optimisation by substitution
Constrained optimisation by substitution
In this section we again consider how to find maxima and minima of a function
z = f (x, y), but now with the extra requirement that x and y are related in some
way by a constraint such as x2 + y 2 = 3. There are two standard techniques
for such problems:
a. Make an algebraic substitution to remove one of the variables. This
approach cannot always be used because it is sometimes impossible to
sort out the algebra to make the substitution.
b. Use Lagrange multipliers to handle the constraint. In principle this
technique can always be used, but later in the problem one may run
into difficulties in solving the equations to find the critical points. We
shall examine this approach later in the course.
Let’s find the minimum value of the objective function z = −2x2 + y 2
subject to the constraint y = 2x − 1. Substitute the expression for the
constraint directly into the objective function:
z = −2x2 +y 2 = −2x2 +(2x−1)2 = −2x2 +4x2 −4x+1 = 2x2 −4x+1.
This is now a function of only one variable. To find the minimum of z,
set
dz
0=
= 4x − 4
dx
which gives x = 1. To determine the nature of this critical point,
compute
d2 z
=4
dx2
which is positive, so x = 1 gives a local minimum. At x = 1 we have
y = 2(1) − 1 = 1 and then z = −(1)2 + (1)2 = −1.
Find the point on the line 2x + 3y = 4 that is closest to the origin (0,0).
29
30
Optimisation
The distance from any point (x, y) in the (x, y)-plane to the origin is
p
p
D ..= (x − 0)2 + (y − 0)2 = x2 + y 2 .
We want to minimize D, subject to the constraint that (x, y) lies on
the given line, i.e., that 2x + 3y = 4. But the constraint tells us that
y = (4 − 2x)/3, so we can substitute this into the formula for D, getting
s
2 1/2
4 − 2x
16 − 16x + 4x2
2
2
D= x +
= x +
.
3
9
Note that originally D was a function of two variables x and y, but the
constraint has enabled us to simplify D to a function of one variable x.
Thus we search for critical points of D by setting
−1/2 dD
1 2 16 − 16x + 4x2
−16 + 8x
0=
=
x +
2x +
dx
2
9
9
=
2x + −16+8x
1
9
.
2 x2 + 16−16x+4x2 1/2
9
This implies that
0 = 2x +
−16 + 8x
,
9
i.e.,
0 = 18x + (−16 + 8x),
which gives x = 8/13.
To verify that x = 8/13 does give the point on the line that is a minimum
distance from the origin, we should calculate d2 D/dx2 then substitute
x = 8/13 and see that we get a positive value, but this is quite a job!
Instead we shall simply observe that from the picture it is clear that
there definitely is one closest point on the given line, and the only
candidate that calculus produces for that point is x = 8/13, so it must
indeed be the closest point.
31
Constrained optimisation by substitution
Alternative (simpler) solution: We ran into a lot of algebra in our
derivatives because of the square root in D. Note however that whatever
value of (x, y) minimizes D will also minimize D2 because D ≥ 0. Thus
let’s solve the problem again by considering D2 = E (say) instead of D.
That is, we want to minimize E ..= x2 + y 2 , subject to the constraint
that 2x + 3y = 4. As before y = (4 − 2x)/3, so
2
E=x +
4 − 2x
3
2
= x2 +
16 − 16x + 4x2
.
9
Now set
0=
−16 + 8x
18x − 16 + 8x
26x − 16
dE
= 2x +
=
=
,
dx
9
9
9
which gives x = 8/13. Furthermore,
d2 E
8
=2+ >0
2
dx
9
so x = 8/13 does give a minimum of E (recall that in our first solution
to this problem we balked at finding d2 D/dx2 because it would be so
complicated).
Exercises
a. Find the shortest distance from the point (1, 0, −2) to the plane x+2y+z =
4.
b. Find the point on the plane 2x − y + 2z = 16 that is closest to the origin.
Ans: (32/9, −16/9, 32/9).
c. Find the shortest distance from the point (2, –2, 0) to the plane √
6x + 3y − 3z = 2.
Ans: 24/9.
d. Find the points on the surface z 2 = xy + 1 that are closest to the origin.
Ans: (0, 0, 1) and (0, 0, −1).
e. Find three positive numbers whose sum is 100 and whose product is a
maximum.
Ans: 100/3, 100/3, 100/3.
f. Find three positive numbers whose sum is 120 such that the sum of their
products taken two at a time is a maximum.
Ans: 40, 40, 40.
32
Optimisation
Applications to economics
Production functions
A firm wishes to maximize output Q = f (K, L) which depends on capital K
and labour L. Suppose the unit cost of capital is PK and the unit cost of labour
if PL . Then, using K units of capital and L units of labour, the total cost is
PK K + PL L.
If the firm has a fixed amount M to spend on inputs, then
PK K + PL L = M.
(4.1)
Thus the problem for the firm is to maximize Q = f (K, L) subject to the
constraint PK K + PL L = M . Here Q, K, L are variables while PK , PL and M
are known constants.
We solve this problem as in Section 4: from the constraint one gets easily
K=−
PL
PK
L+
M
PK
(4.2)
and consequently Q = f (K, L) can be reduced to a function of one variable
L. To finish the analysis of the problem, we would need a precise formula for
f (K, L).
Exercises
a. A firm’s production function is given by Q = 2K 1/2 L1/2 where K is
capital and L is labour. The unit capital and labour costs are e4 and e3
respectively. Find the values of K and L that minimize the total input
cost if the firm is contracted to provide 160 units of output.
33
Applications to economics
Graphical interpretation
The isocost curve (straight line in this example) is tangent to the isoquant
curve that yields the maximum output. The K axis is vertical and the L axis
is horizontal. The isocost curve (a straight line in this example) is drawn;
along it the total input cost remains constant and this is the maximum cost
that the firm is allowed to incur. We want to maximize output subject to this
constraint, i.e., subject to the restriction that our solution (K, L) must lie on
the isocost curve. Three isoquant curves are drawn above; along each isoquant
the output is constant, and the output is larger as the curves move to the right
and upwards (i.e., to the north-east). Thus we want to be on the isoquant
curve that is furthest to the north-east, subject to the constraint that we must
remain on the isocost line. Hence the isoquant curve that maximizes output
is the one furthest to the north-east that just touches the isocost line, i.e., the
isoquant and isocost curves are tangential at the point (K, L) where output is
maximized.
We now interpret this geometric observation in terms of economic quantities.
In (3.1) and (3.2) the marginal rate of technical substitution on the isoquant
is seen to satisfy
−
dK
M PL
= MRTS ..=
,
dL
M PK
where dK/dL is also the slope of the isoquant. But from (4.2) the slope of the
isocost line is
PL
.
−
PK
34
Optimisation
Our argument above says that the slopes of the isoquant curve and isocost line
are equal at the optimal output level, so
dK
PL
=−
,
dL
PK
i.e.,
M PL
PL
=
.
M PK
PK
This is usually rearranged into the form
M PL
M PK
:
=
PL
PK
(4.3)
at optimal output, the ratio of marginal product to price is the same for all
inputs. We shall derive this formula in a different way in Section 5.
Utility functions
The analysis above for production functions can be replicated for utility functions, as we now show.
Suppose that an individual’s utility function is U (x1 , x2 ) where x1 and x2
are the amounts of goods G1 and G2 purchased. Let P1 and P2 be the unit
prices of these goods. Let M be the (fixed) budget that the individual can
spend on G1 and G2 . Then
P1 x 1 + P2 x 2 = M
(4.4)
and we are trying to maximize U (x1 , x2 ) subject to the constraint (4.4).
But this is exactly the same mathematical formulation as maximizing Q =
f (K, L) subject to the constraint (4.1), which we considered at the start of
this section; only the letters used have changed. Thus our picture of isoquants
applies here also, with x1 the horizontal axis and x2 the vertical axis: in the
figure the straight line is now called the budget line and the curves, along each
of which U is constant, are called indifference curves in Section 3.
In (3.4) we learned that the marginal rate of commodity substitution MRCS
satisfied
Ux1
MRCS =
Ux2
on each indifference curve, and by its definition MRCS = −Dx2 x1 , while the
slope of the budget line is −P1 /P2 from (4.4). As the budget line is tangent to
the indifference curve their slopes are equal, and we infer that
P1
Ux1
=
,
P2
Ux2
i.e.,
Ux1
Ux2
=
P1
P2
(4.5)
—when utility is maximized subject to a budgetary constraint, then the ratio of
marginal utility to price is the same for each good consumed.
Equation (4.5) is the same as equation (4.3); only the the English terminology has changed.
Applications to economics
Exercises
a. An individual’s utility function is given by U = x1 x2 where x1 and x2
denote the number of items of two goods G1 and G2 . The prices of goods
per item are e2 and e10 respectively. Suppose that the individual has
e400 available to spend on the goods. Find the values of x1 and x2 that
maximize her utility. Verify that in your optimal solution the ratio of
marginal utility to price is the same for each good.
b. A firm’s unit capital and labour costs are e1 and e2 respectively. If the
production function is Q = 4LK + L2 , find the maximum output and the
values of K and L at which it is achieved when the total input costs are
fixed at e105. Verify that for your solution the ratio of marginal product
to price is the same for all inputs.
Ans: L = 30, K = 45, max Q = 6300.
c. The production function of a factory is Q = K 1/2 L1/2 , with the usual
notation. The factory’s output costs are constrained by the requirement
that 5K + 4L = 100. Find the optimal values of K and L that maximize
√
the output.
Ans: K = 10, L = 12.5, Q = 100/ 80.
d. (MA3301 Spring 2011 examination) The production function of a company
is given by
Y (K, L) = 10K 0.4 L0.3 ,
where Y is the number of units produced, K is the amount of capital used
and L is the number of labour hours used. Determine the maximum level
of production subject to the constraint L + 4K = 300.
Ans:
35
Chapter 5
Lagrange multipliers
Constrained optimisation using Lagrange multipliers
The substitution technique will not work in all constraint optimisation problems.
Instead, the method of Lagrange multipliers is used more frequently when
finding constrained optima because
a. It can handle nonlinear constraints;
b. It handles problems that involve more than two variables;
c. It provides some additional information when solving problems from economics.
Method of Lagrange multipliers
To optimise (i.e., maximize or minimize) an objective function f (x, y) subject
to a constraint φ(x, y) = M , proceed as follows:
a. Define a new function g(x, y, λ) = f (x, y) + λ[M − φ(x, y)].
b. Find the critical points of g by solving the simultaneous equations
∂g
= 0,
∂x
∂g
= 0,
∂y
∂g
= 0,
∂λ
for the 3 unknowns x, y, λ.
c. Then the optimal solution for the original constrained problem must lie
at one of the critical points of g. The significance of the value of λ at this
optimum will be described later.
Notes:
a. The function g is called the Lagrangian function and λ is the Lagrange
multiplier. (Joseph Lagrange 1736-1813)
∂g
b. The equation ∂λ
= 0 at Step 2 above is simply M − φ(x, y) = 0, the
original constraint. Thus the Lagrangian approach does ensure that the
constraint is satisfied.
37
38
Lagrange multipliers
We use Lagrange multipliers to find the minimum value of the objective
function z = −2x2 + y 2 subject to the constraint 2x − y = 1. (In
Example 4 we solved this problem by using substitution to eliminate
one independent variable.)
First, write the constraint in the form M −φ(x, y) = 0, viz., 1−2x+y =
0. Then the Lagrangian function is
g(x, y, λ) = −2x2 + y 2 + λ[1 − 2x + y].
Then set
0=
∂g
= −4x − 2λ,
∂x
0=
∂g
= 2y + λ,
∂y
0=
∂g
= 1 − 2x + y.
∂λ
Note that the last equation here is the original constraint of the problem—
this always happens. Now solve these simultaneous equations: multiplying the second equation by two gives 0 = 4y+2λ, then adding this to the
first equation gives 0 = −4x + 4y, i.e., y = x. Then the third equation
becomes 0 = 1 − 2x + x = 1 − x which yields x = 1. Hence y = x = 1
and λ = −2y = −2. The minimum value of the objective function z is
got by setting x = 1, y = 1: z = −2(1)2 + (1)2 = −2 + 1 = −1.
This example is only for practice; the Lagrangian method of solution is no
better here than the earlier substitution method. In this example, we did not
use second-order derivatives to check that we have found a minimum of the
objective function, because when using Lagrangian functions the max/min test
using second-order derivatives is much more complicated. We shall not discuss
this second-order derivative test. In most of the problems that we consider there
is only a single critical point and it is usually obvious in economic examples
whether it is a maximum or a minimum.
(MA3301 Spring 2011 Examination) Use Lagrange multipliers to find
the distance between the point (4, 5) and the unit circle x2 + y 2 = 1.
Hint: minimize f (x, y) = (x − 4)2 + (y − 5)2 subject to x2 + y 2 = 1.
The
pdistance from (4, 5) to any point (x, y) in the (x, y)-plane is equal
to (x − 4)2 + (y − 5)2 . Like Example 5, it simplifies the algebra if we
minimize the distance squared, i.e., minimize f (x, y) = (x−4)2 +(y−5)2
instead of the distance.
The Lagrangian function is
g(x, y, λ) = (x − 4)2 + (y − 5)2 + λ[1 − x2 − y 2 ].
Set
0=
∂g
∂g
∂g
= 2(x−4)(1)−2λx, 0 =
= 2(y−5)(1)−2λy, 0 =
= 1−x2 −y 2 .
∂x
∂y
∂λ
Constrained optimisation using Lagrange multipliers
From the first equation we get
x=
4
,
1−λ
from the second
5
.
1−λ
Substitute these into the third equation:
2 2
5
16 + 25
4
2
2
−
=1−
,
0=1−x −y =1−
1−λ
1−λ
(1 − λ)2
so
41
1=
,
(1 − λ)2
√
√
and (1 − λ)2 = 41, 1 − λ = ± 41, λ = 1 ± 41. Then we get two
apparent solutions:
√
a. When λ = 1 + 41, then
y=
x=
4
4
= −√
1−λ
41
y=
5
5
= −√ .
1−λ
41
and
b. When λ = 1 −
√
41, then
x=
and
4
4
=√
1−λ
41
5
5
=√ .
1−λ
41
√
√
√
√
These two points (4/ 41, 5/ 41) and (−4/ 41, −5/ 41) are diametrically opposite on the unit circle x2 + y 2 = 1. What has happened is
the Lagrangian method has found the minimum and the maximum of
the objective function f (x, y) = (x − 4)2 + (y − 5)2 on the unit circle; it
has found the point on the circle closest to (4, 5) and the point on the
circle furthest from (4, 5). This is typical of methods for optimisation:
both maxima and minima are found.
To finish the problem, a rough diagram will distinguish which
of√our
√
two points on the circle is the one√closer √
to (4, 5): it is (4/
41,
5/
41)
√
and the desired distance is f (4/ 41, 5/ 41) = 42 − 2 41 [exercise].
Alternatively, to avoid drawing a diagram, argue as follows: the desired
minimum of f (x, y) lies at one or both of the two points that we identified. Thus, evaluate f (x, y) at each of these two points and whichever
one gives the smaller value is the minimum (if both give the same same
value then both are minima).
y=
39
40
Lagrange multipliers
Exercises
a. Solve the exercises from last week by using Lagrange multipliers.
b. Use Lagrange multipliers to find the optimal value of z = x2 − 3xy + 12x
subject to the constraint 2x + 3y = 6.
Ans:
x = −1, y = 8/3, λ = 1, z = −3.
c. (MA3301 Autumn 2011 Examination) Use Lagrange multipliers to maximize f (x, y) = 4 − x2 − y 2 subject to the constraint y − x2 + 1 = 0. (Hint:
you will need to use the technique described under “Alternatively. . . ” in
Example 5 to decide which of the points you’ve found yield√a maximum.)
Ans: max attained at x = ±1/ 2, y = −1/2.
d. Use Lagrange multipliers to find the maximum and minimum of f (x, y) =
3x − y + 6 subject to the constraint x2 + y 2 = 4. √
√
√
√ Partial answer: critical points are (3 10/5, − 10/5) and
(−3 10/5, 10/5).
Applications to economics
A producer of two goods G1 and G2 has a joint total cost function
T C = 10Q1 + Q1 Q2 + 10Q2 where Q1 and Q2 denote the quantities of
G1 and G2 . If P1 and P2 denote the prices of the two goods, then the
demand equations are
P1 = 50 − Q1 + Q2 ,
P2 = 30 + 2Q1 − Q2 .
(i) Find the maximum profit possible if the firm is contracted to
produce a total of 15 units of goods of either type.
(ii) Estimate the new optimal profit if the production quota rises by
one unit.
To solve part (ii) of the question, one could replace the constraint Q1 +
Q2 = 15 by Q1 + Q2 = 16 then solve the problem again, but a quicker
way to get the desired estimate is the following: in the Lagrangian
function, replace the quota 15 by the variable M . The new Lagrangian
function is then
g(Q1 , Q2 , λ, M ) = 40Q1 − Q21 + 2Q1 Q2 + 20Q2 − Q22 + λ(M − Q1 − Q2 ).
∂g
Clearly ∂M
= λ, i.e., the rate of change of g with respect to M is
λ. In other words, λ is approximately the change in g caused by a
unit increase in M . But we found above that at optimal profit with
M = 15 one has λ = 30; thus g increases by approximately 30 at optimal
profit when M increases from 15 to 16. Now we want the increase in
the profit, not the increase in g, but in fact these are the same thing
41
Applications to economics
because at optimal profit the constraint M − Q1 − Q2 = 0 is satisfied
so g = 40Q1 − Q21 + 2Q1 Q2 + 20Q2 − Q22 = π, the profit. Hence the
profit increases by approximately 30, i.e., the new profit with M = 16
is approximately 475 + 30 = 505.
The information given by the value of the Lagrange multiplier in Example 5
is true in general: after the optimal solution has been found, the value of the
Lagrange multiplier tells us the approximate change in the optimal value of the
objective function when the constraint value is increased by one unit.
Note that the truth of this statement relies on the assumption that we write
the constraint as M − φ(x, y) = 0. If instead we write it as φ(x, y) − M = 0,
which is mathematically the same equation, then in the analysis above we’ll
∂g
get ∂M
= −λ so it’s then −λ that gives the approximate change in the optimal
value of the objective function when the constraint value is increased by one
unit.
Exercises
a. A manufacturer of parts for the tricycle industry sells 3 tyres for every
frame. If Q1 and Q2 denote quantities of tyres and frames respectively
and P1 , P2 the corresponding prices, the demand functions are
1
Q1 = 63 − P1 ,
4
1
Q2 = 60 − P2
3
and the total cost function is T C = Q21 + Q1 Q2 + Q22 + 190. Find the
profit-maximizing levels of output, price and profit.
Use Lagrange multipliers to find the values of K and L that maximize
output given by a Cobb-Douglas production function
Q = AK α Lβ
(A > 0, α > 0, β > 0)
subject to the cost constraint PK K + PL L = M .
The Lagrangian function is
g(K, L, λ) = AK α Lβ + λ[M − PK K − PL L].
Thus one solves the 3 simultaneous equations
∂g
αQ
= αAK α−1 Lβ − λPK =
− λPK ,
∂K
K
∂g
βQ
0=
= βAK α Lβ−1 − λPL =
− λPL ,
∂L
L
∂g
0=
= M − PK K − PL L.
∂λ
From (5.1a) we get
αQ
λ=
PK K
0=
(5.1a)
(5.1b)
(5.1c)
42
Lagrange multipliers
and from (5.1b) similarly
λ=
βQ
.
PL L
Equating these,
αQ
βQ
=
,
PK K
PL L
so
PK K
PL L
=
,
α
β
which yields
PK K =
α
PL L.
β
Substitute this into (5.1c):
M = PK K+PL L =
α
PL L+PL L,
β
so βM = αPL L+βPL L = (α+β)PL L.
That is,
L=
βM
.
(α + β)PL
Then from above
K=
α PL
α PL
βM
αM
L=
=
.
β PK
β PK (α + β)PL
(α + β)PK
Finally, a general observation about optimisation of production: suppose
that the Lagrangian function is
g(K, L, λ) = Q(K, L) + λ[M − PK K − PL L],
where Q is any production function. One then solves the 3 simultaneous
equations
∂g
∂Q
=
− λPK = M PK − λPK ,
∂K
∂K
∂Q
∂g
=
− λPL = M PL − λPL ,
0=
∂L
∂L
∂g
0=
= M − PK K − PL L,
∂λ
0=
where M PK and M PL are the marginal products of capital and labour that
were defined in Section 3. Solving each of the first two equations for λ yields
M PK
M PL
=λ=
.
PK
PL
This says that at the optimal level of production, the ratio of marginal product
to cost of input is the same for all inputs. We already saw this formula earlier
in the course, which was derived by appealing to a graph.
Exercises
a. Use Lagrange multipliers to solve Exercises 2–4 on Page 58.
Applications to economics
b. A producer of two goods x and y has a total cost function T C = 6x +
3xy + 8y. The demand functions for these goods are Px = 10 − 2x + y
and Py = 18 + 4x − 9y where Px and Py are the unit prices of the two
goods. Find the maximum profit if the firm is contracted to produce a
total of 45 goods of either type.
Ans: objective function is f (x, y) = 4x − 2x2 + 2xy + 10y − 9y 2 , constraint
x + y = 45, solution x = 34.38, y = 10.62, λ = −112.3.
c. The Cobb-Douglas production function for a new product is given by
Q = 20x0.5 y 0.5 where x is the number of units of labour and y is the
number of units of capital required to produce Q units of the product.
Each unit of labour costs e40 and each unit of capital costs e120.
1. If e3000,000 has been budgeted for the production of this product,
how should that be allocated in order to maximize production? What
is the maximum production?
2. Find the marginal product of capital in this case, and estimate the
increase in production if an additional e40,000 is budgeted for production.
Ans: (a) x = 3750, y = 1250, Q = 43301; (b) 0.1443, 5774.
43
Bibliography
45
List of notation
∂f
∂x
partial derivative, 7
fx
partial derivative, 7
∆x
differential (small change of value of variable x), 12
2
∂ f
∂x2
second partial derivative, 15
∂2f
∂x ∂y
second partial derivative, 15
EP
own price elasticity of demand, 17
EY
income elasticity of demand, 17
EPA
cross-price elasticity of demand, 18
P
price of a good, 17
PA
price of alternate good, 17
Q
demand for a good, 17
Y
income of customer, 17
K
capital, 19
L
labour, 19
M PK
marginal product of capital, 19
M PL
marginal product of labour, 19
MRTS
marginal rate of technical substitution, 20
U
utility, 22
MRCS
marginal rate of commodity substitution, 23
TC
total cost, 27
47
Index
Lagrange multiplier, 37
Lagrangian function, 37
law of diminishing marginal utility, 23
level curve, 4
local maximum, 25
local minimum, 25
budget line, 34
Cobb–Douglas production function, 21,
21
commodity substitution
marginal rate, 23
complementary good, 18
constraint, 29
continuous, 26
contour line, 4
critical point, 25
cross-price elasticity of demand, 18
curve
indifference, 23
marginal product of capital, 19
marginal product of labour, 19
marginal rate of commodity substitution, 23
marginal rate of technical substitution,
20
marginal utility, 22
law of diminishing, 23
maximum
global, 25
local, 25
minimum
global, 25
local, 25
monopoly, 28
dependent variable, 1
differential, 12
elasticity of demand
cross-price, 18
income, 17
own price, 17
extremum, 25
optimisation, 25
own price elasticity of demand, 17
global maximum, 25
global minimum, 25
good
complementary, 18
inferior, 17
substitute, 18
superior, 17
partial derivative, 7
rate of change, 9
substitute good, 18
superior good, 17
tangent plane, 11
total cost, 27
homogeneous function, 21
utility, 22
marginal, 22
law of diminishing, 23
income elasticity of demand, 17
independent variable, 1
indifference curve, 23
inferior good, 17
isocost, 33
isoquant, 19
variable
dependent, 1
independent, 1
49