Math Guide for Econ 11

These notes are intended as a reference guide for the mathematical tools of that are used in Econ 11. The following pages provide all the mathematical results, along with brief explanations, illustrative examples of their use and additional exercises. You should have seen some, if not most of this material in your calculus course, especially the parts that are related to single-variable calculus. Some of the concepts may be new, but these will be discussed in detail, when they are introduced during the lectures; these notes are intended to serve you as a quick reference as you go along with the course. The first two TA sessions will review the material in this handout in detail.

1 Introduction

Consider the following two examples:

1. A firm that has to decide how much to produce of a certain good. The market price 1 2 for the firm’s product is p, and it costs the firm C (q)= 2 q to produce a quantity q of the good. The firm wants to maximize its profits, i.e. sales revenue minus production costs, and can choose the quantity q that it produces. With a sales revenue pq,wecanwritethefirm’s 1 2 profits as F (q)=pq 2 q ,andthefirm’s decision problem consists in finding the quantity q that maximizes F (−q). 2. A student has to prepare for an exam the next day. She has 12 hours remaining before the exam. For each additional hour of studying, she expects to raise her grade by 2 points (out of a 100), but she also realizes that her concentration level during the exam depends on how much she sleeps. If she sleeps 7 hours, she is able to work with full concentration. If she sleeps less than that, her concentration goes down. If she didn’t study any more, and slept exactly y hours before the exam, she expects a grade of 11 + y (14 y) (for y=7, this gives a grade of 60; for y=6, this gives a grade of 59, for y=5, this gives a− grade of 56, and so on). Therefore, if the student sleeps y hours and studies x hours until the exam, her grade (as a of x and y)isF (x, y)=11+y (14 y)+2x. The student wants to allocate her time optimally between sleeping and studying− so as to maximize her expected grade. But her choices of x and y have to satisfy the additional constraint that 12 x + y,i.e.the amount of time that the student studies plus the amount that she sleeps cannot≥ exceed the 12 hours remaining before the exam.

These two examples are representative of the decision problems that are studied in Mi- croeconomics, and that we are concerned with in much of this course. Formally, we consider problems in which a decision-maker (i.e. a consumer, a household, a firm, etc. depending on the exact context), has to maximize an objective function F (x) with respect to some choice variable x.Inthefirst example above, the decision-maker was a firm, its objective

1 were profits, and its choice variable was the quantity. In some of these problems, x may consist of multiple elements, or it may be subject to additional constraints. Thisisthe case in the second example, where the decision-maker (the student) had to choose both x (the amount of time spent studying) and y (the amount of sleep), and had to satisfy the additional constraint that g (x, y)=12 x y 0. − − ≥ The advantage of formulating individual decision problems in this mathematical format is that we can then use the mathematical tools of optimization to analyze them. The firm’s problem of choosing how much to produce is an example of an unconstrained optimization problem, generally represented as max F (x) . x Thestudentexampleisaconstrained optimization problem, which is generally represented as max F (x) ,subjecttog (x) 0. x ≥ In both cases, x can consist of one or multiple variables, and the objective function F (x) can take many different forms; as does the constraint g (x) 0. The remainder of this hand-out introduces you to the mathematical techniques used to≥ solve this kind of problem.

2 Preliminaries

2.1 Consider the following F (x),infigure 1. You want to maximize this function with respect to the variable x.Inthefigure you see that this occurs at the where the function is “flat”, i.e. at x∗ the “” of this function is zero. The slope of a function at a given point is given by the function’s . Formally, for a function F (x), its derivative with respect to x is defined as dF F (x + h) F (x) =lim − dx h 0 h → dF In figure 1, you see that for a given value of x, dx is determined as the slope of F (x) at x. dF As you can easily convince yourself by changing x, dx varies with x, i.e. is itself a function of x.Wecanthendefine a “” simply as the derivative of the first derivative d2F (and consequently third derivatives etc.), and denote it dx2 . The second derivative gives us the change in the slope of a function at a certain point. In Nicholson, chapter 2, you find a of useful rules for finding the derivatives of functions. You should memorize these rules! Example 1a: Intheexampleoftheprofit maximizing firm, the profit function is F (q)= pq 1 q2.ThederivativeofF with respect to q is dF = p q. The second derivative of F − 2 dq − with respect to q is d2F = 1. You can verify this using the derivative rules in Nicholson. dq2 − 2 dF

