Taylor series

advertisement
Taylor series
Definitions
The Taylor series of a function f (x), that is infinitely differentiable in a neighbourhood
of a given value a, is defined by the infinite series of polynoms:
f (x) = f (a) +
f 00 (a)
f 000 (a)
f 0 (a)
(x − a) +
(x − a)2 +
(x − a)3 + ...
1!
2!
3!
(1)
which can be written in the most compact form:
f (x) =
∞
X
f (n) (a)
n!
n=0
(x − a)n
(2)
where n! denotes the factorial of n (n! = n(n − 1)(n − 2)...1) and f (n) (a) denotes the nth
derivative of f evaluated at the point a; the zeroth derivative of f is defined to be f itself.
In the particular case where a = 0, the series is also called a Maclaurin series:
f (x) =
∞
X
f (n) (0)
n=0
n!
xn
(3)
Remark 1
By definition, the more terms we take in a convergent power series, the better is the
approximation to the function f given by the power series. The 2-term approximation
f (x) = f (a) + f 0 (a)(x − a)
(4)
is equivalent to approximating f (x) near a by a tangent line at x = a (figure 1).
Remark 2
The Taylor approximation (4) is sometimes used in a slightly different form, obtained by
introducing the change of variable:
x − a = , so that x = a + (5)
If x is close to a, the perturbation is small, and we can rewrite eq. (4) as:
f (x) = f (a) + f 0 (a)(x − a)
f (a + ) = f (a) + f 0 (a)
with
0
f (a) =
df (x)
dx
(6)
(7)
x=a
Figure 1: The red function defined by eq. (4) is a good approximation of the blue function
f (x) around x = a.
Particular developments
Here are some common McLaurin developments (i.e. Taylor series around a = 0).
∞
X
1
= 1 + x + x2 + x3 + .... =
xn
1−x
n=0
(8)
∞
X xn
x2 x3 x4
+
+
+ ... =
e =1+x+
2
3!
4!
n!
n=0
x
(9)
∞
X
x2 x3
xn
ln(1 + x) = x −
(−1)n+1
+
− ... =
2
3
n
n=1
(10)
∞
X (−1)n
x3 x5
+
− ... =
x2n+1
sin(x) = x −
3!
5!
(2n
+
1)!
n=0
(11)
∞
X (−1)n
x2 x4
cos(x) = 1 −
+
− ... =
x2n
2!
4!
(2n)!
n=0
(12)
For x small, we thus have the following approximations:
1
≈1+x
1−x
ex ≈ 1 + x
ln(1 + x) ≈ x
etc.
2
(13)
(14)
(15)
Examples
Figure 2 shows the Taylor development for the functions f (x) = sin(x) (eq. 11) and
f (x) = ln(x + 1) (eq. 10). As we can see, more terms we take, closer is the polynomial
function (red) to the given function (blue).
2
y=x−x3/3!
1.5
y=x−x3/3!+x5/5!
y=x
y=sin(x)
1
y
0.5
0
−0.5
−1
−1.5
−2
−10
−8
−6
−4
−2
0
2
4
6
8
10
x
4
y=x−x2/2+x3/3
3
y=x
2
y=ln(1+x)
y
1
0
y=x−x2/2
−1
−2
y=x−x2/2+x3/3−x4/4
−3
−4
−1
−0.5
0
0.5
1
1.5
2
2.5
3
x
Figure 2: Taylor development for the functions y = sin(x) (top panel) and y = ln(x + 1)
(bottom panel) around a = 0.
3
Generalization
The Taylor development can be generalized to functions of several variables. For a function
of two variables f (x, y), the Taylor development around (a, b) becomes:
1
1
1 00
f (x, y) = f (a, b)+fx0 (a, b)x+fy0 (a, b)y + fx00 (a, b)x2 + fy00 (a, b)y 2 + fxy
(a, b)xy +... (16)
2
2
2
where fx0 denotes the derivative of f (x) with respect to x, fx00 denotes the second derivative
00
of f (x) with respect to x, fxy
denotes the derivative of f (x) with respect to x and y, i.e.
=
fy0 (a, b) =
fx0 (a, b)
∂f (x, y)
∂x
x=a,y=b
∂f (x, y)
∂y
x=a,y=b
2
x=a,y=b
fx00 (a, b) =
∂ f (x, y)
∂x2
fy00 (a, b) =
∂ 2 f (x, y)
∂y 2
x=a,y=b
fx00 y(a, b) =
x=a,y=b
2
∂ f (x, y)
∂x∂y
(17)
Remark
For a function of two variables, if x and y are small perturbations, the approximation
(6) becomes:
f (a + x , b + y ) ≈ f (a, b) + fx0 (a, b)x + fy0 (a, b)y
(18)
where
∂f (x, y)
=
∂x
x=a,y=b
∂f
(x,
y)
fy0 (a, b) =
∂y
x=a,y=b
fx0 (a, b)
4
(19)
Download