advanced calculus lecture 1 - econ109.econ.bbk.ac.uk

34
Advanced Calculus Lecture 1.1 Brad Baxter Birkbeck College, University of London January 14, 2021 Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Upload: others

Post on 28-May-2022

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Advanced Calculus Lecture 1.1

Brad BaxterBirkbeck College, University of London

January 14, 2021

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 2: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

You can download these notes from my office server

http://econ109.econ.bbk.ac.uk/brad/teaching/Advanced_Calculus/

and my home server

http://www.cato.tzo.com/brad_bbk/teaching/Advanced_Calculus/

Books:Buono, P., Advanced Calculus : Differential Calculus andStokes’ Theorem. This is available from Birkbeck’s eLibrary:https://ebookcentral.proquest.com/lib/bbk/detail.action?docID=4691415&query=advanced+calculus

Many students find Schaum’s Outline of Calculus and Schaum’sOutline of Advanced Calculus highly useful, because of the manyworked examples.

Main location for all of my courses:http://econ109.econ.bbk.ac.uk/brad/teaching/

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 3: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Exponential Growth, Finance and Calculus in 1600

ExampleWe lend money at 5% paid annually.If a client borrows £M, their debt grows from £M to£ (1+ 0.05)M after one year.

BUT Lender wants interest to be paid monthly. The monthlyinterest rate is 1+ 0.05/12.The client’s debt after one year grows by the factor(

1+0.0512

)12

= 1.05116189788173

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 4: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

BUT For large loans, the lender wants interest calculated daily withmultiplying factor being 1+ 0.05/365. The client’s debt after oneyear is now multiplied by the factor(

1+0.05365

)365

= 1.05126749646745

Suppose we have an extremely large loan and want interestcalculated hourly.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 5: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

One year is 8760 hours, so the new annual factor is(1+

0.058760

)8760

= 1.05127094636610.

These annual multiplying factors are converging to a limit and wecall this continuous compounding. The limit is also called theexponential function, whose discovery in the 17th century beganthe development of calculus and mathematical finance. Thediscoverers were the eccentric Scottish mathematician andaristocrat John Napier and the London mathematician HenryBriggs who, almost exactly 400 years ago, found the limit to be

e0.05 ≡ exp(0.05) = 1.05127109637602,

where e is the fundamental mathematical constant

e = 2.71828182845905 . . . .

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 6: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

The key property of the exponential function is the formula

ea+b = eaeb,

which should be plausible if we think financially. Thus

er(t1+t2) = ert1ert2 ,

i.e. saving for time t1 at constant interest rate r , followed by savingfor a further time t2, is equivalent to saving for the total timet1 + t2.

Notation: exp(x) and ex mean the same thing. So

exp(r(t1 + t2)) = exp(rt1) exp(rt2).

If t2 = −t1, then1 = e0 = ert1e−rt1

ore−rt1 =

1ert1

.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 7: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Example Let’s return to our initial example of 5% interest per year.The corresponding continuous compounding rate is the number rfor which

er = 1.05.

Solution:r = ln 1.05 = 0.0487901641694320

where ln is the natural or Napierian logarithm.

Use: If we’re using 5% interest per year and continuouscompounding, then, in 0.0136986 years (about 5 days), debt growsby a factor of

exp(r ∗ 0.0136986) = 1.00066858

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 8: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

The time value of money.Example We need £100 in 5 years and the interest rate is aconstant 5%. Then the amount £M needed today must satisfy

(1.05)5M = 100,

orM = 100/(1.055) = 78.35.

Exercise What amount £M should be invested today to obtain£100 in 5 years if the interest rate is 2%?

Exercise Suppose our initial fund is £100. How many years does ittake to double our money for the following interest rates: 1%, 2%,5%, 10% and 25%? [25% might seem high, but check the interestrate charged by credit cards!]

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 9: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

The Rule of 72Human intuition for exponential growth is poor. We define thedoubling time T by (

1+n

100

)T= 2

when the interest rate is n%. Taking logarithms, we obtain

T log(1+

n

100

)= log 2,

orT =

log 2log(1+ n

100

) .

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 10: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

A calculus result tells us that

log (1+ x) ≈ x ,

when x is small, so the doubling time for n% interest isapproximately

T ≈ log 2(n

100

) =100 log 2

n≈ 69.31

n.

The Rule of 72 further approximates this by

T ≈ 72n.