dx x=x dF F(x) 1 = 0 dx x=x*

F(x)

* x x1 x

Figure 1:

dF Exercise 1a: using the definition of dx , find the derivatives of the functions (i) F (x)= x2; (ii) F (x)=√x (Note: the second example is somewhat harder than the first!). 1 1+2x Exercise 1b: Find the first and second derivatives of F (x)= 1+x ; F (x)=e ; 1+x2 F (x)= 1+x .

2.2 Functions with multiple variables In many cases, we have functions of multiple variables. For example, the grade of the student depended on x, the amount of studying, and on y, the amount of sleep. We can define the derivatives of multivariate functions in the same way as above. Let (x, y) be two variables, and let F (x, y) be a function of these two variables. The of F with respect to x is defined as

∂F F (x + h, y) F (x, y) = lim − ∂x h 0 h → ∂F i.e. we simply take the derivative of F (x, y) with respect to x, but holding y constant. ∂x gives us the change of F (x, y) with respect to a change in x; this measures by how much the function F (e.g. the student’s grade) changes in response to a small change in x (the time spent studying), while holding fixed y (the amount of sleep). Likewise, we can define ∂F ∂F the partial derivative of F with respect to y, ,as = limh 0 (F (x, y + h) F (x, y)) /h, ∂y ∂y → − which gives the change of F (x, y) with respect to a change in y; i.e. in the grade example, ∂F ∂y measures by how much the student’s grade changes in response to a small change in y (the amount of sleep), holding fixed the time spent studying, x. These partial derivatives measure the change of a function with respect to a change in one particular direction (changing only x or only y). In many cases, however, we will want to examine how a function changes, as we change simultaneously both variables. For example, we may want to examine how the student’s grade changes as we simultaneously

3 alter the amount of sleep she gets and the amount of time she studies. If F is continuously ∂F ∂F differentiable (i.e. if ∂x and ∂y are continuous functions of the pair of variables (x, y)), then we can do this simply by adding the changes along each dimension to find the total change in the objective function: Let ∆x be the change in x and ∆y be the change in y (and think of both ∆x and ∆y as small). Then the total change in F that results from this change is ∂F ∂F ∆F = ∂x ∆x + ∂y ∆y. There are exceptions to this rule that one has to be careful about (they arise when F is not continuously differentiable), but these will not be a bigconcernforusinthiscourse. Example 2c below discusses one such example. These partial derivatives are themselves multi-variate functions of the pair of variables ∂2F (x, y). If we take their partial derivatives, we find the second-order partial derivatives, ∂x2 ∂2F or ∂y2 ,aswellasthecross-partial derivatives

∂2F ∂ ∂F ∂2F ∂ ∂F = ∂x and = ∂y ∂x∂y ∂y ∂y∂x ∂x As in the single variable case, the second-order partial derivatives measure the rate of change of the first derivatives, along the x or the y dimension. The cross-partial derivative measures how the partial derivatives with respect to x change with y (and vice versa). Young’s ∂2F ∂2F Theorem (Nicholson, ch. 2) states that ∂y∂x = ∂x∂y, i.e. whether we firsttakethederivative with respect to x and then y,orfirsttakethederivativewithrespecttoy and then x,we will find the same answer. In other words, the order in which we take derivatives does not matter, if we want to determine cross-partial derivatives. Remark: The entire discussion here can directly be extended to functions of more than 2 variables. But for almost the entire course, we will only work with functions of 2 variables.

Example 2a: Intheexampleofthestudentstudyingforherexam,thegrade,asa function of the hours of sleep and hours of studying was: F (x, y)=11+y (14 y)+2x. ∂F − The partial derivative of F (x, y) with respect to x is ∂x =2. The partial derivative of ∂F F (x, y) with respect to y is ∂y =14 2y. The second derivative with respect to x is ∂2F − ∂2F ∂x2 =0. The second derivative with respect to y is ∂y2 = 2. The cross-partial derivative ∂2F ∂2F − is ∂x∂y = ∂x∂y =0. Example 2b: Consider the function F (x, y)=xy x2 y2. The partial derivative of ∂F − − F (x, y) with respect to x is ∂x = y 2x. The partial derivative of F (x, y) with respect to y ∂F − ∂2F is ∂y = x 2y. The second derivative with respect to x is ∂x2 = 2. The second derivative − ∂2F ∂−2F ∂2F with respect to y is ∂y2 = 2. The cross-partial derivative is ∂x∂y = ∂y∂x =1.Youcan ∂2F ∂−2F verify directly that ∂x∂y = ∂y∂x. Example 2c: This example discusses how the total change rule can fail. Consider the function F(x, y)=√xy,nearx = y =0.SinceF (x, 0) = F (0,y)=0for all x and y,we ∂F ∂F have that at x = y =0, the partial derivatives of F are ∂x (x,y)=(0,0) = ∂x (x,y)=(0,0) =0 ¯ ¯ 4 ¯ ¯ F(x) dF F(x) = 0 dx x=x*

