Math 10b Ch. 8 Reading 1: Introduction to Taylor Polynomials Introduction: In applications, it often turns out that one cannot solve the differential equations or antiderivatives that show up in the real world. One has to find other ways to work with these problems. One answer is to approximate these functions (the solutions to the differential equations or antiderivatives) with simpler functions. In this chapter we will approximate these functions with polynomials, called Taylor Polynomials. These are often good for approximating a function near one specific point. If you want to study ongoing periodic phenomena, you would instead approximate your functions with trig functions. That s a whole different area of study, called Fourier approximations. I. Linear Approximations It turns out that we already know the first Taylor polynomial approximation it s also called the tangent line! Example: Find the tangent line to f(x) = cos x + 1 at x =. Graph both f(x) and the tangent line. Solution: Graph: f( ) = cos( ) + 1 = 1 f (x) = sin x slope of tangent line = f ( ) = sin( ) = 1 tangent line: y 1 = ( 1)(x ) tangent line: y = ( 1)(x ) + 1 3 f(x) 1 0-1 We can use this tangent line to approximate the function f(x) = cos x + 1 for x values that are close to x =. We can see this from the graph, but we can also do this numerically. For example, 1.570796, so x = 1.5 is an x value that s pretty close to. Computing f(1.5) is hard, because we don t know what cos(1.5) is. But we can get an approximation by plugging x = 1.5 into the formula for the tangent line. We get y = (1.5 ) + 1 1.070796. If we ask a calculator to find f(1.5), we get f(1.5) 1.07073, so it s quite close, but much easier to compute the tangent line approximation than the actual value.
Generalizing: Tangent Line First Taylor Polynomial We can do this for any differentiable function. Let f(x) be the function we re trying to approximate. Suppose f is differentiable at x = a. Let s start by looking at the tangent line to the graph of f at x = a. It has slope f (a) and passes through the point (a, f(a)), so the equation of the tangent line is y f(a) = f (a)(x a), which we can rewrite as y = f(a) + f (a)(x a). Note that this is a polynomial of degree 1 and that for values of x near x = a f(x) f(a) + f (a)(x a). In other words, if we re near x = a, we can approximate f(x) with its tangent line: y = f(x) y = f(a) + f (x)(x a) (a, f(a)) a Definition: We call the tangent line the first Taylor polynomial of f(x) about x = a and we denote it by P 1 (x). In other words, P 1 (x) = f(a) + f (a)(x a) and near x = a, f(x) P 1 (x). Key fact: P 1 (x) has two things in common with f(x): (a) The graphs of both pass through the point (a, f(a)), so P 1 (a) = f(a). (b) The graphs of both have slope f (a) at that point, so P 1(a) = f (a). Example. Find first Taylor polynomial for f(x) = e x about x = 0. Solution. We know that f(x) = e x and a = 0. Also know that f (x) = e x. So (a) f(a) = f(0) = e 0 = 1 (b) f (a) = f (0) = e 0 = 1 P 1 (x) = f(a) + f (x)(x a) = 1 + 1(x 0) = 1 + x, so P 1 (x) = 1 + x.
II. Taylor Polynomials of Degree Looking back at our first example (f(x) = cos x + 1), we notice that the tangent line is not a very good approximation if our x value is farther away from x =, say at x = 0, and is a terrible approximation if we look even further away, say at x = 1.5. We want to find a way to improve our approximation. More specifically, we want to find a quadratic polynomial P (x) that satisfies both of the conditions given above, meaning that P (a) = f(a) and P (a) = f (a). We also want P (x) to bend in the right way at x = a, meaning we want it to have the same concavity as f(x) at x = a. This last means that P (a) = f (a). This picture gives an idea of what we want: P (x) y = f(x) P 1 (x) (a, f(a)) a Now we derive the formula for P (x). Note that P (x) is a polynomial of degree, so P (x) = c 0 + c 1 x + c x. We need to find the coefficients c 0, c 1 and c. We can take the derivative twice to see that P (x) = c 1 + c x and P (x) = c. Now we work through the algebra: (a) P (a) = f(a), so c 0 + c 1 a + c a = f(a). (b) P (a) = f (a), so c 1 + c a = f (a). (c) P (a) = f (a), so c = f (a). From the third equation, we get that c = f (a). Substituting this back into the second equation and simplifying gives c 1 = f (a) af (a).
Finally, substituting the results for c 0 and c 1 back into the first equation and simplifying gives c 0 = f(a) af (a) + a f (a). So P (x) can be written as follows: ) P (x) = (f(a) af (a) + a f (a) + ( ) f (a) af (a) x + f (a) If we multiply out and rearrange terms on the right-hand side, we get P (x) = f(a) + f (a)(x a) + f (a) (x a). This is the second Taylor polynomial for f(x) about x = a. Example. Find the second Taylor polynomial for f(x) = e x about x = 0. Solution. We know that f(x) = e x and a = 0. We also know that f (x) = e x and f (x) = e x. So (a) f(a) = f(0) = e 0 = 1 (b) f (a) = f (0) = e 0 = 1 (c) f (a) = f (0) = e 0 = 1 P (x) = f(a)+f (x)(x a)+ f (a) (x a) = 1+1(x 0)+ 1 (x 0) = 1+x+ x, so P (x) = 1 + x + x. x. III. Taylor Polynomials of Higher Degree As one might imagine, the higher the degree of our approximating polynomial, the better approximation it gives. So we define the nth Taylor polynomial as follows: Let f(x) be a function and let a be a point in its domain. Suppose that f (a), f (a), f (a),..., f (n) (a) all exist. Then the nth Taylor polynomial for f about x = a is P n (x) = f(a) + f (a)(x a) + f (a)! (x a) + f (a) 3! (x a) 3 + + f (n) (a) (x a) n = n! n n=0 f (i) (a) (x a) i. i! Example. Find the second and third Taylor polynomials for f(x) = cos x + 1 about x =.
Solution: f( ) = cos( ) + 1 = 1 f (x) = sin x so f ( ) = sin( ) = 1 f (x) = cos x so f ( ) = cos( ) = 0 f (x) = sin x so f ( ) = sin( ) = 1 P 1 (x) = 1 (x ) (we computed this in the first example) Graph: P (x) = 1 (x ) + 0 (happens to be the same as P 1(x)) P 3 (x) = 1 (x ( ) + (1 6 ) x ) 3 3 P 1 (x) = P (x) f(x) 1 P 3 (x) 0-1 Notice how P 3 (x) (in green above) follows f(x) (in red) more closely for a wider interval of x values than the tangent line (in blue). So now, for example, we can estimate f(3) by finding P (3) = 1 (3 ) + ( 1 6 ) ( 3 ) 3 0.057. The actual value of f(3) 0.01. It s not perfect, but it s a huge improvement over the tangent line approximation at x = 3, which will give us a negative value!