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.

← 5
Lecture 6 Existence, and where to look
7 →
6 One variable

Existence, and where to look

The equation $2x=5e^{-x}(1+x^{2})$ cannot be solved by any formula. How can we know that it has a solution at all, and how do we then find it? A firm looks for its best output. How does it know that there is a best one, and where should it look for it?

Something changes today. For five lectures the course has been building machinery; from here on it uses it, and this lecture is where optimisation begins.

It has one shape, and we run it twice. First a theorem promises that something is there; then a method goes and finds it. For roots, the intermediate value theorem promises and Newton's method finds. For maxima, the extreme value theorem promises and the first-order condition finds. The two halves of each pair answer genuinely different questions, and it is worth noticing in advance that mathematics is unusual among subjects in taking the first one seriously at all.

⏱ 65 min read§ 6 sections

After this lecture you can

  • show with the intermediate value theorem that an equation has a solution in a given interval, and with the sign of a derivative that it has exactly one
  • carry out Newton's method by hand, write its iteration for a given $f,$ and say how it can fail
  • say what the extreme value theorem promises, and what it does not say when one of its hypotheses fails
  • find the largest and the smallest value of a function on a closed interval: list the candidates, evaluate, compare
  • decide with the first-derivative test or with concavity that a stationary point is a maximum or a minimum over a whole interval, also an open or unbounded one
  • tell a theorem from its converse and from its inverse, and give the counterexample that separates them
1

A sign change forces a root

A function has $f(-1)=-1$ and $f(1)=1.$ Must it be zero somewhere in between?

Draw a curve from a point below the $x$-axis to a point above it without lifting the pen. Somewhere it has to cross the axis. The first theorem of this lecture, the intermediate value theorem, is that observation made precise — and the precise version says exactly what “without lifting the pen” has to mean.

$f$ is continuous on $[a,b],$ with $f(a)<0$ and $f(b)>0.$ The curve has to cross the axis, at a point $c$ with $f(c)=0.$
Fact 6.1Intermediate value theorem#

Let $f$ be continuous on the closed interval $[a,b]$. Then $f$ takes every value between $f(a)$ and $f(b)$ somewhere on $[a,b]$. In particular, if $f(a)$ and $f(b)$ have opposite signs, there is at least one $c$ in $(a,b)$ with $f(c)=0$.

This is how you learn that an equation has a solution before having any idea how to solve it — which is most of the time, since almost no equation met in practice can be solved in closed form.

Guess first. The next question is the one under the heading of this section. Before you answer, try to find a function that satisfies $f(-1)=-1$ and $f(1)=1$ and is never zero in between.

Check yourself

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

A function $f$ satisfies $f(-1) = -1$ and $f(1) = 1$.

Must there be a $c$ in $(-1, 1)$ with $f(c) = 0$?

Example 6.3

A root nobody has to compute, and a counterexample

(a) Show that $x^{6}+3x^{2}-2x-1=0$ has a solution between $0$ and $1.$

(b) A function satisfies $f(-1)=-1$ and $f(1)=1.$ Must it be zero somewhere in between?

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

When a hypothesis in a theorem looks like decoration, the useful reflex is to go looking for the counterexample that put it there.

Fact 6.1 gives at least one root. Often what is wanted is exactly one, and that is a second and separate job: monotonicity supplies it, since a strictly increasing function takes each value at most once. The pairing is worth recognising as a pattern, because an examiner who writes “show that the equation has exactly one solution” has set two tasks and not one.

Example 6.4

Exactly one solution: two tasks

Show that $2x = 5e^{-x}(1+x^{2})$ has exactly one solution.

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.

How many real solutions does the equation $$ x^{3}+x-1=0 $$ have?

2

Newton's method

We know that $x^{2}=2$ has a solution between $1$ and $2.$ How do we get its digits?

The intermediate value theorem says a root is in there and gives no hint where. Newton's method goes and gets it, and it is nothing but the linear approximation of Lecture 4 used as an algorithm.

Start from a guess $x_{0}.$ Near $x_{0}$ the function is well approximated by its tangent, $y = f(x_{0}) + f'(x_{0})(x-x_{0}).$ We cannot solve $f(x)=0,$ but we can certainly solve the tangent equal to zero: setting $y=0$ and rearranging gives $x = x_{0} - f(x_{0})/f'(x_{0}).$ Call that $x_{1},$ and repeat.

From $x_{0},$ follow the tangent down to the axis: that is $x_{1}.$ Repeat from $x_{1}.$ Three tangents bring the guess almost onto the root.

Guess first. One step by hand, before the worked example does it.

Check yourself

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