dF = 0 dx x=x*

x x x x* x’ x x* x’

Figure 2:

(you can see this using the definition of the partial derivatives). However, for any ∆ > 0, F(∆, ∆)=∆. Therefore a proportional increase of x and y leads to a proportional increase in F ,whichat(x, y)=(0, 0) contradicts the total change rule given above. The total change ∂F √y rule fails, because the partial derivatives are not continuous near (0, 0): ∂x = 2√x for x>0, and ∂F = √x for y>0.At(x, y)=(0, 0) these partial derivatives are zero, but nearby, ∂y 2√y they can become arbitrarily large. Exercise 2: Find the first- and second-order partial derivatives, and the cross-partial derivatives of (i) F (x, y)=xy, (ii) F (x, y)=x2y3,and(iii) F (x, y)=2xy x2 2y2 3x y. − − − −

2.3 Concavity and convexity As you can see from figure 2, not every flat point of a function is a maximum; some are minima. To identify , we need the additional concepts of concavity and convexity.Wedefine these concepts graphically in figure 2: A single-valued function F (x) is convex, if for any two points x and x0, the line segment connecting x and x0 lies above the function. A function is concave, if for any two points x and x0, the line segment connecting x and x0 lies below the function. A function is said to be strictly concave or convex, if the above comparison is strict. Figure 2 provides an illustration of a (left panel), and a concave function (right panel). Convexity and concavity translate into a simple second derivative condition: A function dF d2F is convex, if and only if dx is increasing in x,or dx2 > 0. Similarly, a function is concave, if dF d2F and only if dx is decreasing in x,or dx2 < 0. The graphical definition of convexity and concavity can directly be extended to multivari- ate functions, and they also translate into a second derivative condition: A function F (x, y)

5 is concave, if ∂2F ∂2F ∂2F ∂2F ∂2F 2 < 0 and < 0,and > ∂x2 ∂y2 ∂x2 · ∂y2 ∂x∂y µ ¶ µ ¶ for all (x, y), i.e. a multivariate function is concave, if it is concave with respect to each of its variables, and an additional condition is satisfied that the product of the second-order partial derivatives is larger than the square of the cross-partial derivatives (intuitively, this condition guarantees that F is concave not only along the x or the y direction, but also with respect to any combination of the two). Similarly, a function is convex, if

∂2F ∂2F ∂2F ∂2F ∂2F 2 > 0 and > 0,and > ∂x2 ∂y2 ∂x2 · ∂y2 ∂x∂y µ ¶ µ ¶ for all (x, y).Youcanfind a full derivation and explanation of these derivative conditions in Nicholson (chapter 2).

2.4 Level curves and implicit functions For multi-variate functions, we are often interested in the shape of a function’s level curves. For a function F (x, y), the level curves are defined by the equation F (x, y)=K,fordifferent values of K. The level curve associated with a value of K gives you the points (x, y),for which the function F (x, y) just attains the value K. The level curve thus describes an between the variables x and y: The level curve describes a functional relation between x and y without making it explicit by writing y = f (x, K). Sometimes, it may be possible to rearrange the level curve so that the relation becomes explicit, i.e. we can rearrange F (x, y)=K into something of the form y = f (x, K) or x = f (y, K). Oftentimes, however, this may be impractical or infeasible. In figure 3, I have drawn level curves for two different functions. the functions F (x, y)=x + y (left panel) and F (x, y)= 11 + y (14 y)+2x (right panel). In the first case, the level curve associated with K represents− a straight line, described by x + y = K, and you can easily make this relation explicit: x = K y. The second example, you may recall, exactly is the function determining the grade of our− student. Here, you see that it is impossible to express y as a function of K and x. In many cases, we are interested in the slope of the level curve that goes through a particular point (x, y). Intuitively, this slope indicates by how much one variable (say x)has to change in response to a small change by y, so that the function maintains the same level. In the case of the student’s grade, the slope of the level curve indicates how much more (or less) the student has to sleep, if she decided to study one second less, if she still wants to obtain the same grade. If we have an explicit definition of the function, we can findthisslopebysimplytaking the derivative. For some implicit functions, however, it is impossible to make the functions explicit, but we would still like to know its derivative in a certain point. Even when we have

