Seunghee Ye Ma 8: Week 7 Nov 10 Week 7 Summary This week, we will learn how we can approximate integrals using Taylor series and numerical methods. Topics Page 1 Approximating Integrals using Taylor Polynomials 1 1.1 Definitions . .1 1.2 Examples . .2 1.3 Approximating Integrals . .3 2 Numerical Integration 5 1 Approximating Integrals using Taylor Polynomials 1.1 Definitions When we first defined the derivative, recall that it was supposed to be the \instantaneous rate of change" of a function f(x) at a given point c. In other words, f 0 gives us a linear approximation of f(x) near c: for small values of " 2 R, we have f(c + ") ≈ f(c) + "f 0(c) But if f(x) has higher order derivatives, why stop with a linear approximation? Taylor series take this idea of linear approximation and extends it to higher order derivatives, giving us a better approximation of f(x) near c. Definition (Taylor Polynomial and Taylor Series) Let f(x) be a Cn function i.e. f is n-times continuously differentiable. Then, the n-th order Taylor polynomial of f(x) about c is: n X f (k)(c) T (f)(x) = (x − c)k n k! k=0 The n-th order remainder of f(x) is: Rn(f)(x) = f(x) − Tn(f)(x) If f(x) is C1, then the Taylor series of f(x) about c is: 1 X f (k)(c) T (f)(x) = (x − c)k 1 k! k=0 Note that the first order Taylor polynomial of f(x) is precisely the linear approximation we wrote down in the beginning. Now that we defined Taylor polynomials as higher order extensions of the linear approximation, we have to justify our claim that Taylor polynomials are indeed approximations. So what does it mean for a Taylor polynomial Tn(f)(x) to be a good approximation of f(x)? It means that Tn(f)(x) should be close to the true value of f(x). In other words, we want f(x) − Tn(f)(x) to be close to 0. But we defined this difference to be something... n Theorem 1.1. Let Rn(f)(x) be the n-th order remainder of f(x). Then, Rn(f)(x) is o((x − c) ). Page 1 of 6 Seunghee Ye Ma 8: Week 7 Nov 10 Theorem 1.1 is saying precisely that Tn(f)(x) is very close to the real value of f(x) when x is near c. Hence, we have our justification for calling Taylor polynomials \higher order approximations" of f(x). Now, we look at another very useful theorem, which will actually let us compute Rn(f)(x). Theorem 1.2. Suppose f(x) is (n + 1)-times continuously differentiable. Then, Z x (n+1) f (y) n Rn(f)(x) = (x − y) dy c n! With Theorem 1.2, we will be able to know exactly by how much Tn(f)(x) is off the true value of f(x). 1.2 Examples Example 1.1. Compute the Taylor series for f(x) = ex about 0. Solution. Recall that the Taylor series of f(x) is simply 1 X f (k)(0) xk k! k=0 However, for all k, f (k)(x) = ex. Hence, for all k, f (k)(0) = e0 = 1. Therefore, 1 1 X f (k)(0) X xk ex = xk = k! k! k=0 k=0 as we already know. Here are the Taylor series about 0 for some of the functions that we have come across several times. Try to do a couple of them as an exercise! 1 x3 x5 X x2k+1 • sin x = x − + − · · · = (−1)k 3! 5! (2k + 1)! k=0 1 x2 x4 X x2k • cos x = 1 − + − · · · = (−1)k 2! 4! (2k)! k=0 1 1 X • = xk 1 − x k=0 Let's look closely at the Taylor series for sin x and cos x. It looks like we've split up the Taylor series of x x2 e = 1 + x + 2! + ··· into two and alternated signs. So can we find any relation between these three Taylor series? The answer is yes and in fact, we will see something amazing come out of the inspection. Let i be the imaginary number. If you have never seen i before, it's just some \number" (not real) with the property that i2 = −1. As baffling as it might be to raise a number to a complex power, let's take a leap of faith and Page 2 of 6 Seunghee Ye Ma 8: Week 7 Nov 10 raise e to ix power and see what we get. Plugging in ix in the Taylor series for ex we get: (ix)2 (ix)3 (ix)4 (ix)5 eix = 1 + (ix) + + + + + ··· (1) 2! 3! 4! 5! x2 ix3 x4 ix5 = 2 + ix − − + + − · · · (2) 2! 3! 4! 5! x2 x4 x6 ix3 ix5 ix7 = 1 − + − + ··· + ix − + − + ··· (3) 2 4! 6! 3! 5! 7! x2 x4 x6 x3 x5 x7 = 1 − + − + ··· + i x − + − + ··· (4) 2 4! 6! 3! 5! 7! 1 ! 1 ! X x2k X x2k+1 = (−1)k + i (−1)k (5) (2k)! (2k + 1)! k=0 k=0 = cos x + i sin x (6) So there we have it! eix = cos x + i sin x If you are still not convinced that this formula is the most beautiful thing you've seen in math, try plugging in x = π. If we let x = π, what do we get? eiπ = cos π + i sin π = −1 ) eiπ + 1 = 0 This equation is called the Euler's formula and dubbed \the most beautiful equation in mathematics". 0; 1; π; e; and i are arguably the five most important numbers in all of math and to see them appear in one equation is indeed quite amazing! 1.3 Approximating Integrals Now, we will see how Taylor polynomials can help us approximate integrals. For example, consider the 2 Gaussian integral R e−x dx called the Gaussian for short. The Gaussian is a very important integral, one of the properties being that it is the curve that represents the normal distribution a.k.a. the bell curve. We would like to evaluate the Gaussian but there is one problem: there is no elementary antiderivative 2 of e−x . This means that we cannot rely on the Fundamental Theorem of Calculus to evaluate the integral. But using Taylor series, we can approximate the value of this integral. 1 Z 3 2 Example 1.2. Approximate e−x dx to within 10−6 of its actual value. 0 −x2 −x2 Solution. To simplify notation, we will write Tn(x) and Rn(x) for Tn(e )(x) and Rn(e )(x), respectively. −x2 For any n, we have e = Tn(x) + Rn(x). By integrating both sides, we obtain 1 1 1 Z 3 Z 3 Z 3 −x2 e dx = Tn(x)dx + Rn(x)dx 0 0 0 1 Z 3 Now, Tn(x) is just a polynomial. Therefore, Tn(x)dx is an integral that we can explicitly compute. On 0 R the other hand, we know that Rn(x) goes to 0 as n increases. So the idea is to make j Rn(x)dxj small by R 1=3 −6 increasing n: In our case, we want to find n such that j 0 Rn(x)dxj < 10 . By Theorem 1.2, we have Z x −y −x n+1 e n Rn(e )(x) = (−1) (x − y) dy 0 n! Page 3 of 6 Seunghee Ye Ma 8: Week 7 Nov 10 However, note that n 2 k ! 2 2 X (−x ) R (x) = e−x − T (x) = e−x − = R (e−x)(x2) n n k! n k=0 Hence, we see that Z x2 −y n+1 e 2 n Rn(x) = (−1) (x − y) dy 0 n! Unfortunately, this is not something we can easily integrate. However, we are not interested in the actual value of the integral. We are only interested in making this integral close to 0. 2 −y 0 2 n 2 n How do we bound Rn(x)? First, note that for any y 2 [0; x ], e ≤ e = 1; and (x − y) ≤ (x − 0) = 2n 2 2−y 2 n x . Note also that for all y 2 [0; x ], we have n! (x − y) ≥ 0. This gives us 2 Z x e−y n+1 2 n jRn(x)j = (−1) (x − y) dy (7) 0 n! 2 Z x e−y = (x2 − y)ndy (8) 0 n! 2 Z x 1 ≤ x2ndy (9) 0 n! 2 x2n x = y (10) n! 0 x2n+2 = (11) n! In our case, we want 1 1 1 Z 3 Z 3 x2n+2 x2n+3 3 −6 Rn(x)dx ≤ dx = < 10 0 0 n! (2n + 3)n! 0 Therefore, we need to find a value of n for which 1 12n+3 < 10−6 (2n + 3)n! 3 Checking small values of n = 1; 2::: we see that when n = 3, the inequality is satisfied. 1 1 Z 3 Z 3 −6 −x2 This means that T3(x)dx is within 10 of the true value of e dx. First, let's compute T3(x) 0 0 which is easy since we already know that Taylor series of ex: x4 x6 T (x) = 1 − x2 + − 3 2 3! 1 We can now integrate T3(x) over [0; 3 ] to approximate the Gaussian: 1 1 Z 3 Z 3 4 6 2 x x T3(x)dx = 1 − x + − dx (12) 0 0 2 6 1 x3 x5 x7 3 = x − + − (13) 3 10 42 0 147604 = (14) 459270 Page 4 of 6 Seunghee Ye Ma 8: Week 7 Nov 10 Therefore, we conclude that 1 Z 3 2 147604 e−x dx = ± 10−6 0 459270 This example shows that Taylor polynomials can be used effectively to approximate integrals.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-