Apply one step of Newton's method to $$f(x) = x^{2} - 2, \qquad x_{0} = 2$$

What is $x_{1}$?

Example 6.6

A square root in three steps, and a two-cycle

(a) Find $\sqrt{2}$ by applying (6.1) to $f(x)=x^{2}-2$ from $x_{0}=2.$

(b) Apply it to $f(x)=x^{3}-2x+2$ from $x_{0}=0.$

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

Try it yourself

Newton's method, step by step

The sketch draws each tangent and fills in a table of the iterates.

  1. Press step three or four times for $x^{2}-2$ from $x_{0}=2.$ Watch the error column: it does not shrink steadily, it collapses.
  2. Drag the slider for $x_{0}$ to another starting point and step again. The method still finds $\sqrt2$ in a few steps.
  3. Press the button with the function until it shows $x^{3}-2x+2,$ and step from $x_{0}=0{:}$ the iterates run $0,1,0,1,\ldots$ for ever.
  4. On that function, drag $x_{0}$ to the far left of the slider and press step once. The tangent there is nearly flat, and $x_{1}$ lands far outside the picture.

Example 6.6 iterates with numbers. The iteration can also be written once and for all as a formula in $x,$ and for a square root that formula is worth knowing. The next example is the app's own, not one of the notes'.

Example

Newton's iteration for a square root, in general