6 y y

K increasing K increasing 7

x x

Figure 3: only an implicit definition of the function, we can find its derivative: Mathematically, this derivative is given by the expression dx ∂F = ∂y dy ∂F F (x,y)=K Ã− ∂x !¯ µ ¶¯ ¯F (x,y)=K ¯ ¯ This is a general result called the ¯Implicit function theorem¯ , and applies for any implicitly ¯ ¯ defined function F (x, y)=K. It states that the slope of an implicit function in a point is simply given by minus the ratio of the partial derivatives of F (x, y) at that point. You can convince yourself from the following linear example, why this condition has to hold: Example 3a: Suppose F (x, y)=ax + by. The level curves of this function are given by ax + by = K,fordifferent values of K.Notethateachlevelcurveimplicitlydefines a linear relation between x and y. You can rearrange the terms to make this linear relation explicit: K b dx b x = a a y.Differentiating, you find that dy = a . Alternatively, you could − F (x,y)=K − ³ ´¯ ∂F have found the slope of the level curves directly from the above expression. Since ∂x = a ¯ ∂F ∂F dx ¯ ∂y b and ∂y = b, you immediately find that dy = ∂F = a . F (x,y)=K − ∂x − ³ ´¯ To see why the Implicit function theorem¯ holds generally, consider a small change dx in ∂F ¯ x. This will change F (x, y) by ∂x dx. To maintain the relation F (x, y)=K, y then has to ∂F change. A small change dy in y changes F (x, y) by ∂y dy.TomaintainF (x, y)=K,these two effects have to exactly offset each other, or ∂F ∂F dx = dy ∂x − ∂y Rearranging terms, we find dx ∂F = ∂y dy ∂F F (x,y)=K Ã− ∂x !¯ µ ¶¯ ¯F (x,y)=K ¯ ¯ ¯ ¯ ¯ 7 ¯ Example 3b: Return to the example of the student studying for her exam, where F (x, y)=11+y (14 y)+2x. There are several ways to obtain a certain grade; for example, you can check that the− student can reach 70 by either sleeping 7 hours and studying 5 hours, or by sleeping 5 hours and studying 7.Fordifferent grades K,wehavedrawnthelevel curves F (x, y)=K of values (x, y) along which the student attains a grade of K in the right panel of figure 3. To find the slope of the level curves, we can either solve F (x, y)=K for x as a function of y (you can convince yourself from the picture that the opposite will not be possible, i.e.we can’t express y as a function of x),andthendifferentiate, or we can apply the implicit function theorem. Solving for x as a function of y gives K 11 1 K =11+y (14 y)+2x,sox = − + y2 7y − 2 2 − and differenciating with respect to y gives dx = y 7 dy − Applying the implicit function theorem directly yields

∂F dx ∂y 14 2y = = − = y 7. dy − ∂F − 2 − ¯F (x,y)=K ∂x ¯ ¯ The slope that you see in the¯ graph is the change of y as x changes, which is given by the dy 1 inverse, dx F (x,y)=K = y 7 . − Exercise¯ 3: Let F (x, y)=xy and consider the implicit function F (x, y)=5.Finddx ¯ dy in two different ways, first by applying the implicit function theorem, then by rewriting x as an explicit function of y and taking derivatives.

3 Unconstrained Optimization

3.1 Single variable functions Return to the graph of the derivative in figure 1. You can see that the function reaches its maximum in x∗. In this point, the line to the curve is flat, i.e. the derivative of F with respect to x is zero at x∗.Ifweincreasex slightly, the derivative becomes negative and the function decreases. If we decrease x slightly, the derivative becomes positive, and the decrease in x decreases F as well. Therefore, we can identify potential maxima by noting that dF =0 dx ¯x=x∗ ¯ ¯ ¯ 8 F(x) F(x) F(x)

dF = 0 dx x=x*

dF = 0 dx x=x*

x* x x* x

Figure 4:

has to hold at the maximum point x∗. We call this condition the First-order condition. The first-order condition is necessary but not sufficient - note that the first-order condition is also satisfied at a local minimum of F, as you can see in the left panel of figure 4, or at a flat point of the increasing function in the right panel. We need the additional second-order condition that

d2F < 0. dx2 ¯x=x∗ ¯ This second order condition states that at the¯ maximum, the firstderivativeofthefunction ¯ has to be decreasing. Note that this was the case above: at x∗,thefirst derivative is 0,for higher values of x∗, it is negative, and for lower values of x∗, it is positive. If x∗ were a local d2F minimum, the second derivative satisfies dx2 > 0, since the first derivative is negative x=x∗ for lower values of x, and positive for higher values¯ of x, i.e. the first derivative is increasing. ¯ ¯ Example 4: In the example of the profit-maximizing firm above, the optimal quantity dF q∗ solves = p q∗ =0,orq∗ = p. We observe that the second order condition is satisfied, dq − since d2F = 1 < 0. dq2 − d2F If the function satisfies dx2 < 0 everywhere, the local maximum is also a global maximum. d2F Recall that this condition implies that the function is concave. If the function satisfies dx2 > 0 everywhere, it is convex, and the local minimum is also a global minimum. Throughout this course, we will almost always be concerned with functions that satisfy the second-order conditions, i.e. we will maximize strictly concave functions, and minimize strictly convex functions. Nevertheless, you should always keep in mind the second order condition.

Exercise 4: Solve for the optimal quantity q∗ in the example of the profit maximizing 1 2 firm, but change the cost function so that C (q)= 2 bq for an arbitrary value of b (above, I considered the case where b =1). Check that the second-order condition is satisfied.

9 3.2 Multivariate functions For a function F (x, y), we identify a local optimum by setting the partial derivatives equal to zero. Think of a multivariate function F (x, y) as representing a “surface”, i.e. F (x, y) determines the height of the surface at the coordinates (x, y). At a local optimum, the partial derivatives in every direction have to be zero, i.e. there can be no direction in which you can “climb higher” (or in other words, the “top of a hill” has to be “flat” in every direction). Thus,alocalmaximum(x∗,y∗) is determined by the set of first-order conditions

∂F ∂F =0and =0 ∂x ∂y ¯(x,y)=(x∗,y∗) ¯(x,y)=(x∗,y∗) ¯ ¯ ¯ ¯ Again, this is not sufficient.¯ We need a second derivative¯ condition to hold as well at a local maximum (again, the local minima or turning points also satisfy the first-order conditions). Without going into the mathematical details (cf. p. 50-51 of Nicholson for a more elaborate discussion), the second-order conditions required for a maximum are

∂2F ∂2F < 0, < 0 ∂x2 ∂y2 µ ¶¯(x,y)=(x∗,y∗) µ ¶¯(x,y)=(x∗,y∗) ¯ ¯ ∂2F ∂2F ¯ ∂2F 2 ¯ ¯ > ¯ ∂x2 · ∂y2 ∂x∂y (x,y)=(x∗,y∗) ¯ µ ¶¯ µ ¶ ¯(x,y)=(x∗,y∗) ¯ ¯ ¯ ¯ If the second-order conditions¯ are satisfied for every pair¯ (x, y),thenF (x, y) is concave (recall the above discussion of concavity!), and the local optimum is also a global optimum. Similarly, a local minimum is attained, if at the solution to the first-order condition,

∂2F ∂2F > 0, > 0 ∂x2 ∂y2 µ ¶¯(x,y)=(x∗,y∗) µ ¶¯(x,y)=(x∗,y∗) ¯ ¯ ∂2F ∂2F ¯ ∂2F 2 ¯ ¯ > ¯ ∂x2 · ∂y2 ∂x∂y (x,y)=(x∗,y∗) ¯ µ ¶¯ µ ¶ ¯(x,y)=(x∗,y∗) ¯ ¯ ¯ ¯ If this second-order condition is¯ satisfied everywhere, then¯ F (x, y) is convex, and the local optimum is also a global optimum. Example 5: Return to the function F (x, y)=xy x2 y2 that we saw in example 2. We want to maximize this function with respect to x −and y−. Setting the first derivatives equal to zero leads to a pair of linear equations in two unknowns, x∗ and y∗: ∂F = y∗ 2x∗ =0 ∂x − ¯(x,y)=(x∗,y∗) ¯ ∂F ¯ ¯ = x∗ 2y∗ =0 ∂y − ¯(x,y)=(x∗,y∗) ¯ ¯ ¯ 10 y

