Math for economyMM1005

How to find your way

  1. 1Search for the word that confuses you — the box at the top searches the whole course.
  2. 2Look it up in Concepts. Every concept links to the section that explains it. Concepts →
  3. 3Read the Watch out and Common error boxes: they show the mistakes that are actually made.
  4. 4Still stuck? Bring the question to the exercise session or send an email.

Lecturer: Eric Ahlqvist, eric.ahlqvist@math.su.se · Put “MM1005” in the subject line.

← 9
Lecture 10 Two directions are not enough
11 →
10 Optimisation

Two directions are not enough

Where both partial derivatives of a function are zero, the surface is flat in the direction of each axis. Is that the top? And if the surface curves downwards along both axes, is it the top then?

Lecture 9 learned to read a contour map and to walk across it. This lecture looks for the top.

It runs the same arc as Lecture 6 did in one variable: necessary conditions first, then sufficient ones. Half of it is therefore revision in new clothes, and worth recognising as such. The other half is not. The obvious two-variable version of the one-variable second-derivative test is false, and the title says why: a point can look like a maximum along the $x$-axis and along the $y$-axis and be neither, because there are infinitely many directions and you have checked two.

⏱ 65 min read§ 6 sections

After this lecture you can

  • find the critical points of a function of two variables by solving $f'_{1}=0$ and $f'_{2}=0$ together, also when a cross term ties the two equations
  • say why a critical point is only a candidate, and show that one is not a maximum by walking along a line through it
  • write down the firm's conditions $pF'_{K}=r$ and $pF'_{L}=w,$ and say in words what they mean
  • test concavity or convexity on a convex set with the three conditions (10.2), and conclude that a critical point is a global maximum or minimum
  • optimise under a constraint $x+y=c$ by substitution, and find the largest and the smallest value on a segment, endpoints included
1

Where a maximum can be

Both partials of $x^{2}-y^{2}$ vanish at the origin. Is the origin the top, the bottom, or neither?

In one variable a maximum inside an interval has a horizontal tangent (Fact 6.13). With two variables there are two partial derivatives, $f'_{1}$ and $f'_{2}$ (Lecture 8), one for each direction along an axis. The first question is what they must do at a top.

Fact 10.1First-order conditions#

Let $f$ have a maximum or a minimum at an interior point $(x_{0},y_{0})$ of its domain, and let both partial derivatives exist there. Then $$ \begin{aligned} &f'_{1}(x_{0},y_{0}) = 0 \\ &\qquad\text{and}\qquad f'_{2}(x_{0},y_{0}) = 0\,. \end{aligned} $$

The words are the same as in Lecture 6, where a critical point of a function of one variable was a point with $f'(c)=0$ (Definition 6.12). Now both partials must vanish at the same point.

Guess first. The question below is the notes' next example. Answer it before you read the solution.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

$$f(x, y) = x^{2} - y^{2}$$

Both partials vanish at the origin. Is the origin a maximum, a minimum, or neither?

Example 10.4

Two directions that disagree

Both partials of $f(x,y)=x^{2}-y^{2}$ vanish at the origin. Is the origin a maximum, a minimum, or neither?

Try it yourself first. Then open one step at a time.

A critical point of the kind in Example 10.4 is called a saddle point: the middle of a horse's back, or a mountain pass, which really is simultaneously a highest point and a lowest one depending on which way you face. Lecture 11 defines the term precisely and gives the test that sorts critical points into the three possible kinds.

Those three kinds are all there are, and on a contour map they look nothing alike. A local maximum shows as closed loops with the numbers rising inwards; a local minimum as closed loops with the numbers rising outwards; and a saddle point as contours that cross. Often the map settles the question before any algebra is done. Every Himalayan summit is a local maximum and only Everest is the global one; the deepest point of each lake is a local minimum; and every pass between two peaks is a saddle.

The three kinds of critical point on a contour map. Left, $z=-x^{2}-y^{2}{:}$ loops, numbers rising inwards (a maximum). Middle, $z=x^{2}+y^{2}{:}$ loops, numbers rising outwards (a minimum). Right, $z=x^{2}-y^{2}{:}$ the contours cross (a saddle).
Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

