Lecture 00 Math Review

Embed Size (px)

Citation preview

  • 8/10/2019 Lecture 00 Math Review

    1/23

    Review of Calculus Tools c 2012 Jerey A. Miron

    Outline1. Derivatives

    2. Optimization of a Function of a Single Variable

    3. Partial Derivatives

    4. Optimization of a Function of Several Variables

    5. Optimization Subject to Constraints

    1 Derivatives

    The basic tool we need to review is derivatives. The basic, intuititive denition of aderivative is that it is the rate of change of a function in response to a change in itsargument. Lets take an example and look at it more slowly.

    Say we have some variable y that is a function of another variable x, e.g.,

    y = f (x)

    For example, we could have

    y = x2

    or

    y = 7x + 3

    or

    y = ln xGraphically, I am just assuming that we have something that looks like the following:

    1

  • 8/10/2019 Lecture 00 Math Review

    2/23

    Graph: A Standard Dierentiable Function with a Maximumy = (x 3)2 + 8

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    Now say that we are interested in knowing how y will change if we change x.

    Lets say that y is test scores, and x is hours of studying.

    Assume we are initially at some amount of x, e.g., you have been in the habit of

    studying 20 hours per week. You want to know how much higher your test scoreswould be at some other amount of x, x + h.

    One thing you could do, if you know the formula, is take this alternate x + h, andcompute f (x) as well as f (x + h). You could then look at the dierence:

    f (x + h) f (x)

    This would be the change in y. For some purposes, that might be exactly what youcare about.

    In other instances, however, you might care about not just how much of a changethere would be, but how much per amount of change in x, i.e., per h:

    That is also easy to calculate:

    2

  • 8/10/2019 Lecture 00 Math Review

    3/23

    f (x + h) f (x)h

    Now look at this graphically:

    3

  • 8/10/2019 Lecture 00 Math Review

    4/23

  • 8/10/2019 Lecture 00 Math Review

    5/23

  • 8/10/2019 Lecture 00 Math Review

    6/23

    Graph: Rate of Change as h Shrinksy = 4x1 =2

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    h

    So, lets think about the limiting case of this. Say we examine

    limh ! 0

    f (x + h) f (x)h

    At one level, this thing might seem a bit confusing or ill-dened. The numeratorobviously goes to zero as h gets small. The denominator also goes to zero. So,why should we expect the limit to converge to anything?

    The proof is outside this course. But, looking at the graph, we can see that itseems plausible that as we let h go to zero, the ratio should approach the slope of the line that is tangent to the function.

    This is indeed the case, and it can be proven, but we will just accept it asreasonable.

    To summarize, we have shown that the rate of change of a function at a givenpoint (assuming it has a well-dened rate of change) is equal to the slope of a linethat is tangent to the curve at that point.

    6

  • 8/10/2019 Lecture 00 Math Review

    7/23

    So, we simply want to dene the derivative as

    dy=dx = f 0(x) = limh ! 0

    f (x + h) f (x)h

    The key thing to keep in your head is that the derivative is both:

    1) the rate of change of the function at that point, and

    2) the slope of the tangent line at that point.

    Here are a few additional things to consider:

    1) The derivative is usually dierent at dierent points.

    2) Some functions do not have derivatives at all points:

    7

  • 8/10/2019 Lecture 00 Math Review

    8/23

    Graph: Functions with Non-Dierentiabilities

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    x'

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    x'

    y = (x + 3) =x + 4

    8

  • 8/10/2019 Lecture 00 Math Review

    9/23

    0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0

    -10

    -8

    -6

    -4

    -2

    0

    2

    4

    x

    y

    x' = 0

    3) We know the formula for the derivatives of a lot of functions:

    constant

    linear

    polynomial

    x to any power

    ln x

    ex

    and many more, but we will only need the ones above.

    4) We also know some rules about combinations of functions.

    The product rule : if

    f (x) = g(x)h(x)

    then

    9

  • 8/10/2019 Lecture 00 Math Review

    10/23

    f 0(x) = g(x)h 0(x) + h(x)g0(x)

    The chain rule : if

    f (x) = g(h(x))

    then

    f 0(x) = g0(h(x))h0(x)

    2 Optimization of a Function of a Single Variable

    So far we have talked about the idea that the change in a variable y that dependson a variable x, per unit of x, might be a useful thing to measure in some settings.

    And, we have seen that the derivative we have dened the change in y per unitof x, for small changes in x seems to measure that concept.

    But we have not been that explicit about why derivatives are useful in economics.Well take a step in that direction now.

    So, imagine that we have some y that depends on x, and we control x. We knowthat dierent values of x lead to dierent values of y, and we want to choose the xthat gives us the highest y.

    For example, assume y is a measure of happiness, and x is the number of pintsof Ben and Jerrys that a consumer eats each night. You might think that forsmall values of x, y increases with x. But at some point, as x increases, happinessdecreases (because you can feel your arteries clogging as you eat your 8th pint thatnight).

    Graphically, we have

    10

  • 8/10/2019 Lecture 00 Math Review

    11/23

    Graph: A Single-Peaked Functiony = (x 3)2 + 8

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    So, graphically, its easy to pick the right point.

    The key thing about this point, other than the fact that it seems to be where yis highest, is that the slope at that point, i.e., the derivative, is zero.

    So, this suggests a strategy for nding the x that leads to the maxiumum y: takethe derivative, set it equal to zero, and then solve.

    That is, compute

    f 0(x)

    set this to zero

    f 0(x) = 0

    and solve for x.

    This kind of equation is known as the rst-order condition (FOC) for a maximum.

    11

  • 8/10/2019 Lecture 00 Math Review

    12/23

  • 8/10/2019 Lecture 00 Math Review

    13/23

    Graph: Functions Without Well-Dened Maxima

    -3 -2 -1 1 2 3 4 5 6 7 8 9 10

    -4

    -2

    2

    4

    6

    8

    10

    x

    y

    no max or min

    -3 -2 -1 1 2 3 4 5 6 7 8 9 10

    -2

    2

    4

    6

    8

    10

    x

    y

    infinitely manymax = min

    13

  • 8/10/2019 Lecture 00 Math Review

    14/23

    0 1 2 3 4 5 6 7 8 9 100

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    x

    y

    min but no max

    So, the condition we have stated, the FOC, is not sucient for a point to be amaximum.

    Indeed, it is not even necessary, if we allow for functions that are not dierentiable.

    There is a standard approach to dealing with this that handles these weird casesfor dierentiable functions. This method is known as the second-order conditions.It basically says that the second derivative has to be negative for a maximum.

    What is a second derivative? Its just a derivative of a derivative. And youprobably remember, or can at least see intuitively, why this makes sense: If thesecond derivative is negative, the derivative is getting smaller.

    Dont worry about this for now. I will review it again in a few examples whereit is relevant later.

    Most, although not all, of the problems we examine are nice. For now, I wantyou to be aware of the fact that some problems are not "nice." We will see someexamples where it is relevant later. But, its not the key thing to focus on now - just

    be sure to understand the intuition and mechanics of the FOC.To be clear, it is very important that you be aware that the FOC is not a sucient

    condition; there are special cases where the point that satises the FOC is not the

    14

  • 8/10/2019 Lecture 00 Math Review

    15/23

    maximizing point. But were not going to worry about the details yet or to asignicant degree in this course overall.

    NB: everything Ive said is applicable for nding minima instead of maxima. Thatis one reason we have to check the SOCs. But again, in most applications that wewill consider, this will take care of itself.

    3 Partial Derivatives

    The next, and basically last, calculus topic that we need is partial derivatives.

    The reason is that many interesting economics examples relate one variable, sayy, to two (or more) other variables, say k and l. A common example can be foundin a production function:

    y = f (k; l)

    or, in a utility function,

    u = u(x1 ;x2 )

    So, the standard calculus of one variable is not sucient.

    Imagine that we have a function of two variables, e.g.,

    y = f (x; z)

    Now, this is a bit more of a pain graphically. But, in principle, we can draw this:

    15

  • 8/10/2019 Lecture 00 Math Review

    16/23

    Graph: A Function of Two Variablesz = (x 4)2 =8 (y 4)2 =8 + 8

    10

    5z

    1010

    5 5

    x y

    000

    So, y changes in responses to both x and z.

    If we held one variable constant that is, looked at a particular slice of thispicture in either the x or z direction we would see a univariate function.

    If we were only working with that, then we might just apply the standard ap-proach from before.

    So, we might consider the rate of change of y with respect to either one of thosevariables.

    It is therefore natural to dene what are called partial derivatives:

    @y@x

    = limh ! 0

    f (x + h; z) f (x; z)h

    Now, this might look messy. But it simply treats z as a constant, and then takesa standard derivative.

    This is easiest to see by considering examples. Assume

    16

  • 8/10/2019 Lecture 00 Math Review

    17/23

    y = xz

    Then

    @y@x

    = z:

    Why? Because if we treat z as a constant, then y equals just a constant times x,and we know how to take that derivative.

    What exactly is this partial telling us? It is telling us the rate at which y changesas we change x, holding z constant.

    Furthermore, it makes sense that this depends on the value of z. Take z = 0 -then changing x has no eect on y.

    Of course, we could also think about the eect of z on y. To calculate that, wetake the derivative of y with respect to z, treating x as a constant:

    @y@z

    = x:

    So, if we have a function

    y = f (x1 ;x2 ; : : : xn )

    i.e., a function of n variables, there will be exactly n partial derivatives.

    More examples: Let

    y = ax + bz + cq

    Then

    @y@x

    = a

    @y@z

    = b:

    @y@z

    = c:

    17

  • 8/10/2019 Lecture 00 Math Review

    18/23

    Now say

    y = x2 z3

    Then@y@x

    = 2xz 3

    @y@x

    = 3x2 z2 :

    Or, let

    u(x1 ;x2 ) = x1 x2

    Then

    @u(x1 ; x2 )@x1

    = x 11 x2

    @u(x1 ; x2 )@x2

    = x1 x1

    2

    3.1 Discussion:

    You need to know two things about partials.

    First, given a general function or some specic function, you should know how tocalculate them.

    That should be pretty straightforward, since once you understand the approach treat all other variables as constants, and then apply standard rules from univariatecalculus its a totally mechanical application of univariate calculus.

    Second, you need to know how to interpret partials.

    This again should not be hard; it is just a tad dierent than the univariate case,but in a way that matters.

    18

  • 8/10/2019 Lecture 00 Math Review

    19/23

    In words, the partial of a function with respect to one argument is the rate of change in the function in response to a small change in the argument, holding theother arguments xed.

    This is dierent than adjusting both arguments.

    For example, increasing a consumers consumption of goods 1 and 2 is normallygoing to have a dierent eect on utility than just increasing, say, good 1.

    As a second example, increasing both K and L will have a dierent eect than,say, increasing L and holding K constant.

    Well see this in practice soon.

    4 Optimization of Functions of Several Variables

    The last topic we need to consider is how to nd the maximizing values for functionsof several variables.

    Indeed, this is the case of real interest, since key examples in economics are of this variety.

    That is what creates all the tension about how much math to use in intermediatecourses.

    Everyone agrees that its nice to be able to use calculus. But it turns out thatwe need just a little bit of multivariate calculus.

    Virtually all basic calculus courses, however, focus only on univariate, rather thanmultivariate, calculus; in particular, they do not teach partial derivatives. Thus, inmost sequences, you do linear algebra and then multivariate calculus. This makessense, since you need linear algebra (but only a tiny amount) for some parts of multivariate calculus. But this standard approach makes life dicult.

    So, the key tool we need to do micro theory with calculus is partial derivatives.That means that if we cannot use partials, the benets of using calculus are notlarge; thats why most books put it in an appendix, or skip it entirely.

    19

  • 8/10/2019 Lecture 00 Math Review

    20/23

  • 8/10/2019 Lecture 00 Math Review

    21/23

    Graph: A Smooth Function of Two Variablesz = (x 4)2 =8 (y 4)2 =8 + 8

    10

    5z

    1010

    5 5

    x y

    000

    We also know we could think about this in only one of two dimensions.

    Then this would look like:

    21

  • 8/10/2019 Lecture 00 Math Review

    22/23

  • 8/10/2019 Lecture 00 Math Review

    23/23