x

Figure 5:

If you solve these two equations in two unknowns, you find x∗ = y∗ =0as a solution. You can also check the second-order condition, and you find that

∂2F ∂2F = 2 < 0, = 2 < 0,and ∂x − ∂y2 − µ ¶¯(x,y)=(x∗,y∗) µ ¶¯(x,y)=(x∗,y∗) ¯ ¯ ¯ ¯ ∂2F ∂2F ¯ ∂2F 2 ¯ =( 2) ( 2) 12 =3> 0. ∂x2 · ∂y2 − ∂x∂y − · − − (x,y)=(x∗,y∗) ¯ µ ¶¯ µ ¶ (x,y)=(x∗,y∗) ¯ ¯ ¯ ¯ ¯ ¯ Exercise 5: Find the maximum of F (x, y¯)=2xy x2 2y2 3x y by solving the pair of first-order conditions. Verify the second-order conditions− − to check− that− this is a maximum.

4 Constrained Optimization

While the above techniques enable us to deal with unconstrained optimization problems, such as the profit-maximizing firm’s, they are not directly applicable to handle additional constraints. For example, in the student’s example, the unconstrained optimal solution would be to sleep the ideal amount (which is 7 hours), and study an infinite amount of time toraisethegradeasmuchaspossible-clearlythisisnotfeasible,sincethereisalimited amount of time the student has until the exam. Figure 5 illustrates graphically the solution to constrained optimization problems. The thin curved lines represent the level curves of the objective function; the further a curve is located to the north-east, the higher the level of the function associated with that curve. The thick line represents the constraint; the choice of x and y has to stay on or to the south-west of the thick line. You can easily convince yourself that the optimum is reached

11 at the point, where the constraint is exactly tangent to the level curve through that point, i.e. the level curve and the constraint have the same slope: for any other point within the constraint, it would be feasible to move to another point on a higher level curve, while still satisfying the constraint. The slope of the constraint indicates the marginal change in y that is needed, if one were to marginally change x and still satisfy the constraint. And the slope of the objective function’s level curve indicates the marginal change in y that is required to maintain the same level of the objective, if one were to marginally change x. The condition is thus saying that at the optimum, a marginal change in x and y along the constraint has no marginal effect on F (if it did, it would be feasible to increase F by moving in one direction or the other along the constraint). I next discuss two methods to formally derive the solution of a constrained optimization problem.

4.1 The substitution method In some cases, we may be able to rearrange the constraint so that one choice variable is expressed as a function of the other, i.e. we can rewrite g (x, y)=0as x = g (y).Ifthatis the case, we can simply substitute the constraint into the optimization problem directly to reduce the problem to a single-variable problem. In other words, the problemb max F (x, y) subject to g (x, y)=0 x,y becomes max F (g (y) ,y) y Thus,wehavetransformedtheproblemwithtwo variables and one constraint into a single- b variable optimization problem without constraint, which we can solve by taking the first- order condition for y.Oncewehavedeterminedy, we can then solving back for x = g (y). The first-order condition for this optimization problem requires that

∂F (g (y) ,y) ∂F (g (y) ,y) b g (y)+ =0, ∂x 0 ∂y b b ∂F b ∂y or g0 (y)= ∂F − ∂x The left-hand side of this condition gives you the slopeb of the constraint (solving for x as a function of y). By the implicit function theorem, the right-hand side gives you the slope of the level curve of F at the optimum. The first-order condition states that these two must be equal, just as we had already seen in figure 5. The following example illustrates step by step how to use the substitution method in the case of the student example.

12 Example 6: Consider the student’s time allocation problem. There, the constraint was g (x, y)=12 x y =0.Wefirst rearrange this to express x as a function of y: − − x =12 y = g (y) − We now substitute this into the objective function for the grade: b F (x, y)=11+y (14 y)+2x − F (g (y) ,y)=11+y (14 y)+2(12 y) − − =35 y2 +14y 2y − − b =35 y2 +12y − Taking the first order condition with respect to y,wefind dF = 2y +12 dy −