On the square $0\le x\le1,$ $0\le y\le1,$ the function $f(x,y)=x+2y$ has its largest value $f(1,1)=3$ at the corner $(1,1).$ There $f'_{1}=1$ and $f'_{2}=2.$ What does this say about Fact 10.1?

2

What the firm's rule says

A firm can take on one more worker. When should it stop hiring?

The application this chapter is built around is the firm choosing capital $K$ and labour $L.$ If output sells at price $p,$ capital costs $r$ per unit and labour $w$ per unit, profit is $$ \pi(K,L) = p\,F(K,L) - rK - wL\,, $$ and Fact 10.1 gives the two conditions $$ p\,F'_{K} = r \qquad\text{and}\qquad p\,F'_{L} = w\,. \tag{10.1} $$ Read the second one in words: hire until the extra output the last worker produces is worth exactly the wage. Above that point an extra worker brings in more than they cost, below it less. That is not a formula to memorise but a one-line marginal argument: hiring $\ell$ more workers raises revenue by about $pF'_{L}\ell$ and costs $w\ell,$ so at the optimum the two are equal. The units confirm the shape — money per unit of output times units of output per worker is money per worker, which is what a wage is — and dividing (10.1) by $p$ gives $F'_{L}=w/p{:}$ the marginal product of labour equals the real wage.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

A firm's profit-maximising condition for labour is $$p\,F_L' = w$$

What does it say the firm should do?

The value of the marginal product $pF'_{L}$ falls as more workers are hired. Hire while it is above the wage $w;$ stop at $L^{*},$ where the two are equal.
Recap The economics words
wordwhat it is
marginal product of labour $F'_{L}$the extra output from one more worker
value of the marginal product $pF'_{L}$that extra output, valued at the price $p$
average product $F/L$output per worker
real wage $w/p$the wage measured in units of output
wage bill $wL$what all the workers together cost
break-evenrevenue equal to cost: zero profit, not maximum profit
Example 10.6

A two-product firm

A firm makes $x$ units of good A and $y$ of good B at total cost $$ \begin{aligned} C(x,y) &= 0.04x^{2} + 0.01xy + 0.01y^{2}\\ &\quad + 4x + 2y + 500\,, \end{aligned} $$ selling A at $15$ and B at $9.$ Find the candidate for maximum daily profit.

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

Find the critical point of $$\pi(x,y)=10x+8y-x^{2}-xy-y^{2}\,.$$

3

Two directions are not enough

$3xy-x^{2}-y^{2}$ curves downwards along the $x$-axis and along the $y$-axis. Is the origin its top?

In one variable, $f'(c)=0$ together with $f''(c)<0$ settles the question. The obvious generalisation would be that both partials vanish, $f''_{11}<0$ and $f''_{22}<0.$ It is false, and one function shows it.

Recap The notation for second-order partials

Lecture 8 differentiated twice. For $f(x,y)$:

  • $f''_{11}$ is the partial of $f'_{1}$ with respect to $x,$ the second derivative along the $x$-direction;
  • $f''_{22}$ is the partial of $f'_{2}$ with respect to $y,$ the second derivative along the $y$-direction;
  • $f''_{12}=f''_{21}$ is the partial of $f'_{1}$ with respect to $y,$ the cross-partial.

For $f=3xy-x^{2}-y^{2}{:}$ $f'_{1}=3y-2x$ and $f'_{2}=3x-2y,$ so $f''_{11}=-2,$ $f''_{22}=-2$ and $f''_{12}=3.$

Guess first. Answer the question below before you read the example after it.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

For $f(x,y) = 3xy - x^{2} - y^{2}$, both partials vanish at the origin and $$f_{11}'' = f_{22}'' = -2 < 0$$ so $f$ has a maximum along the $x$-axis and along the $y$-axis.

Does $f$ have a maximum at the origin?

Example 10.7

Concave along both axes, and not a maximum

Let $f(x,y) = 3xy - x^{2} - y^{2}.$ Both partials vanish at the origin, and $$ f''_{11} = f''_{22} = -2 < 0\,, $$ so $f$ is concave along the $x$-axis and along the $y$-axis. Is the origin a maximum?

Try it yourself first. Then open one step at a time.