The advantage is that 72 has many factors, so the division is easyfor mental arithmetic, and rough estimates are essential whentrying to develop mathematical intuition.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 11: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Example When n = 3%, the doubling time is about 72/3 = 24years. If the interest rate increases to n = 10%, then the newdoubling time is about 72/10 = 7.2 years.

Exercise Use the Rule of 72 to calculate the doubling time forn = 6%, n = 12% and n = 24%.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 12: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

How good is the Rule of 72? The true doubling time is

100 log 2n

,

so

Rule of 72 doubling timeTrue doubling time

=72

100 log 2= 1.038740 . . . ,

i.e. the Rule of 72 approximation overestimates the true doublingtime by roughly 4%. In other words, it’s excellent for a quickestimate.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 13: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Exponentials and pandemic managementIn the peak Covid-19 months of February and March in the UK, thenumber of infections was growing roughly exponentially, with adoubling time of about 3 days.

Example In one month, the number of infections grows by a factorof about 1000, if 1 month ≈ 30 days and 210 = 1024 ≈ 1000.

Exercise What’s the growth factor over two months?

Exercise Let’s assume lockdown were perfectly effective andstopped the exponential growth immediately. How many moreinfections occur if lockdown is 8 days late?

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 14: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

LimitsLet f : U → R, and let a, l ∈ R.Informally: f (x) approaches l as x approaches a if the value of f (x)gets closer to l as x gets closer to a.

Note: a does not necessarily have to be in U and often cases wherea is not included in U but is on the “boundary” of U are ofparticular interest. For instance we may have a function f that isnot defined at 0, perhaps because its definition at 0 would requiredividing by 0, and we may be interested in how f (x) behaves as xgets close to 0.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 15: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Formal Definition We say that f (x) approaches l as x approaches aif for all ε > 0, there is an interval (s, t) ⊆ U ∪ {a}, withs < a < t, such that |f (x)− l | < ε for all x ∈ (s, t)− {a}. If f (x)approaches l as x approaches a then we write either lim

x→af (x) = l

or f (x)→ l as x → a.If the above definition is not satisfied for f (x) at some a, we saythat lim

x→af (x) does not exist.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 16: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Rules for evaluating limitsLet f , g : U → R and suppose that lim

x→af (x) = l and

limx→a

g(x) = m. Then

L1 limx→a

(f (x)± g(x)) = l ±m;

L2 limx→a

f (x)g(x) = lm;

L3 limx→a

f (x)

g(x)=

l

mprovided m 6= 0.

L4 For integer n, limx→a

n√

f (x) =n√l (when n is even, we

assume that l ≥ 0).These can all be proved using the definition of a limit. However, wewill not do this in this module.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 17: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Example: Determine limx→3

f (x), where

f (x) =x2 − x − 6

x − 3.

Both numerator and denominator vanish at x = 3. But

x2 − x − 6 = (x + 2)(x − 3).

Thus f (x) = x + 2, provided x 6= 3. Hence

limx→3

x2 − x − 6x − 3

= limx→3

(x + 2) = 5.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 18: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Exercise: Find limx→0

sin(π/x).

Let’s calculate some values:

x sin(π/x) x sin(π/x)

1 0 −1 00.1 0 −0.1 00.01 0 −0.01 00.001 0 −0.001 00.0001 0 −0.0001 0

The table suggests that limx→0

sin(π/x) = 0. Is this true?

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 19: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

In fact the limit does not exist: sin(π/x) oscillates infinitely oftenbetween ±1 as x → 0.

-3 -2 -1 1 2 3

-1.0

-0.5

0.5

1.0

y = sin(π/x)

Conclusion: Computation is wonderful, but be careful!

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 20: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Example Let

f (x) =2x2 − 1x2 + 1

.

Both numerator and denominator tend to ∞ as x →∞.Trick:

limx→∞

2x2 − 1x2 + 1

= limx→∞

(2x2−1x2 )

( x2+1x2 )

= limx→∞

2− 1x2

1+ 1x2

=limx→∞(2− 1

x2 )

limx→∞(1+ 1x2 )

=2− 01+ 0

= 2.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 21: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Let g(x) = x sin 1x .

Problem: g(x) is not defined for x = 0.Trick: the Squeeze Rule:Use

−|x | ≤ g(x) ≤ |x |, for all x 6= 0.

Then limx→0|x | = 0 implies that lim

x→0g(x) = 0.

Here’s the graph.

-1.0 -0.5 0.5 1.0

