Handling a changing world (differential calculus)

advertisement
Lecture 5
Handling a changing world
The derivative
Y
Y
y2
The derivative
y2-y1
y2-y1
y1
x2-x1
x1
slope 
slope 
dy
dx
x2-x1
x2
X
y 2  y1
x 2  x1
f ( x 2 )  f ( x1 )
x 2  x1

slope  lim
x
f ( x1   x )  f ( x1 )
x
f ( x  x)  f ( x)
x  0
x
The derivative describes the
change in the slope of functions
The first Indian satellite
f ( x  x)  f ( x)

 f ' ( x )  y  lim

y
X
x  0
Bhaskara II
(1114-1185)
x
Aryabhata
(476-550)
10
y ( u )  au  b 
df ( x )
u  b  f (u )
dx
Y
5
-4
u
b
y (2)  2a  b 
Local
minimum
2
df ( x  2 )
b0
dx
0
-2
0
2
4
-5
f (b )  f ( a )
ba
 f ' (c )
-10
df ( x )
X
Mean value theorem
0
dx
Stationary point,
point of equilibrium
Four basic rules to calculate derivatives
( f  g ) '  f ' g '
( f  g ) '  f ' g '
( f * g ) '  f '* g  f * g '
'
 f 
f '* g  f * g '
  
2
g
g
 
( f ( g )) '  f '* g '
3
y  2x
y2
2
y=30-10
y=0
Y
Y
40
35
30
25
20
15
10
5
0
1
x=15-5
0
0
5
10
15
20
0
5
X
dy
dx
 lim
y
x  0
x
10
15
X

30  10
10  5
dy
2
dx
The derivative of a linear function y=ax
equals its slope a
 lim
y
x  0
x
0
The derivative of a constant y=b is always
zero. A constant doesn’t change.
y  ax  b  y '  a
20
The importance of e
30
x
a

a
1


e


x 
x

x
1

lim x    1    e
x

25
lim
ye 
x
dy
dy
Y
20
 ye
dx
15
dy
10
dx
5
0
e
x
0
1
2
dx
dx
dx
dy
3
y
Y
dy
dx
1
x
y  ln( x )
1
0
dx / dy
y
y
2
1
e 
4
4
y  ln( x )  x  e

3
X
y  ln( x )
dy
x
-1 0

1
e
y

1
x
1
2
-2
X
3
4
y  ax
y  ax  e
ln( a )  b ln( x )
y' e u' e
ln( a )  b ln( x )
b
u
e
b
u
(ln( a )  b ln( x ))'  e
ln( a )  b ln( x )
( 0  0 ln( x )  b
1
)  ax
x
y  ab
y  ab
x
e
ln( a )  x ln( b )
e
b
b
 abx
x
x
u
y '  e u '  ab (ln( a )  x ln( b ))'  ab ( 0  1 ln( b )  x 0 )  ab ln( b )  a ln( b ) b
u
b 1
x
x
x
x
y  sin( x )
y '  lim
y '  lim
lim
sin( x   x )  sin( x )
x  0
x
sin( x ) cos(  x )  cos( x ) sin(  x )  sin( x )
x  0
sin(  x )
x  0

x
x
 1  sin' ( x )  cos( x )
 cos( x ) lim
sin(  x )
x  0
cos' ( x )   sin( x )
x
The approximation of a small increase
slope  lim
f ( x  x)  f ( x)
x  0
x
f ( x  x)  f ( x)  f ' ( x)x
lim
x  0
lim
x  0
x
f ( x   x )  f ( x )  lim
x  0
0
f ' ( x)x
How much larger is a ball of 100 cm radius
if we extend its radius to 105 cm?
V 
4
 r  V '  4 r
3
2
3
 V  0 . 05 m  4  (1m )  0 . 628 m
3
3
2
The true value is V = 0.66m3.
3
8
7
6
5
4
3
2
1
0
Rule of l’Hospital
e e
y  lim
lim
x  x0
f ( x) 
g ( x) 
x 0
f ( x )  lim
df ( x )
xc
x
Y
x
x
x  x0
g ( x)  0
df ( x )
dx
dx
dg ( x )
dg ( x )
xd 
dx
dx
-4
-2
f ( x0 ) 
0
X
( x  x0 )
2
4
df ( x )
( x  c0 )
f '(x)
dx


dg ( x )
g (x)
g '(x)
( x  c0 )
dx
f (x)
lim
x
y  lim
x 0
e e
x
y'
1
dx
( x  x0 )
The value of a function at a point x can be
approximated by its tangent at x.
( x  x0 )
e e
df ( x )
f ( x)
x a
g ( x)
 lim
f '( x)
x a
g ' ( x)
x
 f ( x)  e  e
x
x
x
 y (0) 