Left, the contours of $3xy-x^{2}-y^{2}$ cross at the origin. Right, $f$ along a line through the origin: a downward parabola along either axis, an upward one along $y=x.$
Try it yourself

Every direction at once

Four functions, all with both partials zero at the origin. Left is the contour map with a ray through the origin, in the middle $f$ along that ray, and on the right how $f$ curves in every direction at once: outside the dashed circle the ray curves up, inside it curves down.

  1. With the first function, “a maximum”, press spin. The curve on the right stays inside the circle: every direction curves down.
  2. Press the button with the function's name until it reads “an obvious saddle” ($x^{2}-y^{2}$), and spin again. The curve crosses the circle: some directions curve up, some down.
  3. Go on to “the sneaky one” ($3xy-x^{2}-y^{2}$). Set the direction to $0°$ and to $90°{:}$ both look like a maximum. Now set it to $45°,$ the diagonal: a valley.
  4. Under the picture, $A,$ $B$ and $C$ are $f''_{11},$ $f''_{12}$ and $f''_{22},$ and $AC-B^{2}$ is the left-hand side of the third condition in the next section. Watch its sign as you change function: it is negative exactly when the curve crosses the circle.

Fixing this needs a condition that controls every direction at once, and the right one is a two-variable version of the concavity of Lecture 6. That is what the next subsection supplies.

4

Concavity in two variables

Which condition, checked once, controls how $f$ curves in every direction at the same time?

Lecture 6 defined a concave function of one variable by the chord condition, and proved that an interior stationary point of a concave function is a global maximum. Everything here is the same statement with pairs in place of numbers — but one preliminary is needed that one variable did not require.

A disc, a rectangle, a half-plane and the whole plane are convex; a ring, a crescent and any set with a hole or a notch are not. The reason the notion is needed at all is that the definition below evaluates $f$ at points on the segment between two points of the domain, and unless the domain is convex those points may not be in it, leaving the inequality meaningless.

(A convex set is a property of a set; a convex function, as in Lecture 6, is a property of a function. The two words are the same and the ideas are different.)

Fact 10.11The two-variable concavity criterion#

Let $f$ have continuous second-order partial derivatives on a convex set $S$. Then $f$ is concave on $S$ if and only if, at every point of $S$, $$ \begin{aligned} &f''_{11}\le0\,, \\ &f''_{22}\le0\,, \\ &f''_{11}f''_{22} - \bigl(f''_{12}\bigr)^{2} \ge 0\,. \end{aligned} \tag{10.2} $$ Reversing the first two inequalities, and keeping the third, characterises convexity.

The first two conditions are the ones anybody would guess, and Example 10.7 showed they are not enough on their own. The third is the new one and it does all the work: it caps how far the surface may twist. For $3xy-x^{2}-y^{2}$ it fails, and by exactly the right amount, since $(-2)(-2)-3^{2} = -5 < 0.$

Guess first. Work the question below out from (10.2) before you read on.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

At a critical point, $f_{11}'' = -1$ and $f_{22}'' = -4$.

For the concavity test to certify a maximum, what must be true of the cross-partial $f_{12}''$?

Example 10.16

What the third condition is for

At a critical point, $f''_{11}=-1$ and $f''_{22}=-4.$ What must be true of $f''_{12}$ for (10.2) to certify a maximum?

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

Is $f(x,y)=-x^{2}+4xy-5y^{2}+2x$ concave on the whole plane?

5

Concavity decides, globally

Example 10.6 found the candidate $(100,300).$ What does it take to call it the best plan?

Concavity is worth checking because of what it buys: the same conclusion as Lecture 6's Fact 6.20, with a plane in place of a line.

Fact 10.13Concavity decides, globally#

If $f$ is concave on a convex set $S$ and $(x_{0},y_{0})$ is an interior critical point, then $(x_{0},y_{0})$ is a maximum point for $f$ over the whole of $S$. If $f$ is convex, such a point is a minimum over the whole of $S$.

Example 10.15

The two-product firm, finished

Finish Example 10.6: show that $(100,300)$ really is the profit-maximising plan.

Try it yourself first. Then open one step at a time.

For a minimum the same steps run with the first two inequalities of (10.2) reversed: a convex function on a convex set has its global minimum at every interior critical point.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

