1 1 TAYLORS FORMEL FÖR FUNKTIONER AV EN VARIABEL

1
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
TAYLORS FORMEL FÖR FUNKTIONER AV EN VARIABEL
Taylors formel används bl. a. vid i) numeriska beräkningar ii) optimering och iii)
härledningar inom olika tekniska och matematiska områden.
a) Taylors formel kring punkten a
f ′′( a)
f ′′′(a )
f ( n ) (a )
f ( x ) = f (a ) + f ′( a)( x − a ) +
( x − a )2 +
( x − a )3 + ... +
( x − a )n + R
2!
3!
n!
f ( n +1) (c )
där R =
( x − a )n +1 och c är ett tal som ligger mellan a och x.
(n + 1)!
Resttermen R kallas Lagranges restterm av ordning n+1.
b) Taylors polynom av ordning n
f ′′( a )
f ′′′( a )
f ( n ) (a )
Tn ( x ) = f ( a ) + f ′( a )( x − a ) +
( x − a)2 +
( x − a ) 3 + ... +
( x − a)n
n!
2!
3!
c) Taylors serie
T∞ ( x ) = f ( a ) + f ′( a )( x − a ) +
f ′′( a )
f ′′′( a )
( x − a)2 +
( x − a ) 3 + ...
2!
3!
eller kortare
∞
T∞ ( x ) = ∑
n =0
f ( n ) (a )
( x − a)n
n!
Speciellt fall då a=0 kallas ofta för Maclaurins formel (polynom, serie).
a) Maclaurins formel
f ′′(0) 2 f ′′′(0) 3
f ( n ) ( 0) n
f ( x ) = f (0) + f ′(0) x +
x +
x + ... +
x +R
2!
3!
n!
f ( n +1) ( c ) n +1
där R =
x
och c är tal som ligger mellan 0 och x.
( n + 1)!
b) Maclaurins polynom av ordning n
f ′′(0) 2 f ′′′(0) 3
f ( n ) ( 0) n
M n ( x ) = f (0) + f ′(0) x +
x +
x + ... +
x
2!
3!
n!
c) Maclaurins serie
1
2
Armin Halilovic: EXTRA ÖVNINGAR
M ∞ ( x ) = f (0) + f ′(0) x +
Taylors formelför envariabelfunktioner
f ′′(0) 2 f ′′′(0) 3
x +
x + ...
2!
3!
eller kortare
∞
M ∞ ( x) = ∑
n=0
f ( n ) (0) n
x
n!
-----------------------------------------------------------------------------------------------INTRESANT. Notera att Taylors polynom av ordning n
f ′′( a )
f ′′′( a )
f ( n ) (a)
Tn ( x ) = f ( a ) + f ′( a )( x − a ) +
( x − a )2 +
( x − a )3 + ... +
( x − a )n
2!
3!
n!
(n)
har grad ≤ n och att graden blir < n om f ( a ) = 0 .
Alltså
grad(Taylorpolynom) ≤ ordning(Taylorpolynom)
-----------------------------------------------------------------------------------------------Viktiga Maclaurinutvecklingar:
ex = 1+
sin x =
x x2 x3
xn
+
+
+L+
+R
1! 2! 3!
n!
x x3 x5
x 2 n +1
− + − L + ( −1)n
+R
1! 3! 5!
( 2n + 1)!
cos x = 1 −
x2 x4
x 2n
+
−L+
+R
2! 4!
(2n )!
ln(1 + x ) =
x x2 x3
xn
−
+ − L + ( −1) n −1 + R
1 2
3
n
p
p ( p − 1) 2 p ( p − 1)( p − 2) 3
p ( p − 1)L ( p − ( n − 1)) n
x+
x +
x +L+
x +R
1!
2!
3!
n!
x3 x5 x7
x 2 n −1
arctan x = x − + − L + (−1)n −1
+R
3 5
7
2n − 1
(1 + x ) p = 1 +
Anmärkning: Inom härledningar i olika tekniska område används oftast linjära
approximationer (Maclaurinpolynom av ordning 1). Om x är litet tal, dvs om x går mot 0, då
gäller följande linjära approximationer:
ex ≈ 1 + x ,
sin x ≈ x
ln(1 + x ) ≈ x
(1 + x ) p ≈ 1 + px
arctan x ≈ x .
2
3
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
Exempel 1.
Bestäm Taylorpolynomet av ordning fyra till funktionen f ( x ) = ln(2 x ) , kring punkten a=1.
Lösning:
Vi beräknar funktionen och derivator i punkten 1.
f ( x ) = ln(2 x )
1
1
f ′( x ) =
⋅2 =
2x
x
f ′′( x ) = − x −2
f ′′′( x ) = 2 x −3
f ( 4 ) ( x ) = −6 x − 4
f (1) = ln 2
f ′(1) = 1
f ′′(1) = −1
f ′′′(1) = 2
f ( 4 ) (1) = −6
Värdena substituerar vi i formeln för Taylors polynom (av ordning 4)
( x − a)2
( x − a)3
( x − a) 4 (4)
T4 ( x ) = f ( a ) + ( x − a ) f ′( a ) +
f ′′( a ) +
f ′′′( a ) +
f (a )
2!
3!
4!
och får
( x − 1)2
( x − 1)3
( x − 1)4
T4 ( x) = ln 2 + ( x − 1) ⋅ 1 +
⋅ (−1) +
⋅2+
⋅ (−6) .
2!
3!
4!
Detta ger
( x − 1) 2 ( x − 1) 3 ( x − 1) 4
+
−
.
2
3
4
( x − 1) 2 ( x − 1) 3 ( x − 1) 4
+
−
Svar: T4 ( x ) = ln 2 + ( x − 1) −
2
3
4
T4 ( x ) = ln 2 + ( x − 1) −
=================================================
ÖVNINGAR
Uppgift 1.
Bestäm Taylorpolynomet av ordning 3 kring punkten a = 8 för funktionen y = 3 x .
Lösning:
f ( x) = 3 x ,
f (8) = 8 = 2
1
1
f ′( x ) = x −2 / 3 ,
f ′(8) =
3
12
−1
− 2 −5 / 3
f ′′( x ) =
x , f ′′(8) =
9
144
3
4
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
10 −8 / 3
5
x ,
f ′′′(8) =
27
3456
Taylors polynom av ordning 3:
f ′′( a )
f ′′′( a )
T3 ( x ) = f ( a ) + f ′( a )( x − a ) +
( x − a)2 +
( x − a )3
2!
3!
1
1
5
= 2 + ( x − 8) −
( x − 8) 2 +
( x − 8) 3
12
288
20736
f ′′′( x ) =
Svar:
T3 ( x ) = 2 +
1
1
5
( x − 8) −
( x − 8) 2 +
( x − 8) 3
12
288
20736
Uppgift 2.
x x3
− +R
1! 3!
b) Använd resultat i a) för att bestämma Maclaurinpolynomet av ordning 6 för
funktionen y = sin( x 2 ) .
a) Visa med Maclaurins formel av ordning 3 att sin x =
Lösning:
a) f ( x ) = sin x ,
f (0) = 0
f ′( x ) = cos x ,
f ′(0) = 1
f ′′( x ) = − sin x , f ′′(0) = 0
f ′′′( x ) = − cos x ,
f ′′′(0) = −1
Enligt Maclaurins formel har vi
f ′′(0) 2 f ′′′(0) 3
x3
f ( x ) = f (0) + f ′(0) x +
x +
x +R= x− +R
2!
3!
3!
3
t t
b) Eftersom sin t = − + R , substitution t = x 2 ger
1! 3!
2
2 3
x
(x )
x6
sin( x 2 ) =
−
+ R = x2 −
+R
1!
3!
6
Svar:
b) Maclaurinpolynomet av ordning 6 för funktionen y = sin( x 2 ) är
x6
P6 = x − .
6
2
Uppgift 3. Använd formel
x x2 x3
xn
ex = 1 + +
+
+ ... +
+R
1! 2! 3!
n!
för att bestämma Maclaurinpolynomet av ordning 3 för funktionen y = e 3 x .
Lösning:
t t2 t3
t
Eftersom e = 1 + + + + R , substitution t = 3x ger
1! 2! 3!
3 x (3x ) 2 (3 x ) 3
9x2 9x3
e3x = 1 +
+
+
+ R = 1 + 3x +
+
+R
1!
2!
3!
2
2
4
5
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
Svar: Maclaurinpolynomet av ordning 3 för funktionen y = e 3 x är 1 + 3x +
9x2 9x3
+
2
2
Uppgift 4.
a) Bestäm Maclaurinpolynomet (=Taylorpolynomet kring punkten 0 ) av ordning 4
för funktionen y = cos x .
cos x − 1 +
b) Använd polynomet i a ) för att beräkna lim
x − >0
cos x − 1 +
c) Beräkna samma gränsvärde lim
x − >0
Lösning
a)
f ( x) = cos x ,
f ′( x) = − sin x ,
f ′′( x) = − cos x ,
f ′′′( x) = sin x ,
f ( 4 ) ( x) = cos x ,
x4
x4
x2
2 .
x2
2 med hjälp av L’ Hospitals regel.
f (0) = 1
f ′(0) = 0
f ′′(0) = −1
f ′′′(0) = 0
f ( 4) (0) = 1 .
f ′(0)
f ′′(0) 2 f ′′′(0) 3 f ( 4 ) (0) 4
M 4 ( x) = f (0) +
x+
x +
x +
x
1!
2!
3!
4!
1
1
M 4 ( x) = 1 − x 2 + x 4
2!
4!
1 2 1 4
M 4 ( x) = 1 − x +
x .
2
24
⇒
b) Metod 1. Vi använder Maclaurins serie för cos(x).
x2
1 2 1 4 x6
x2
cos x − 1 +
(1 − x +
x −
+ L) + ( −1 + )
2 = lim
2
24
6!
2
lim
4
4
x − >0
x
−
>
0
x
x
1 x2
1
1
+ L) ( − 0 + 0 L)
( −
( x 4 + L)
1
= lim 24 4
= lim 24 6!
= 24
=
.
x −>0
x − >0
x
1
1
24
Metod 2: Vi använder Maclaurins formel. (Samma ide som i metod 1 med skillnaden
i beteckning)
1
1 4 f ( 5 ) (c ) 5
x2
x2
(1 − x 2 +
x +
x ) + (−1 + )
cos x − 1 +
2
24
5!
2
2 = lim
lim
x − >0
x − >0
x4
x4
5
6
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
1 4 f ( 5) ( c ) 5
1
f ( 5) ( c )
x +
x )
( +
x)
1
24
5
!
24
5
!
= lim
= lim
=
.
4
x − >0
x −>0
x
1
24
(
c)
x2
2 = ⎡ " 0 " ⎤ [L’Hospital ]
lim
⎢ 0 ⎥
x − >0
x4
⎣
⎦
"
"
− sin x + x ⎡ 0 ⎤
= lim
= ⎢
⎥ [L’Hospital ]
x − >0
4x3
⎣ 0 ⎦
− cos x + 1 ⎡ " 0 " ⎤
= lim
= ⎢
⎥ [L’Hospital ]
x − >0
12 x 2
⎣ 0 ⎦
sin x ⎡ " 0 " ⎤
= lim
= ⎢
⎥ [L’Hospital ]
x − > 0 24 x
⎣ 0 ⎦
cos x 1
= lim
=
.
x − > 0 24
24
cos x − 1 +
Svar: a) M 4 ( x) = 1 −
1 2 1 4
x +
x
2
24
b)
1
24
c)
1
24
Uppgift 5.
a) Bestäm Maclaurinpolynomet (=Taylorpolynomet kring x0 = 0 ) av ordning 3 för
funktionen y = e x .
b) Bestäm Maclaurinserie för funktionen y = e x .
c) Använd Maclaurinpolynomet (eller Maclaurinserie) för att beräkna
x2
e x − (1 + x + )
2 .
lim
3
x − >0
x
x2
e x − (1 + x + )
2 med hjälp av
d) Beräkna samma gränsvärde lim
3
x − >0
x
l’ Hospitals regel.
Lösning
a)
f ( x) = e x ,
f ′( x ) = e x ,
f ′′( x ) = e x ,
f ′′′( x ) = e x ,
f (0) = 1
f ′(0) = 1
f ′′(0) = 1
f ′(0) = 1
6
7
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
f ′(0)
f ′′(0) 2 f ′′′(0) 3
x+
x +
x ⇒
1!
2!
3!
1
1
1
M 3 ( x) = 1 + x + x 2 + x 3 ⇒
1!
2!
3!
1
1
1
M 3 ( x) = 1 + x + x 2 + x 3
1
2
6
1
1
1
Svar a) M 3 ( x ) = 1 + x + x 2 + x 3
1
2
6
M 3 ( x ) = f (0) +
b)
f ′(0)
f ′′(0) 2 f ′′′(0) 3
x+
x +
x + ...
1!
2!
3!
∞
1
1 2 1 3
xn
M ∞ ( x ) = 1 + x + x + x + ... = ∑
1
2
6
n =0 n!
M ∞ ( x ) = f ( 0) +
1
1
1
Svar b) M ∞ ( x ) = 1 + x + x 2 + x 3 + ... =
1
2
6
∞
xn
∑
n =0 n!
c)
e x − (1 + x +
lim
x −>0
x3
x2
)
2 =
1
1
1
1 4
1 5
x2
(1 + x + x 2 + x 3 +
x +
x + ...) − (1 + x + )
1
2
6
24
120
2
lim
3
x − >0
x
1 3 1 4
1 1
1 2
1
+
+ 0 + 02 + L
x +
x +L
x+
x L
1
24
120
lim 6
= lim 6 24
= 6
= .
3
x − >0
x − >0
x
1
1
6
1
Svar c)
6
x2
e x − (1 + x + )
2 = ⎡ " 0 " ⎤ [L’Hospital ]
d) lim
⎢ 0 ⎥
x −>0
x3
⎣
⎦
x
"
"
e − (1 + x ) ⎡ 0 ⎤
= lim
= ⎢
⎥ [L’Hospital ]
x − >0
3x 2
⎣ 0 ⎦
e x − 1 ⎡" 0 "⎤
= lim
= ⎢
⎥ [L’Hospital ]
x − >0 6 x
⎣ 0 ⎦
1
ex
= lim =
x − >0 6
6
1
Svar d)
6
1
1
1
Svar: a) M 3 ( x ) = 1 + x + x 2 + x 3
1
2
6
∞
xn
b) ∑
n =0 n!
7
c)
1
6
d)
1
6
8
Armin Halilovic: EXTRA ÖVNINGAR
Taylors formelför envariabelfunktioner
Uppgift 6.
a) Bestäm Maclaurinpolynomet (=Taylorpolynomet kring punkten a= 0 ) av ordning 2
för funktionen y = x + 1
b) Beräkna approximativt 1.2 med hjälp av Taylorpolynomet.
f ( c ) ( n +1)
c) Uppskatta felet med hjälp av formeln för restterm: R=
( x − a ) n +1 , där c
( n + 1)!
är ett tal mellan a och x .
Lösning:
a)
1
1
3
f ( x) = x + 1 , f ′( x) = ( x + 1) −1 / 2 , f ′′( x) = − ( x + 1) −3 / 2 , f ′′′( x) = ( x + 1) −5 / 2
2
4
8
3
1
1
f (0) = 1 , f ′(0) = , f ′′(0) = − , f ′′′(c) = (c + 1) −5 / 2 .
8
2
4
Enligt Taylors formel kring x0 = 0 gäller
f ′(0)
f ′′(0) 2
f ( x ) = f (0) +
x+
x +R
1!
2!
f ′′′( c ) 3
där R =
x , c är ett tal mellan 0 och x
3!
1
1
f ′(0)
f ′′(0) 2
P2 ( x ) = f (0) +
x+
x = 1 + x − x2 .
1!
2!
2
8
1
1
Svar a) P2 ( x) = 1 + x − x 2
2
8
b) För att beräkna 1.2 substituerar vi x =0.2 i funktionen y = x + 1 ,
1
1
som vi approximerar med polynomet P2 ( x) = 1 + x − x 2 :
2
8
1
1
1.2 = 0.2 + 1 ≈ P2 (0.2) = 1 + ⋅ 0.2 − ⋅ 0.2 2 = 1.095 .
2
8
Svar b) 1.2 ≈ 1.095
c) För felet gäller
3
(c + 1) −5 / 2
′
′
′
1
1
1
f (c) 3 8
0.2 3 <
x |=
0.2 3 =
0.2 3 = 0.0005 .
|R|= |
5/ 2
3!
(3)!
16
16 (c + 1)
Svar c) |R|< 0.0005
8