11
1
2
x
; g (x)  x
Stationary points
30
25
Minimum Maximum
20
How to find minima and
maxima of functions?
Y
15
f(x)
10
5
30
0
-2
-1
0
1
2
3
4
25
5
20
X
f’(x)
0
-5 -2
-1
f’=0
15
f’<0
Y
5
0
1
2
3
4
5
f’=0
5
-10
f’<0
f’>0
10
Y
0
-15
-2
-1
0
1
2
3
4
5
X
-20
-25
Y
X
20
15
10
5
0
-5 -2
-10
-15
-20
y   x  4 x  2 x  10
3
f’’(x)
-1
2
y '  3 x  8 x  2
2
0
1
2
3
4
5
y ' '  6 x  8
y '  0   3 x  8 x  2  x1 , 2 
2
X
4
3

10
9
 x1  0 . 279 ; x 2  2 . 387
Populations of bacteria can sometimes be modelled by a general trigonometric function:
Y
N  a sin( bt  c )  d
6
5
4
3
2
1
0
-1
-2
N  3 sin( 4 t  6 )  2
b
a
a: amplitude
b: wavelength; 1/b: frequency
c: shift on x-axis
d: shift on y-axis
d
c
0
2
4
6
X
The time series of population growth of a bacterium is modelled by
At what times t does this population have
N  3 sin( 4 t  6 )  2
maximum sizes?
dN
 12 cos( 4 t  6 )  0  cos( 4 t  6 )  0
dt
4t  6  k

2
 tk

8

3
2
Maximum and minimum change
30
25
Positive
sense
20
f’=0
Y
15
10
f’=0
5
Negative
sense
0
-2
-1
1 4/3 2
X
0
3
4
5
Point of maximum change
Point of inflection
At the point of inflection the first derivative has a maximum or minimum.
To find the point of inflection the second derivative has to be zero.
y   x  4 x  2 x  10
3
2
y'  3x  8 x  2
2
y''  6 x  8
y''  0  6 x  8  x 
4
3
The most important growth process is the logistic growth (Pearl Verhulst model)
t
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
25
Weight
9.6
18.3
29
47.2
71.1
119.1
174.6
257.3
350.7
441
513.3
559.7
594.8
629.4
640.8
651.1
655.9
659.6
661.8
665
Weight [g]
The growth of Saccharomyces
cerevisiae (Carlson 1913)
700
600
500
400
300
200
100
0
K
Logistic growth
0
10
20
30
Time [h]
The function is symmetric around the point of fastest growth.
dN
 N
dt
dN
dN
dt
dt
 K N
 aN ( K  N )