Let $f(x,y)=2xy-x^{2}-y^{2}.$ Both partials vanish at the origin, and $f''_{11}=f''_{22}=-2,$ $f''_{12}=2.$ What is the origin?

6

What a constraint does

The best plan totals $400$ units. If at most $320$ are allowed, where is the best plan now?

Real problems come with constraints, and a constraint moves the answer.

Guess first. The firm of Example 10.6 is now held to a total of $320$ units. Choose a method before you read on.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

A firm's profit is maximised at $(x, y) = (100, 300)$. It is now restricted to $x + y = 320$.

What is the right way to find the new best plan?

When the constraint can be solved for one of the variables there is a cheap way through: substitute, and a constrained two-variable problem becomes an unconstrained one-variable problem of the kind Lecture 6 already handles.

Example 10.20

A cap on total output

The firm of Example 10.6 is now restricted to total output $x+y=320.$ Find the best available plan.

Try it yourself first. Then open one step at a time.

The line $x+y=320$ touches the profit contour $1040$ at $(90,230).$ The scaled plan $(80,240)$ is on the line too, but on a lower contour.

The line in Example 10.20 runs on for ever, but output cannot be negative. The plans that are really available are the segment $x+y=320,$ $x\ge0,$ $y\ge0,$ and a segment has two ends. On a closed interval Lecture 6 compared the stationary points with the endpoints (Method 6.15); after the substitution that is exactly the situation here.

Example

Largest and smallest on a segment, endpoints included

This example is the app's; it joins Method 10.19 to Method 6.15 of Lecture 6, and nothing in it is new. The firm of Example 10.6 must produce exactly $c$ units in total, with $x\ge0$ and $y\ge0.$

(a) For $c=320,$ find the largest and the smallest value of $\pi$ on the segment.

(b) For $c=40,$ find the best plan.

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

What is the largest value of $f(x,y)=x^{2}+y^{2}$ on the segment $x+y=4,$ $x\ge0,$ $y\ge0$?

Lecture 11 turns that tangency picture into a method that works whether or not the constraint can be solved.

What you should take away

  • At an interior extreme point both partials vanish — Lecture 6's theorem applied once per variable. Such a point is a critical point, and the condition is necessary and not sufficient for the sixth time this term.
  • There are exactly three kinds of critical point: local maximum, local minimum and saddle. On a contour map they are loops rising inwards, loops rising outwards, and crossing contours.
  • The firm's rule $pF'_{L}=w$ says: hire until the last worker's extra output is worth the wage. Dividing by $p,$ marginal product equals the real wage.
  • Two directions are not enough. $f=3xy-x^{2}-y^{2}$ has $f''_{11}=f''_{22}=-2$ and $f(t,t)=t^{2}{:}$ concave along both axes and a valley along the diagonal.
  • A set is convex if it contains the segment between any two of its points, and $f$ is concave on such a set if chords lie below the graph. That holds if and only if $f''_{11}\le0,$ $f''_{22}\le0$ and $f''_{11}f''_{22}-(f''_{12})^{2}\ge0$ throughout. Only the square of the cross-partial appears, so its sign never matters.
  • Concavity throughout a convex domain turns every interior critical point into a global maximum, because the tangent plane lies above the graph and at a critical point it is horizontal. The conditions must hold everywhere; at a single point the verdict is only local.
  • A constraint moves the answer, and at a constrained optimum the partials are not zero. If the constraint can be solved for one variable, substitute and the problem becomes one-variable.

Think further