Let $c>0$ and $f(x)=x^{2}-c.$ Write the Newton iteration $x-\dfrac{f(x)}{f'(x)}$ as simply as possible, and say what it does.

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.

Which expression is the Newton iteration $x-\dfrac{f(x)}{f'(x)}$ for $f(x)=x^{3}-4,$ simplified?

3

Existence again: the extreme value theorem

The height of a road is a continuous function of the distance along it. Must a stage of a bicycle race have a highest point?

The same shape, the second time round: a theorem that promises, and then a method that finds. This time what is promised is a largest and a smallest value, and first we need the words for them.

These are what a later lecture will call global extreme points: the comparison is against every point of $S,$ not merely against nearby ones.

Recap Closed, open and bounded intervals

The next Fact speaks of a closed and bounded interval. An interval is closed if it contains every endpoint it has, and bounded if both of its ends are numbers.

intervalclosedbounded
$[a,b]$yesyes
$(a,b)$noyes
$[a,b)$noyes
$[a,\infty)$yesno

A square bracket means that the endpoint belongs to the interval, a round one that it does not; $\infty$ is not a number and is never included. So a closed and bounded interval is one of the form $[a,b],$ with $a$ and $b$ real numbers and both of them included. The open interval $(0,1)$ is not closed: neither $0$ nor $1$ belongs to it.

Fact 6.9Extreme value theorem#

If $f$ is continuous on a closed and bounded interval $[a,b]$, then $f$ attains both a maximum and a minimum on $[a,b]$.

All three hypotheses are load-bearing. On $[0,1)$ the function $f(x)=x$ climbs towards $1$ and never arrives, so a domain that is not closed can lose the maximum; on $[0,\infty)$ it climbs for ever, so an unbounded domain can too; and a function with a jump can step over its own maximum. A homely version of the extreme value theorem: the height of a road is a continuous function of distance along it, so any stage of a bicycle race has a highest point and a lowest one.

Three hypotheses, three pictures. Left: the domain is not closed, and the line climbs towards an open circle that it never reaches. Middle: the domain is unbounded, and the curve keeps rising, ever more slowly, without reaching a top value. Right: $f$ is not continuous: it jumps down at the open circle, so the height it was climbing towards there is never taken. Each function has a minimum, at the left end.

Guess first. The next question is a sentence from an exam script. Decide what is wrong with it 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.

From a student's exam script:

"$f$ is continuous on $(0, 1)$, which is not closed. By the extreme value theorem, $f$ has no maximum."

What is wrong with this?

Example 6.11

Not closed is not a verdict

A student writes: “$f$ is continuous on $(0,1),$ which is not closed. By the extreme value theorem, $f$ has no maximum.” What is wrong?

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.

For which of these does Fact 6.9 guarantee a maximum?

4

Where to look

A smooth function has its largest value at a point inside an interval. What does the tangent look like there?

Fact 6.9 promises that a maximum exists. Now the method that finds it. Stand at the top of a smooth hill: the ground there is level, and the tangent is horizontal.

The two names mean exactly the same thing. Economists tend to say critical point; both are used in this course.

Fact 6.13The first-order condition#

Let $c$ be an interior point of an interval on which $f$ is defined, let $f$ be differentiable at $c$, and let $c$ be a maximum or minimum point. Then $f'(c)=0$.

Both qualifiers in Fact 6.13 do real work. Interior: a maximum at an endpoint need not have a horizontal tangent, and generally does not. Differentiable: a function with a corner can have a minimum exactly at the corner, where there is no derivative to set to zero.

Guess first. The next question asks whether the Fact can be read backwards.

Check yourself

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

$f$ is differentiable, $c$ is an interior point of the interval, and $$f'(c) = 0$$

Does $f$ have a maximum or a minimum at $c$?

It is worth stopping on that, because this lecture contains three separate traps and they are all the same trap. A theorem says $P\Rightarrow Q.$ There are exactly two ways to misread it: to conclude $Q\Rightarrow P,$ which is the converse, and to conclude $\lnot P\Rightarrow\lnot Q,$ which is the inverse. Reading the first-order condition backwards is the first; concluding from Example 6.11 that a non-closed interval has no maximum is the second. And they are not two errors but one, because $\lnot P\Rightarrow\lnot Q$ is precisely the contrapositive of $Q\Rightarrow P,$ so the two say the same thing. What a theorem's hypotheses buy you is a guarantee when they hold; when they fail, the correct conclusion is silence.

Three functions with a stationary point at $0$ show how little the condition $f'(0)=0$ decides on its own. The example is the app's own.

Example

Three stationary points, three verdicts

Each of $f(x)=x^{2},$ $g(x)=-x^{2}$ and $h(x)=x^{3}$ has a stationary point at $x=0.$ For each, is $0$ a maximum point, a minimum point, or neither, over all of $\mathbb{R}?$

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

5

Three kinds of candidate

On the interval $[0,3],$ where does $f(x)=3x^{2}-6x+5$ take its largest value?

So the first-order condition produces a shortlist rather than an answer, and the shortlist has exactly three kinds of entry.

A function shows why. Take $f(x)=x^{3}-3x^{2}+2$ on $[-1.2,\,3.2],$ which has two interior stationary points — and neither of them is the answer. Both global extreme points sit at the ends, where $f'=11.52,$ nowhere near zero. Here $f'(x)=3x^{2}-6x=3x(x-2),$ and the four candidates are:

$x$kind$f(x)$
$-1.2$endpoint$-4.048$
$0$$f'(0)=0$$2$
$2$$f'(2)=0$$-2$
$3.2$endpoint$4.048$

The minimum is at the left end and the maximum at the right end. The figure below shows the same thing for another function.

Three points with $f'=0.$ One is higher than the points near it, one is lower, and at the third the curve only pauses. None of them is the maximum or the minimum over $[a,b]{:}$ both sit at the ends, marked max and min.

Guess first. The next question is the hook of this section. Answer it before the worked example does.

Check yourself

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

$$f(x) = 3x^{2} - 6x + 5 \quad \text{on} \quad [0, 3]$$

Where does $f$ attain its maximum?

Example 6.17

The only stationary point is the minimum

Find the maximum and minimum of $f(x)=3x^{2}-6x+5$ on $[0,3].$

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 smallest value of $f(x)=x^{2}-6x$ on the interval $[-1,2]?$

6

When a candidate is the answer

A firm's profit is $12\sqrt{Q}-Q$ for every output $Q>0.$ There are no endpoints to compare. How can it know which output is best?

Method 6.15 decides by comparing numbers, which is reliable and requires a finite list. On an interval that is not closed and bounded there is no such list and Fact 6.9 is silent, so something else must do the work. Two results do, and both look at the sign of $f'$ rather than at values of $f.$

Fact 6.18First-derivative test#

Let $f$ be differentiable on an interval $I$ and let $c\in I$. If $f'(x)\ge0$ for all $x<c$ in $I$ and $f'(x)\le0$ for all $x>c$ in $I$, then $c$ is a maximum point for $f$ over the whole of $I$. If the inequalities are reversed, $c$ is a minimum point.

This needs no endpoints and no comparison: $f$ rises all the way up to $c$ and falls all the way after it, by Fact 2.23, so nothing anywhere in $I$ can beat $f(c).$ What makes it usable is that the sign pattern it asks for is guaranteed by a condition on $f''$ that is often trivial to check.

Before that condition, the first-derivative test on its own, on an interval with no right end. The example is the app's own.

Example

The lowest average cost

Producing $Q$ units costs $C(Q)=Q^{2}+4Q+16,$ so for $Q>0$ the average cost is $$ \begin{aligned} A(Q)&=\frac{C(Q)}{Q}\\ &=Q+4+\frac{16}{Q}\,. \end{aligned} $$ Find the output with the lowest average cost.

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

In words: as $\lambda$ runs from $0$ to $1,$ the point $\lambda x+(1-\lambda)y$ runs along the interval from $y$ to $x,$ and $\lambda f(x)+(1-\lambda)f(y)$ runs along the chord from $f(y)$ to $f(x).$ For example $f(x)=-x^{2}$ is concave: with $x=-1,$ $y=1$ and $\lambda=\tfrac12$ the left-hand side is $f(0)=0$ and the right-hand side is $\tfrac12(-1)+\tfrac12(-1)=-1.$ Here the inequality is even strict whenever $x\ne y$ and $0<\lambda<1,$ so $-x^{2}$ is strictly concave, and $x^{2}$ is convex for the same reason.

Fact 6.20Concavity, and what it decides#

Let $f$ be twice differentiable on an interval $I$.

  1. $f$ is concave on $I$ if and only if $f''(x)\le0$ throughout $I$, and convex if and only if $f''(x)\ge0$ throughout. If $f''<0$ throughout then $f$ is strictly concave, though not conversely.
  2. If $f$ is concave on $I$ and $c$ is an interior point with $f'(c)=0$, then $c$ is a maximum point for $f$ over the whole of $I$. If $f$ is convex, such a $c$ is a minimum point over the whole of $I$.

Part (ii) is the reason concavity matters to economists, and it is a genuinely stronger conclusion than anything in the previous subsection: it delivers a global maximum on an interval of any kind, with no endpoints to check and no list to compare. Where the extreme value theorem is silent, concavity can still speak.

Example 6.21

Diminishing returns: one best output

A firm producing $Q>0$ units has profit $\pi(Q) = 12\sqrt{Q} - Q.$ Find the output that maximises profit.

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

Fact 6.20 is the global test. Lecture 7 adds the local one — the second-derivative test at a single point, which asks only for the sign of $f''(c)$ and gives only a local verdict — and Lecture 10 carries both into two variables, where concavity again turns candidates into answers.

Check yourself

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

$f$ is twice differentiable and concave on all of $\mathbb{R}.$ Which statement must be true?

What you should take away

  • Intermediate value theorem: $f$ continuous on $[a,b]$ with a sign change has a root in $(a,b).$ Continuity is the whole hypothesis ($1/x$ on $[-1,1]$), and the conclusion is existence only. Adding strict monotonicity turns “at least one” into “exactly one” — two separate arguments for two separate jobs.
  • Newton's method: $x_{n} = x_{n-1}-f(x_{n-1})/f'(x_{n-1}),$ which is the tangent line solved for its own root, iterated. Usually very fast — the correct digits roughly double each step — and it can also cycle for ever.
  • Extreme value theorem: $f$ continuous on a closed bounded interval attains a maximum and a minimum. All three hypotheses are load-bearing, and they are sufficient, not necessary.
  • First-order condition: an interior extreme point at which $f$ is differentiable has $f'(c)=0.$ Necessary, not sufficient — recall $x^{3}$ at $0.$
  • Reading the first-order condition backwards and reading the extreme value theorem backwards are the same error, since $\lnot P\Rightarrow\lnot Q$ is the contrapositive of $Q\Rightarrow P.$ When hypotheses fail, a theorem says nothing.
  • To find extrema on $[a,b]{:}$ list the candidates — interior stationary points, endpoints, and interior points where $f'$ fails to exist — evaluate, and compare. The comparison decides; the derivative only shortlists.
  • Where there is no finite list, sign conditions do the work. If $f'$ is $\ge0$ before $c$ and $\le0$ after it, $c$ is a maximum over the whole interval; and $f''\le0$ throughout means $f$ is concave, which makes every interior stationary point a global maximum.

Think further

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

  1. Discussion question 1 — what a sign change needs

    $f$ satisfies $f(-1)=-1$ and $f(1)=1.$ Must there be a $c$ in $(-1,1)$ with $f(c)=0?$

    (A) yes, always;

    (B) yes, provided $f$ is continuous on $[-1,1];$

    (C) yes, provided $f$ is differentiable on $(-1,1);$

    (D) no — a sign change never guarantees a root.

    One way to think about it

    (B), by Fact 6.1. (A) fails for $1/x,$ which is not continuous at $0$ (Example 6.3). (D) is too pessimistic: with continuity the root is guaranteed.

    (C) fails too, and the counterexample is worth seeing. Let $f(-1)=-1$ and $f(x)=1$ for $-1<x\le1.$ On the open interval $(-1,1)$ this $f$ is constant, so it is differentiable there, and it is never zero in $(-1,1).$ What goes wrong is at the endpoint $x=-1,$ where $f$ jumps: differentiability on the open interval says nothing about the ends.

  2. Discussion question 2 — one step of Newton

    Apply one step of Newton's method to $f(x)=x^{2}-2$ from $x_{0}=2.$

    (A) $1.5;$

    (B) $2.5;$

    (C) $1.0;$

    (D) $1.4142.$

    Which wrong answer is a sign of having understood where the method is going?

    One way to think about it

    (A): $x_{1}=2-\dfrac{f(2)}{f'(2)}=2-\dfrac{2}{4}=1.5.$ (B) adds the step instead of subtracting it, and (C) divides by $x_{0}=2$ instead of by the slope $f'(2)=4.$

    (D) is the wrong answer that shows understanding: $1.4142$ is $\sqrt2,$ the root the iteration is heading for. Only the number of steps is wrong. One step lands where the tangent meets the axis, and that is $1.5;$ it takes three steps to reach $1.4142157.$

  3. Discussion question 3 — a horizontal tangent that is not an extremum

    $f$ is differentiable, $c$ is interior, and $f'(c)=0.$ Does $f$ have an extreme point at $c?$ Give the standard counterexample, and say which lecture you first met it in.

    One way to think about it

    Not necessarily. The standard counterexample is $f(x)=x^{3}$ at $c=0{:}$ $f'(0)=0,$ but $f(-1)=-1<0<1=f(1),$ so $0$ is neither a maximum nor a minimum point. It was first met in Lecture 2, in Watch out 2.24, where it showed that a strictly increasing function need not have $f'>0$ everywhere. Here it shows that Fact 6.13 cannot be read backwards.

  4. Discussion question 4 — the same function on a shorter interval

    In Example 6.17, suppose the interval were $[0,1]$ instead. Where are the maximum and minimum then, and which step of Method 6.15 changes?

    One way to think about it

    Step 2, the list of candidates, changes. The point $3$ is no longer in the interval, and the stationary point $x=1$ is now an endpoint as well. The candidates are $0$ and $1,$ with $f(0)=5$ and $f(1)=2.$ The maximum is $5,$ at $x=0,$ and the minimum is $2,$ at $x=1.$

    Step 1 is unchanged ($[0,1]$ is closed and bounded), and step 3 still decides. In fact $f'(x)=6x-6\le0$ on $[0,1],$ so $f$ decreases from $5$ to $2$ all the way.

  5. Discussion question 5 — concave, and no maximum

    Give a function that is concave on ${\mathbb R}$ with no maximum point at all. Why does this not contradict Fact 6.20(ii)?

    One way to think about it

    $f(x)=x$ will do: $f''(x)=0\le0,$ so it is concave by Fact 6.20(i), and it grows without bound. A strictly concave one is $f(x)=-e^{x}{:}$ $f''(x)=-e^{x}<0,$ and its values approach $0$ from below without ever reaching it.

    No contradiction, because part (ii) has a hypothesis: an interior point $c$ with $f'(c)=0.$ Neither function has one ($f'(x)=1$ and $f'(x)=-e^{x}$ are never zero), so the Fact is silent — the same lesson as Watch out 6.10.

  6. Discussion question 6 — strictly convex with f″(0) = 0

    Is $f(x)=x^{4}$ strictly convex? What is $f''(0)?$ Which half of Fact 6.20(i) does this illustrate?

    One way to think about it

    Yes, $x^{4}$ is strictly convex: every chord lies strictly above the graph between its two ends. For instance the chord from $(-1,1)$ to $(1,1)$ is the line $y=1,$ and $x^{4}<1$ for $-1<x<1.$ (In general, the slope $f'(x)=4x^{3}$ is strictly increasing, so the graph bends upwards everywhere and never runs straight.)

    But $f''(x)=12x^{2},$ so $f''(0)=0.$ This is the “though not conversely” of part (i): $f''>0$ throughout makes a function strictly convex, but a strictly convex function need not have $f''>0$ everywhere. Compare $x^{3},$ which is strictly increasing with $f'(0)=0.$

  7. Discussion question 7 — when the hypothesis is false

    A theorem says $P\Rightarrow Q$ and you observe that $P$ is false. What may you conclude about $Q?$

    One way to think about it

    Nothing. The theorem promises $Q$ only when $P$ holds; when $P$ fails, $Q$ may be true or false. Concluding “not $Q$” is the inverse, $\lnot P\Rightarrow\lnot Q,$ which is the contrapositive of the converse $Q\Rightarrow P$ — the same error as reading the theorem backwards.

    Example 6.11 shows both outcomes. On $(0,1),$ where the hypothesis of the extreme value theorem fails, $x(1-x)$ has a maximum and $x$ has none.