Labor notes, page 5 2.1 Univariate calculus Given two sets X andY

LABOR NOTES, PART TWO: REVIEW OF MATH
2.1
Univariate calculus
Given two sets X and Y , a function is a rule that associates each member of X with
exactly one member of Y . Intuitively, “y is a function of x” means that the outcome y
depends on some x. For example, how happy you are might depend on how many
hours you spend playing softball each day; we would say that happiness (or utility) is a
function of softball time. Mathematics provides convenient shorthand for writing
this compactly:
y = f ( x)
In these cases, x is called the independent variable and y the dependent
variable. That is, we can pick any value of x we want to stick into the function, but
we can’t really pick what value y takes on—that depends on x.
When f is a function from X into Y , the set X is called the domain of the function
and Y is called the range. The domain is the set of permissible values to stick into
the function (if your earnings are some function of the number of hours you work
each day, then the domain of “number of hours per day” is from 0 to 24), and the
value that the function takes must be somewhere within the range. Most functions
used are real-valued functions: functions whose ranges are the set of real
numbers. The domain is usually also a subset of the real numbers, but there’s no
reason that it has to be. Your happiness could be a function of something abstract
and unquantifiable, like the flavor of tea you drink.
In economics, the amount of a good x demanded is a function of a person’s wealth
and the price of that good. In other words,
x = x ( p, w )
This is called a demand function. Sometimes the same letter will be used to
denote the function as the dependent variable.
Sometimes we will deal with inverse functions: that is, there is a function that
associated each element of Y with an element of X. Usually the inverse of a function
f is denoted by f !1 .
Labor notes, page 5
y = f ( x)
is equivalent to:
x = f !1 ( y ) .
You can think of it this way: the function f tells you the output y you get from the
input x; the inverse function f !1 tells you the input x necessary to get output y.
The demand function tells us how much people want to buy at a certain price. (Let’s
forget about wealth for now.) If a business knows this, it might ask the question,
“given that we would like to get consumers to buy x units, what price should we
charge?” The business would simply find the inverse demand function:
x = x ( p)
is equivalent to:
p = x !1 ( x ( p )) = p ( x ) .
In economics, we often use the term marginal to capture the effect of a small
change in one thing on something else (like the marginal utility of consumption, or
the marginal product of labor). This is akin to the mathematical concept of the
derivative of f at a point x:
lim !x"0
f ( x + !x ) # f ( x )
!x
(Interpretation: the change in the function f from x to x + !x , per unit of !x , when
!x gets as small as possible.) The derivative of f might be denoted by f ! ( x ) or,
when y = f ( x ) , by dy dx . You’ll probably become familiar with these:
Utility function: U = U ( c )
Marginal utility of consumption: dU dc or U ! ( c )
Revenue function: R = p !Y = p ! F ( L )
Marginal revenue product of labor: p ! dF dL or p ! F " ( L )
The derivative can also be interpreted as the slope of a line tangent to the function at
that point. Think back to diagrams of total cost and marginal cost curves.
At this point, the most important to know is how to take a derivative.
Calculating the derivative of a function using the proper definition can be very
tedious. In most cases, simple calculus rules simply it. The most important of these
is the power rule:
f ( x) = a ! xn
!
f ! ( x ) = a " n " x n #1
Labor notes, page 6
Because you can often break down functions (like polynomials) into several terms of
this form, you can take most derivatives easily using this. Here are some other rules
to follow for taking derivatives:
Addition rule:
h( x) = f ( x) + g( x)
!
h! ( x ) = f ! ( x ) + g! ( x )
Product rule:
h( x) = f ( x) g( x)
!
h! ( x ) = f ! ( x ) g ( x ) + f ( x ) g! ( x )
Quotient rule:
h( x) =
!
h! ( x ) =
Chain rule:
h ( x ) = f ( g ( x ))
!
h ! ( x ) = f ! ( g ( x )) " g ! ( x )
Inverse rule:
g ( x ) = f !1 ( x )
!
g ! ( f ( x )) =
f ( x)
g( x)
f ! ( x ) g ( x ) " f ( x ) g! ( x )
#$ g ( x ) %&
2
1
f !( x)
(The quotient rule and the inverse rule require that the term in the denominator is
not zero, obviously.) The function h in the chain rule is called a composite
function; that is, h is not directly a function of x, but it is a function f of g ( x ) . If
that sounds confusing, think of this example: your utility is not actually a function of
prices. However, prices do affect how much you can afford to buy, and that affects
your utility. During this semester, you will see an individual’s indirect utility
function. This is the composite function I just described:
V ( p, w ) = U ( x ( p, w ))
This is the value of having wealth w when facing prices p. It is simply the utility you
get from your optimal demand x ( p, w ) at these prices with this wealth.
The inverse rule is also very useful for getting information from inverse functions.
For example, a consequence of utility maximization is an equation like “the marginal
utility of consuming some good equals the marginal cost (that is, price) of that good”:
U!( x) = " p
( ! is some constant, the multiplier from the utility maximization problem—ignore it
for now.) This gives us an inverse demand function for x very easily:
Labor notes, page 7
U!( x) = " p
What if we want to know how x changes when p changes? In other words, what is
the derivative of the demand function, dx dp ? (Or what about the price elasticity of
x? We would need to know dx dp for that.) The inverse demand function gives us
the opposite of dx dp :
dp 1
= U "" ( x )
dx !
However, we can use the inverse rule to get what we want:
dx ! dp $
=# &
dp " dx %
'1
=
(
U )) ( x )
And that tells us how the optimal bundle will change when the price changes. (The
idea is that the change in x resulting from a change in p depends on the curvature of
the utility function.) As for point elasticity, the familiar “percent change in this with
respect to a percent change in that” takes the form of:
!=
dx x dx p
=
"
dp p dp x
We found what dx dp is. Using this and the original optimality condition, we find
this formula for elasticity:
!=
dx p
#p
U $(x)
" =
=
dp x xU $$(x) xU $$(x)
(The last term here might be familiar as relative risk aversion, if you’ve taken
some advanced microeconomics).
As a final important note, some interesting f ( x ) have x as an exponent or take the
logarithm of x. Two functions that show up frequently are exponential e and the
natural logarithm ln . Remember these rules for exponents and logarithms:
ax ! ay = ax+ y
ax ay = ax! y
log ( x ! y ) = log x + log y
log ( x y ) = log x ! log y
a0 = 1
a! x = 1 a x
y
a x = a x!y
log (1 x ) = ! log x
log x y = y log x
log1 = 0
( )
Labor notes, page 8
The power rule makes it easy to take the derivatives of most functions. However,
these “interesting” functions—like sine, cosine, and logarithm—have derivatives that
aren’t so simple. For natural logarithms and exponentials, here are the rules:
f ( x ) = ex
f ( x ) = ln x
2.2
!
!
f ! ( x ) = ex
f !( x) = 1 x
Multivariate calculus refresher
The part of these notes addressed functions where a single input goes in, and a single
output comes out. Most economic applications aren’t so simple. In most cases, a
number of variables influence a decision, or a number of factors are required to
produce some good. These are functions of many variables. If the variable z is a
function of x and y, this is written:
z = f ( x, y )
Of course, f could be a function of more than two inputs. A production function
might have capital, labor, and material inputs:
Y = F ( K, L, M )
Utility might be a function of ! goods:
U = U(x1 , x2 ,…x! )
Demand for a particular good x1 is a function of the price of that good, the price of
another good x2 , and the person’s wealth:
x1 = x1 ( p1 , p2 , w)
In previous micro classes, you discussed about how quantity demanded changes
when something else, like the price of x2 , changes, “holding everything else constant”
or ceteris paribus. This translates into the idea of a partial derivative, denoted by:
!x1 !p2
Labor notes, page 9
The price of good x is held constant, and wealth is held constant—though the
person’s wealth may change if he is a large producer of good y, we’re not concerned
about those possible effects. Similarly, we might talk about the marginal product of
labor (denoted by !F(K, L, M ) !L or simply !F !L ), and the marginal utility of
consuming good xn (denoted by !U(x1 , x2 ,…x! ) !xn or !U !xn ).
Taking a partial derivative ! f ! x is like pretending f ( x, y ) is just a function of x,
with y constant. Because of this, the addition rule, the product rule, and the
quotient rule work the same as in the univariate case.
Considering that other factors may change is the notion of a total derivative.
Using the previous example, consider that demand for x is a composite function of
prices and wealth, which is itself a function of prices:
x1 = x1 ( p1 , p2 , w( p1 , p2 ))
Then the total derivative of x with respect to the price of y is:
dx1 dp2 =
!x( p1 , p2 , w) !x( p1 , p2 , w) !w( p1 , p2 )
+
"
!p2
!w
!p2
The first term on the right-hand side is the partial derivative of x with respect to
price of y. This tells you the effect holding everything else constant. For the total
derivative, we also add in these other effects—in this case, that the person’s wealth
changes when the price of y changes, and that his demand for x changes when his
wealth changes. The second term on the right-hand side comes from applying the
chain rule. Intuitively, the partial derivative !x1 !p2 captures the substitution effect
of a price change, while the total derivative dx1 dp2 contains both the substitution
and income effects.
Similar to derivatives are differentials. Remember that, given a change in the run
of a function (back to one variable) you can use the slope at that point to
approximate the change in the rise:
!y " f # ( x ) $ !x
Labor notes, page 10
When the !x get really, really tiny this is a good approximation. When they get
infinitely tiny or infinitesimal, this turns out to be exactly correct, not an
approximation at all. The convention in calculus is, of course, to use dx to denote
this small change:
dy = f ! ( x ) " dx
This is known as a differential. If you divide both sides by dx, you get the derivative.
In multivariate calculus, a function and its differential might look like:
z = f (x, y)
!
dz =
!f
!f
dx + dy
!x
!y
The way that I figure out differentials is by writing down a list of all the variables
(dependent or independent) and then going through the function. Whenever a term
shows up that has one of these variables, I take the partial derivative of that term
and I tack on a dx or whatever the variable is. If the term has multiple variables in it,
I do this for each of them. Consider the relationship:
z = f (x, y) = 7x 2 + 12x 3 y 2 +
x
y
The differential of this function is:
dz = 14x ! dx + 36x 2 y 2 ! dx + 24x 3 y ! dy +
1
x
! dx " 2 ! dy
y
y
If we say y doesn’t change, and we want to see what the effect of a small change in x
on z is, we set dy = 0 . Not surprisingly, the result is exactly the same as the partial
derivative of z with respect to x. Additionally, we might be interested in changing
both x and y a small bit, and see the result on z. We can also do this using the
differential.
Differentials are more versatile than just taking the derivative. Let’s say we have the
production function:
Y = F ( K, L, M )
where capital, labor, and materials are our inputs. The differential of this production
function is:
Labor notes, page 11
dY =
!F
!F
!F
dK +
dL +
dM
!K
!L
!M
That equation says that the change in output depends on the change in capital and
the marginal product of capital, the change in labor times the marginal product of
labor, and the change in materials times the marginal product of materials. That’s a
true, indisputable fact.
We can use that fact in the following manner. Suppose we want to keep output the
same, and see how much less of one factor (capital) we would need if we reduce
another (labor) from the same materials. In other words, we want to keep dY = 0
and dM = 0 , and we need to find the values of dK and dL that balance the equation:
0=
!F
!F
dK +
dL
!K
!L
With some rearranging, this produces the following result:
dK !" F " L
=
dL
"F "K
This is change in capital necessary to keep production the same. In economics, it is
interpreted as the marginal rate of technical substitution. If you remembered
from previous classes that the MRTS of labor for capital is the ratio of their marginal
products, you’ve now seen where that result comes from. What we have found here
is the slope of the isoquant curve at a particular point.
Another interesting question would is how much of one good a person would require
to offset in utility changes from a change in another good. Let’s say there are !
goods, labeled x1 through x! , in the person’s utility function:
U = U ( x1 , x2 , x3 ,…, x! )
The differential of this function is:
dU =
!U
!U
!U
dx1 +
dx2 + … +
dx!
! x1
! x2
! x!
We want to know how much of good k the person would trade for good m, keeping
his utility the same. He is not trading another other goods. Then:
Labor notes, page 12
0=
!U
!U
dxk +
dxm
! xk
! xm
Rearranging produces the marginal rate of substitution:
dxk
"U " xm
=!
dxm
"U " xk
Again, you may recall that the MRS equals the ratio of marginal utilities. It should
also be the slope of a line tangent to the indifference curve at that point. Think
about this in a two-good world—draw some pictures in xk ! xm space. If we start
with a particular point and name all others points which do not change the utility—
that is, the set of all points such that dU=0—we’ve identified an indifference curve.
Its slope at this particular point would be described by dxk dxm , which is exactly
what we found here.
Indifference curves and technology frontiers are both examples of implicit
functions. An explicit function is what we usually think of as a function:
y = f ( x)
An implicit function looks like:
c = f ( x, y )
where c is some constant (or at least a constant, as far as we’re concerned). Think
about indifference curves and isoquant curves, which show the values of x and y that
yield the same utility or output c: these are implicit functions.
Sometimes we get a relationship between x and y that’s virtually impossible to solve
for one in terms of the other. For instance, try solving this for y:
f ( x, y ) = 12y 2 x ! 4yx + 16 9 y + 99 = 0
Labor notes, page 13
Given that you can’t isolate y, is there any hope of figuring out dy dx ? Yes, using the
differential as before:
( 24y x ) dy + ( 6 ) dx ! ( 4x ) dy ! ( 4y) dx + (
y2
x
(6
y2
x
) (
! 4y dx = 4x !
16
9 9 y8
)
16
9 9 y8
) dy = 0
! 24y x dy
y2
6 x ! 4y
dy
=
dx 4x ! 916 8 ! 24y x
9 y
The point is that even if you can’t solve y explicitly in terms of x, you can still
evaluate its derivative.
More importantly, often you don’t even know the exact function (because you’re
working with an arbitrary U(x, y) ), which makes it impossible to solve explicitly for
one variable in terms of another. You can still look at marginal effects, as we did
earlier. These are all applications of my favorite principle in mathematics, the
implicit function theorem.
Theorem: Let f (x, y) = c implicitly define y as a function of x, for some constant c. Then
the derivative of y with respect to x is
dy
"f "x
=!
.
dx
"f "y
This is very useful in economics. For instance, consider a person who gets utility
from consumption of two goods, x and y. We’ll set the price of the first good to 1,
and let p be the price of the second.
The budget constraint requires
that y = (w ! x) p . Substituting this into the utility function, we have that:
The utility function is:
U(x, y) = U(x,(w ! x) p)
We usually find that a utility maximizing individual sets the marginal rate of
substitution between the goods equal to the relative prices:
!U(x,(w " x) p) !y
=p
!U(x,(w " x) p) !x
Labor notes, page 14
How does a change in the price (or wealth) affect consumption of x? One side of the
equation needs to be a constant, which can almost always be achieved by simply
subtracting one side off. It also looks like we can make things simpler by multiplying
through by the denominator. Let’s give this implicit function the name Q :
Q(x, p, w) =
!U(x,(w " x) p)
!U(x,(w " x) p)
"p
=0
!y
!x
The implicit function theorem tells how to find all of these effects; for example, we
can use this function to determine how demand changes when prices change:
dx
"Q "p
=!
dp
"Q "x
The neat thing about this is it gives us an answer that depends on diminishing
marginal utilities of the goods (second derivatives) as well as their complementarity
or substitutability (cross-partial derivatives)—and we’ve assumed nothing about the
utility function.
Labor notes, page 15