MATH 164, Spring 2001 Due Date: Name(s): Project 12.10a: Maclaurin Series Objective To investigate the approximation of a function by its Maclaurin series using Maple. Narrative If you have not already done so, read Section 12.10 of the text. In this project we investigate the approximation of f(x) = sin x and f(x) = ln(1 + x) by their respective Maclaurin series expansions. In so doing we introduce two new commands: taylor(f(x),x=a,n) finds the nth order Taylor series expansion of f(x) about the point x = a p := convert(g,polynom) truncates the Taylor series approximation g(x) to the polynomial p(x) Tasks 1. a) Type the command lines in the left-hand column below into Maple in the order in which they are listed. These commands are aimed at producing several Maclaurin series approximations to f(x) = sin x. > # Project 12.10a: Mclaurin Series > # Part a > restart; Clear Maple's memory. > f := x -> sin(x); Let f(x) = sin x. > t2 := taylor(f(x),x=0,2); p2 := convert(%,polynom); Let p2(x) be the 2nd order Maclaurin series approximation of f(x). > t4 := taylor(f(x),x=0,4); p4 := convert(%,polynom); Let p4(x) be the 4th order Maclaurin series approximation of f(x). > t6 := taylor(f(x),x=0,6); p6 := convert(%,polynom); Let p6(x) be the 6th order Maclaurin series approximation of f(x). > t8 := taylor(f(x),x=0,8); p8 := convert(%,polynom); Let p8(x) be the 8th order Maclaurin series approximation of f(x). > plot({f(x),p2,p4,p6,p8},x=-2*Pi..2*Pi,y=-2..2); Plot f(x), p2(x), p4(x), p6(x), and p8(x). b) Continue by typing the command lines in the left-hand column below into Maple in the order in which they are listed. These commands are aimed at producing several Maclaurin series approximations to f(x) = ln(1 + x). > # Part b > restart; Clear Maple's memory. > f := x -> ln(1+x); Let f(x) = ln(1 + x). > t2 := taylor(f(x),x=0,2); p2 := convert(%,polynom); Let p2(x) be the 2nd order Maclaurin series approximation of f(x). > t3 := taylor(f(x),x=0,3); p3 := convert(%,polynom); Let p3(x) be the 3rd order Maclaurin series approximation of f(x). > t4 := taylor(f(x),x=0,4); p4 := convert(%,polynom); Let p4(x) be the 4th order Maclaurin series approximation of f(x). > t5 := taylor(f(x),x=0,5); p5 := convert(%,polynom); Let p5(x) be the 5th order Maclaurin series approximation of f(x). > plot({f(x),p2,p3,p4,p5},x=-2..2,y=-8..2); Plot f(x), p2(x), p3(x), p4(x), and p5(x) over a large range. > plot({f(x),p2,p3,p4,p5},x=-1..1,y=-1..1); Plot f(x), p2(x), p3(x), p4(x), and p5(x) over a restricted range. 2. On the graphic you produced for part (a) of Task 1, label by hand the graphs of f(x) and p2(x), p4(x), p6(x), and p8(x). Label the graph of p2(x) by "p2(x)", for example. 3. On both graphics you produced for part (b) of Task 1: a) draw the line whose equation is x = -1 by hand, and b) label by hand the graphs of f(x) and p2(x), p3(x), p4(x), and p5(x). Label the graph of p2(x) by "p2(x)", for example. Comments Note how well both power series approximate the given functions near the origin. Also note the differences between power series which converge over the entire real number line (f(x) = sin x) and those that do not (f(x) = ln(1 + x)).