Lab on Taylor Polynomials This Lab is accompanied by an Answer Sheet that you are to complete and turn in to your instructor. In this Lab we will approimate complicated unctions by simple unctions. The simplest unctions are polynomials. We will need to use commands deined in the student package. Enter with(student[calculus]: at the beginning o your worksheet. (Recall that using a colon : instead o a semi-colon ; suppresses the blue-colored output. Maple has a built-in unction called D that can be used to compute derivatives. For a previously deined unction, the command D(; will give you the derivative o with respect to its input variable, whatever that may be. You can also use the command di((,; or the derivative o. Practice: Try deining some easy unctions, whose derivatives you already know, to make sure D(; works the way you d epect. Recall that a unction is deined, or eample, as ollows: := -> *ep(; In many cases, it will be useul to name the derivative unction. For eample, you can do this by typing w := D(;. Then, i you want to plot this derivative o, you simply type plot{w, -5 5};. To get a second derivative, you can use either D(w; or D(D(;. Practice: Try deining a unction, compute the derivative, re-name the derivative unction (as described above, and then plot both the unction and the derivative on the same set o aes. You can keep track o what curve represents which unction by assigning colors to the curves. To speciy the order, use square brackets [ ] instead o the usual { }. For eample, plot([,w], -3..3, color = [red, blue]; will plot the two unctions on the interval 3 3where the unction is in red and the unction w is in blue. Try evaluating the unction and the derivative at various values o. Recall that when Maple can, it will try to supply you with an eact orm o the result o a calculation. For eample, i = sin, then π will return. Try it. I you want to get a decimal approimation instead, you can use the 4 command eval((π/4;. Problem #: For the ollowing two unctions, irst calculate the derivative by hand and then use Maple to check your answer. I they aren t a direct match, determine i they are equivalent by using algebra and/or trigonometric identities. On the solution paper that you turn in, write down both answers (the one by hand and the one given by Maple. Recall that Pi = π, ep( = e, tan(= tan, and ln(= ln. 3 = e (b g = ln ln( y tan( π (a ( tan( π Problem #: Continue to consider the unction e degree polynomial p = A + B ( =. Using Maple to help you, ind a irst that has the same value and the same irst derivative as when = 0. In other words, you ll need to determine the correct values or A and B to make it so that 0 0 p 0 = 0. p ( = ( and ( ( I you want to ind the value o at = 0, you can type eval((0;. Net, ind a second degree polynomial o the orm p = C + D + E that has the same value, the same irst derivative, and the same second derivative as when = 0. In other words, determine the correct values or C, D and E using Maple to assist you. On the solution paper that you turn in, write down both answers.
Problem #3 Now, plot the two polynomials you ve ound, along with the unction on the same set o aes. Using colors, as described above, will help you keep track o what curve represents which unction. Warning: Be careul in choosing your range o values or plotting. You may need to adjust the -interval to get a better view o the graph. I you re seeing dramatic vertical lines on your Maple plot, you are choosing a bad interval. Recall that tan is not deined when ever cos ( = 0. This means, or eample, that graphing will cause big problems (do you see it?. On your solution, answer the ollowing questions. c What problem occurs when you try to plot on the interval [-,]? d What does p represent geometrically? e O the two polynomials p and, which graph appears to be closer to the graph o? Evaluate the unctions at the points listed in the table below out to 4 decimal places. Complete this table. a For what range o values does p seem to be a good approimation or b For what range o values does seem to be a good approimation or p -0.4-0. -0. -0.0 0 0.0 0. 0. 0.4 g How do the values o p and compare with the values o? Would you reine your answers to part (a and (b ater taking this closer look at the unction values? Eplain. h How would you go about inding a polynomial p 3 o degree 3 that would be a good approimation or close to = 0? What would you require o such a polynomial? p n o (arbitrary degree n? i Can you generalize your requirements or a polynomial ( Problem #4 The polynomial and the polynomial your work rom Problem # write down the general ormula or p and p above is called the Taylor polynomial o degree or near = 0 is called the Taylor polynomial o degree or near = 0. By repeating or an arbitrary unction. Using your conclusions rom Problem #3, give the ormula or the Taylor polynomial o degree n or near = 0. It might be easier to work this problem out by hand rather than with Maple. Problem #5 Find the Taylor polynomials o degree 5, 6, and 7 or some Taylor polynomials or = sin the same? = sin near = 0. Why are Problem #6 Take the general ormula or a Taylor polynomial o degree n or near = a ound in your ( i ( i tet book. Show that pn ( a = ( a or all i = 0,,... n. Recall that in this notation, the superscript i reers to the order o the derivative. The Taylor polynomials near = a are good approimations or at values o that are close to = a. The higher the degree o the polynomial, the better the approimation and the larger the interval around = a on which the polynomial is a good approimation.
Problem #7 Find the Taylor polynomials o degree 5, 6, and 7 or sin hand irst and list on your answer sheet. = near π =. Do this by Maple can ind the Taylor polynomials or you! To check your answer, type TaylorApproimation(sin(,=Pi/,order=5..7;. You can also plot the unction together with the Taylor polynomials using the command: TaylorApproimation(sin(, =Pi/, order=5..7, output=plot, view=[-0..0,-..]; (The view option command allows you to tell Maple what ranges o s and y s to display. You can also use the animation eature o Maple to see the polynomials displayed one ater another. TaylorApproimation(sin(, =Pi/, order=..0, view=[-..7,-..], output=animation; To see the animation, ater you hit enter you ll see a set o aes appear. Click on it. Then click on the animation button on the top o the tool bar. Click play to see the polynomials displayed one ater another. You an also click net several times to display one polynomial ater another at your own speed. y = e Practice: Find, plot, and animate the Taylor polynomials o degrees up to 5 or the unction near = 0. You will need to ind a viewing window that allows you to understand how the polynomials approimate the unction. Conjecture the orm o the Taylor polynomial o degree n or y = e near = 0. Warning! Maple multiplies out the actorials! y = near = 0 or some complicated unction that you choose. Do not choose one that was done in your tet book, but invent your own unction. Take the time to view the plots. Include the Taylor polynomials and cut and paste a picture o the plots onto your lab solution. Be careul to select the best viewing window that shows the unction and the Taylor polynomials most completely. To complete this lab, use Maple to ind the Taylor polynomials o degree 5, 6, and 7 or
Answer Sheet or Lab on Taylor Polynomials Name: Problem #: For the ollowing two unctions, write the irst derivative ormulas, plus an eplanation o why Maple s answer or the irst unction looked dierent. 3 = e (b g = ln ln( y tan( π (a ( ( tan( π Problem #: For the unction = e, the polynomials p = A + B p = C + D + E have the orms: and Problem #3 a For what range o values does p seem to be a good approimation or b For what range o values does seem to be a good approimation or c What problem occurs when you try to plot on the interval [-,]? d What does p represent geometrically? e O the two polynomials p and, which graph appears to be closer to the graph o?
Evaluate the unctions at the points listed in the table below out to 4 decimal places. Complete this table. p -0.4-0. -0. -0.0 0 0.0 0. 0. 0.4 g How do the values o p and compare with the values o? Would you reine your answers to part (a and (b ater taking this closer look at the unction values? Eplain. h How would you go about inding a polynomial or close to = 0? What would you require o such a polynomial? p 3 o degree 3 that would be a good approimation i Can you generalize your requirements or a polynomial p n o (arbitrary degree n? Problem #4 The general ormula or p and or an arbitrary unction are given as Problem #5 The Taylor polynomials o degree 5, 6, and 7 or sin Why are some Taylor polynomials or = sin the same? = near = 0 are listed here.
Problem #6 Take the general ormula or a Taylor polynomial o degree n or near = a ound in your i i tet book. Show that p a a i = 0,,.... ( ( ( ( n = or all n Problem #7 The Taylor polynomials o degree 5, 6, and 7 or sin = near π = are given by: y = near = 0 or a unction that I chose are given here. List the unction itsel, plus the three Taylor polynomial ormulas. Attach a print out o the plots that show the unction and the polynomials on the same set o aes. The Taylor polynomials o degree 5, 6, and 7 or