The most important growth process is the logistic growth (Pearl Verhulst model)
30
25
20
15
N
K/2
Ke
N 
10
5
The process converges to an upper limit
defined by the carrying capacity K
t  t0
1 e
t  t0
dN
t0
0
0
5
10
t
dt
15
20
)  rN 
K
r
N
2
K
Differential equation
Maximum population size is at
14
12
Saccharomyces
cerevisiae
10
V o lu m e
 rN (1 
N
8
dN
 rN 
dt
r
K
N
2
 0  N max  K
6
N 
4
2
13
1 e
 ( t  9 .5 )
The population growths fastest at
0
0
10
20
30
40
50
2
d N
T im e [h]
dt
2
r
2r
K
N  0  N  N max 
K
2
The change of populations in time
N t 1 
KN t
1  aN t
The Nicholson – Bailey approach to fluctuations of
animal populations in time
b
First order recursive function
K=2. 0
a=1.2
b=3.9
1.02
1.2
K=0.95
a=0.05
b=2.0
0.8
N
0.6
1
0.98
0.96
N
1
0.4
0.94
0.2
0.92
0
0.9
0
20
40
60
80
0
100
20
40
3000
2500
N
1000
500
N
K=1. 5
a=0.01
b=0.5
1500
0
0
20
40
60
t
80
100
t
t
2000
60
A simple
deterministic
process (function)
is able to generate
a quasi random
(pseudochaotic)
pattern.
80
100
K=3. 0
a=3.0
b=6.0
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
0
0
20
40
60
t
80
100
Hence, seemingly
complicated
fluctuations of
populations in
time might be
driven by very
simple ecological
processes
Recursive functions of nth order
f ( t  1)  f ( t , t  1, t  2 ,..., t  n )
N
r
0
10
1
12
2
14.4
3
17.28
4
20.736
5 24.8832
6 29.85984
7 35.83181
8 42.99817
9 51.5978
First order recursive function
N t 1  rN t
Exponential model of
population growth
How fast does a population
increase that is described by
this function?
1.2
60
50
40
N
t
30
20
10
0
0
5
t
N t  rN t 1  r ( rN t  2 )  r N t  2  r N 0
2
dN
 N 0 r ln r
2
d N
dt
There is no maximum.
t
dt
2
 N 0 r ln r 
t
t
2
Population increase is faster
and faster.
10
Nicholson – Bailey approach
N t 1 
KN t
1  aN t
N t 1  N t   N 
N
b
t
KN
t
1  aN t
b
 Nt

KN
1  aN
b
dN
N
dt

KN
1  aN
0
1  aN
b
N
K  1  aN
b
max
 N max
 K 1


a


1
b
The global maximum of the function
3000
2500
2000
K=1. 5
a=0.01
b=0.5
N
1500
1000
500
N max
0
0
20
40
60
t
80
100
 1 .5  1 


 0 . 01 
N
Differential equation
Difference equation
Where are the maxima of this function?
KN
b
1
0 .5
 2500
Series expansions
a  ax  ax  ax  ...  ax
2
3
n
a (1  x

n 1
)
1 x
Geometric series
n
 g ( x, i) 
f ( x)
i0
f ( x )  a 0  a1 x  a 2 x  a 3 x  a 4 x  ...  a n x  ...
2
3
4
n
We try to expand a function into an arithmetic series. We need the coefficients ai.
f (0)  a 0
f ( x )  a 1  2 a 2 x  3 a 3 x  4 a 4 x  ...  na n x
1
2
3
n 1
 ...  f ( 0 )  a1
f ( x )  2 a 2  2  3 a 3 x  3  4 a 4 x  ...  ( n  1) na n x
2
2
1
n2
f ( x )  2  3 a 3  2  3  4 a 4 x  ...  ( n  2 )( n  1) na n x
3
2
f ( x )  f (0)  f (0) x 
1
f (0)
2!
3
x 
2
f (0)
3!
 ...  f ( 0 )  2 a 2
n3
4
x 
3
f (0)
4!
McLaurin series
2
 ...  f ( 0 )  2  3 a 3
3

n
x  ... 
4
f (0)
n!
x  ... 
n

i0
i
f (0)
i!
x
i
f ( x )  a 0  a1 ( x  b )  a 2 ( x  b )  a 3 ( x  b )  a 4 ( x  b )  ...  a n ( x  b )  ...
2
3
4
n
f (b )  a 0
f ( b )  a 1  2 a 2 ( x  b )  3 a 3 ( x  b )  4 a 4 ( x  b )  ...  na n ( x  b )
1
2
3
f ( b )  2 a 2  2  3 a 3 ( x  b )  3  4 a 4 ( x  b )  ...  ( n  1) na n ( x  b )
2
2
f ( b )  2  3 a 3  2  3  4 a 4 ( x  b )  ...  ( n  2 )( n  1) na n ( x  b )
3
2
f (b )
f ( x )  f ( b )  f ( b )( x  b ) 
1
n3
n 1
n2
 ...  f ( b )  a1
1
 ...  f ( b )  2 a 2
2
 ...  f ( b )  2  3 a 3
3

n
f (n)
( x  b )  ... 
2
2!

( x  b )  ... 
n
n!
i
f (b )
(x  b)
i!
i 1
Taylor series
e e e x
x
0
0
e
0
x 
2
2!
( a  x )  a  na
n
n
n 1
x
e
0
x 
3
3!
n ( n  1)
e
0
x  ... 
4
4!
a
n2
e

0
x  ... 
n
n!
x 
2
n ( n  1)( n  2 )
2!
3!
x
 i!
i

 e
i0
a
n3
 i!
i0

x  ... 
3
1
n!
 i! ( n  1)!a
i0
Binomial expansion

(a  x) 
n

i0
 n  ni i
 a x
i 
 n  Pascal (binomial)
 
coefficients
i 
ni
x
i
i
Series expansions are used to numerically compute otherwise intractable functions.
y  sin x
2
f ( x )  f (0)  f (0) x 
1
f (0)
3
f (0)
x 
2
2!
sin( x )  sin( 0 )  cos( 0 ) x 
4
x 
3
f (0)
3!
 sin( 0 )
x 
2
x  ... 
4!
 cos( 0 )
2!

n
f (0)
4
x  ... 
n
n!
x 
3
sin( 0 )
3!

i
f (0)
x  ...  x 
4!
x
3
3!

x
5
5!

x
7
....
7!
Fast convergence
Degrees
30
45
60
90
Summands
Radians
Sin
1
2
3
4
5
Sum
0.523599
0.5
0.523599 -0.02392 0.000328 -2.14072E-06 1.55678E-08
0.5
0.785398 0.70711 0.785398 -0.08075 0.00249 -3.65762E-05 3.98984E-07 0.70711
1.047198 0.86603 1.047198 -0.1914 0.010495 -0.000274012 3.98534E-06 0.86603
1.570796
1
1.570796 -0.64596 0.079693 -0.004681754 0.00010214 0.99995
In the natural sciences and maths angles
are always given in radians!
Taylor series expansion of logarithms
ln( 1  x )  x 
x
2
2

x
3
3

x
4
4

x

5
5
... 
 (  1)
i 1
i 1
x
i
i
i
i!
i0
4
x
Very slow
convergence
Home work and literature
Refresh:
Literature:
•
•
•
•
•
•
•
•
Mathe-online
Logistic growth:
http://en.wikipedia.org/wiki/Logistic_
function
http://www.otherwise.com/populatio
n/logistic.html
Arithmetic, geometric series
Limits of functions
Sums of series
Asymptotes
Derivative
Taylor series
Maxima and Minima
Stationary points
Prepare to the next lecture:
•
•
•
•
Logistic growth
Lotka Volterra model
Sums of series
Asymptotes
Download