-1.0

-0.5

0.5

1.0

y = x sin(1/x)Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 22: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

L’Hôpital’s rule: If limx→a

f (x) and limx→a

g(x) are both zero or both

±∞ and limx→a

f ′(x)

g ′(x)exists then

limx→a

f (x)

g(x)= lim

x→a

f ′(x)

g ′(x).

L’Hôpital’s rule also holds if we replace a by ±∞.

Example: Find limx→0

ex − 1x

.

Since limx→0

(ex − 1) = 1− 1 = 0 and limx→0

x = 0, we may apply

L’Hôpital’s rule to get

limx→0

ex − 1x

= limx→0

ex

1=

11= 1.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 23: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Exercise: Find limx→0

ex − x − 1x2 .

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 24: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Formal definition of the derivative Let U ⊆ R and let f : U → R.Then the derivative of f at x ∈ U is

limh→0

f (x + h)− f (x)

h

if such a limit exists and we say that f is differentiable at x .Otherwise f does not have a derivative at x and we say that f ′(x)is undefined or does not exist.Key idea: Look at the gradient of the chord through the points(x , f (x)) and (x + h, f (x + h)).As h→ 0, the chord approaches the tangent at (x , f (x)) and sothe gradient of the chord approaches the gradient of the tangent atthis point.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 25: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

P is the point (x , f (x)) and the two points labelled Q denote(x + h, f (x + h)) for two different values of h.

1 2 3 4

1

2

3

4Q

Q

P

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 26: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Exercise: Use L’Hôpital’s rule to find limx→0 sin x/x . Sketch thegraph of y = sin x/x .

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 27: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

-5 5

-0.2

0.2

0.4

0.6

0.8

1.0

y =sin x

x

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 28: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Differentiability is a stronger condition than continuity.Theorem: If f is differentiable at a point a, then f is continuous ata.The converse is false: Consider |x | at x = 0. This function iscontinuous everywhere and differentiable everywhere but 0.

-4 -2 2 4

1

2

3

4

5

y = |x |

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 29: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Continuous nowhere differentiable functions:There are functions that are continuous and nowhere differentiable,e.g.

f (x) =∞∑n=1

cos 3nx2n

.

More generally,

f (x) =∞∑n=1

cos bnx

an

is continuous and nowhere differentiable if 1 < a < b.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 30: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Brownian Motion:

0 2000 4000 6000 8000 100000.2

0.4

0.6

0.8

1

1.2

1.4

Figure: Brownian Motion

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 31: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Functions of Two Variables:Let U ⊆ R2 = {(x , y) : x , y ∈ R}. A (real) function f : U → R oftwo variables determines for each (x , y) ∈ U a unique real numberdenoted by f (x , y).

U is called the domain of f and is often not explicitly specified, inwhich case it is taken to be the largest set for which f is defined.

The surface {(x , y , z) : (x , y) ∈ U, z = f (x , y)} is the analogue ofthe graph of a univariable function.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 32: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

The surface and contour plot of z = x2 + y2.

-3 -2 -1 1 2 3

-3

-2

-1

1

2

3

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 33: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Partial DerivativesLet U ⊆ R2 and let f : U → R. The partial derivative of f withrespect to x is defined by

fx ≡∂f

∂x= lim

h→0

f (x + h, y)− f (x , y)

h.

Similarly, the partial derivative of f with respect to y is defined by

fy ≡∂f

∂y= lim

h→0

f (x , y + h)− f (x , y)

h.

Key idea: To find∂f

∂x, differentiate f with respect to x , and treat

y as a constant.

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1

Page 34: Advanced Calculus Lecture 1 - econ109.econ.bbk.ac.uk

Example: Let f (x , y) = 13x

3 − 3x2y + y2. Then∂f

∂x= x2 − 6xy

and∂f

∂y= −3x2 + 2y .

Example: Let z = (x2 + y2) exp(−x2 − 4y2).Then

∂z

∂x= 2x exp(−x2 − 4y2) + (x2 + y2) exp(−x2 − 4y2)(−2x)

= 2x exp(−x2 − 4y2)(1− x2 − y2)

and

∂z

∂y= 2y exp(−x2 − 4y2) + (x2 + y2) exp(−x2 − 4y2)(−8y)

= 2y exp(−x2 − 4y2)(1− 4x2 − 4y2).

Brad Baxter Birkbeck College, University of London Advanced Calculus Lecture 1.1