dF Setting dy =0,wefind y =6and x = g (y)=12 6=6. Hence, the student will choose to sleep six hours, and study six hours. She will expect− a grade of 35 36 + 72 = 71. − Exercise 6: Solve the student’s timeb allocation problem using the substitution method, but suppose that each additional hour studied raises her grade by 4 points. The objective function then becomes F (x, y)=11+y (14 y)+4x. −

4.2 The Lagrangian method Oftentimes, it is more convenient to form what is called a “Lagrangian”. The Lagrangian is afunctionofthechoicevariablesx, and the , denoted λ. Mechanically, theLagrangianisformedasfollows:

L (x, y; λ) F (x, y)+λg (x, y) ≡ i.e. we take the objective function, and add on the constraint, which we premultiply by a new variable, the Lagrange multiplier. We now take the first-order conditions of the Lagrangian function with respect to x, y and λ,whichgives ∂L ∂F ∂g = + λ =0 ∂x ∂x ∂x ∂L ∂F ∂g = + λ =0 ∂y ∂y ∂y ∂L = g (x, y)=0 ∂λ This is a system of equations (one equation for each choice variable, and the constraint) that we can solve for the solution (x∗,y∗,λ∗).

13 Using the conditions from the Lagrangian, we can again recover the optimality condition that we saw in figure5,whichequatedtheslopeoftheconstrainttotheslopeofthelevel curves of F . Combining the Lagrangian’s first-order conditions, we find

∂F ∂F ∂x ∂y λ = ∂g = ∂g . − ∂x − ∂y If we further rearrange terms, we find

∂g ∂F ∂x ∂x ∂g = ∂F − ∂y − ∂y The left-hand side of this equation gives you the slope of the constraint. At the optimum, this has to be equated to the slope of the level curve that goes through the solution (which you find on the right-hand side). This is exactly the condition that we found graphically in figure 5. Example 7: Let us again consider the student’s time allocation problem, but use the Lagrangian method this time. The student’s Lagrangian is

L (x, y; λ)=F (x, y)+λg (x, y)=11+y (14 y)+2x + λ [12 x y] − − − The first-order conditions are ∂L =2 λ ∂x − ∂L =14 2y λ ∂y − − ∂L =12 x y ∂λ − − ∂L Setting these three equal to zero, we can solve for (x∗,y∗,λ∗): ∂x =2 λ∗ =0provides the ∂L − solution for λ∗,i.e. λ∗ =2. We substitute this into ∂y =14 2y∗ λ∗ =12 2y∗,and ∂L − − − hence we find y∗ =6. Wethensubstitutethisinto ∂λ =12 x∗ y∗ =0to find x∗ =6. This is of course identical to the previous solution. − − Exercise 7: Solve the student’s time allocation problem, when each hour studied raises the grade by 4 points. But this time, use the Lagrangian method.

4.3 Second-order conditions As you might have guessed, to guarantee that the solution to a constrained optimization problem is actually a maximum (or a minimum), we again need to check that a second order condition is satisfied. Throughout this course, we will predominantly consider two kinds of constrained optimization problems: If we consider a maximization problem, we will have

14 y y

x x

Figure 6: constraints that are either linear or concave. In that case, it is sufficient that the objective function has convex level curves.Ifweconsideraminimization problem, we will typically have a linear or convex constraint, and have concave level curves. I have drawn the two cases in figure 5. Each time, the thick line represents the constraint that has to be satisfied, and the thin lines represent level curves for the objective function. In both panels, the objective function is increasing, as x and y increase - hence, the higher level curves represent higher values of the objective function. In the left panel, I have drawn the curves for the maximization problem; you see that the constraint is concave, and the level curves are convex. In the right panel, I have drawn the curves for the minimization problem, where the constraint is convex, and the level curves are concave. In both cases, the optimum is reached, when the slope of the level curve equals the slope of the constraint. This was also what we found from solving the Lagrangian problem above.

5 Additional Problems

Nicholson, chapter 2, problems 2.1, 2.3-7. Note the typo in the first line of 2.5: The first line should read: Suppose U (x, y)=4x2 +3y2 Additional problem: For each of the functions F (x, y)=√xy, F (x, y)=√x + √y and F (x, y)=x2 + y2, carry out the following calculations: (i) define the level curves, for arbitrary levels K. Find the derivative of the level curve, and check whether the level curve is concave or convex. (ii) compute the first-order partial derivatives with respect to x and y. (iii) Consider the constrained optimization problem maxx,y F (x, y) subject to the con- straint that x + y =1.

15