Questions without computation. Think on your own or with a classmate before opening the thought.

  1. Discussion question 1 — two true statements that settle nothing

    Both partials of $f(x,y)=x^{2}-y^{2}$ vanish at the origin. Is it a maximum, a minimum, or neither? Two of the wrong answers are true statements — which, and why do they settle nothing?

    One way to think about it

    Neither (Example 10.4). The two wrong answers built on true statements are “a minimum, because $f(x,0)=x^{2}$ has a minimum at $0$” and “a maximum, because $f(0,y)=-y^{2}$ has a maximum at $0$”. Each is right about its own line. But a maximum must beat every point near the origin, and a minimum must lie below every one, and each line is only one of infinitely many directions. Here the two lines even contradict each other: there are points with $f>0$ and points with $f<0$ arbitrarily close to the origin, where $f=0.$

  2. Discussion question 2 — what the hiring rule says

    A firm's condition for labour is $pF'_{L}=w.$ What does it say?

    (A) hire until the wage equals average output per worker;

    (B) hire until the last worker's extra output is worth the wage;

    (C) hire until revenue equals the wage bill;

    (D) hire until output is as large as possible.

    One way to think about it

    (B). $F'_{L}$ is the extra output of one more worker and $p$ turns it into money, so $pF'_{L}$ is what the last worker brings in; the rule stops hiring when that equals what the worker costs, $w.$ (A) uses the average product, not the marginal one (Watch out 10.5). (C) is a break-even condition: it describes zero profit, not maximum profit. (D) is where $F'_{L}=0,$ far past the point where workers stop paying for themselves.

  3. Discussion question 3 — no derivatives needed

    For $f=3xy-x^{2}-y^{2}$ both direct second derivatives are $-2.$ Without differentiating anything, show that the origin is not a maximum.

    One way to think about it

    Substitute $y=x{:}$ $f(t,t)=3t^{2}-t^{2}-t^{2}=t^{2}.$ For every $t\ne0$ this is larger than $f(0,0)=0,$ and $(t,t)$ is as close to the origin as we like. So no neighbourhood of the origin, however small, has its largest value there: the origin is not a maximum (Example 10.7).

  4. Discussion question 4 — a cap on the twist

    At a critical point $f''_{11}=-1$ and $f''_{22}=-4.$ Which values of $f''_{12}$ let the test certify a maximum? Why does the sign of $f''_{12}$ not matter?

    One way to think about it

    The third condition of (10.2) is $(-1)(-4)-\bigl(f''_{12}\bigr)^{2}\ge0,$ that is $\bigl(f''_{12}\bigr)^{2}\le4,$ that is $-2\le f''_{12}\le2$ (Example 10.16). The sign does not matter because only the square of $f''_{12}$ appears: $f''_{12}=-3$ and $f''_{12}=3$ both give $4-9=-5<0$ (Watch out 10.12).

  5. Discussion question 5 — why the domain must be convex

    Why must the domain be convex in Definition 10.10? Give a set for which the inequality would not even make sense.

    One way to think about it

    The inequality evaluates $f$ at $\bigl(\lambda x_{1}+(1-\lambda)x_{2},\,\lambda y_{1}+(1-\lambda)y_{2}\bigr),$ a point on the segment between two points of the domain. If that point is outside the domain, $f$ has no value there and the inequality says nothing. Take the ring $1\le x^{2}+y^{2}\le4.$ The points $(-1.5,0)$ and $(1.5,0)$ lie in it, but the midpoint $(0,0)$ (with $\lambda=\tfrac12$) does not. A function defined only on the ring, such as $\ln(x^{2}+y^{2}-\tfrac12),$ has no value there to compare.

  6. Discussion question 6 — the word that would have failed

    Example 10.15 checked (10.2) and found the conditions held everywhere. Which word in Fact 10.13 would have failed if they had held only at $(100,300)?$

    One way to think about it

    Whole — “a maximum point for $f$ over the whole of $S$”. The Fact needs $f$ concave on $S,$ which by Fact 10.11 means the three conditions at every point of $S.$ Holding at the single point $(100,300)$ they would say something about points near it only: a local verdict, which is Lecture 11's (Watch out 10.14).

  7. Discussion question 7 — why it is not a method

    In Example 10.20, why is “set both partials of $\pi$ to zero and impose $x+y=320$” not a method?

    One way to think about it

    Because it asks three equations to hold in two unknowns (Watch out 10.18). Both partials vanish only at $(100,300),$ and $100+300=400\ne320,$ so no point satisfies all three. At the best available plan $(90,230)$ the partials are not zero: $$ \begin{aligned} \pi'_{1}&=11-7.2-2.3=1.5\,,\\ \pi'_{2}&=7-0.9-4.6=1.5\,. \end{aligned} $$ They are equal, which says that moving one unit from one good to the other changes profit by nothing to first order — the tangency of Lecture 9, which Lecture 11 turns into a method.