Lab09: Taylor Polynomials

In practice, it is not feasible to use an infinite Taylor series for computations; therefore one often uses Taylor polynimials.  In this lab, we use  Mathematica to create Taylor polynomials, and then we will use these polynomials to explore the relationships between a function’s Taylor series and its corresponding Taylor plynomials.  For the necessary syntax, look at the example below.

Example:

The (n^th) degree Taylor polunomial, centered at a, for a function f(x) is defined as follows

(Subscript[T, n])(x)=(∑_(k=0)^n)(((f^((k)))(a))/(k!))(((x-a))^k)=f(a)+f'(a)(x-a)+((f''(a))/(2!))(((x-a))^2)+...+(((f^((n)))(a))/(n!))(((x-a))^n)

(a) Find the (9^th) degree Taylor polynomial for f(x)=ln(x) centered at 1 and plot it along with the function.
(b) Plot |(Subscript[T, 9])(x)-ln(x)| in a rectangle [0,3]x[-0.1,0.1] and interpret what you see.

Solutions:

Series[Log[x],{x,1,9}]

Notice that this command gives not only the power series, centered at 1 of degree 9, but also the order of the error term.  To just get the polynomial, use the Normal command as follows.

t9[x_]=Normal[Series[Log[x],{x,1,9}]]

Then the graph of the function and Taylor polynomial is:

Plot[{Log[x],t9[x]},{x,0,3},PlotRange->10,PlotStyle->{Blue,Red}]

where the blue curve is the function and the red curve is the Taylor polunomial.  
For part (b) we have

Plot[Abs[Log[x]-t9[x]],{x,0,3},PlotRange->0.1]

The interpretation of this graph is that the (9^th) degree Taylor polunomial approximates the function accurate to 0.1 on the approximate interval (0.15, 2.1).

Exercises:

For the problems that follow, you will be using the function f(x)=(sin^2)(x).

Use Mathematica to find (Subscript[T, 4])(x), (Subscript[T, 6])(x), (Subscript[T, 8])(x), (Subscript[T, 10])(x), (Subscript[T, 12])(x), and (Subscript[T, 14])(x) for f each centered at a=0.

Plot each of these Taylor polynomials together with the function f in the viewing rectangle [-3, 3]x[-1, 2].  (Print out the plot for (Subscript[T, 4])(x) and (Subscript[T, 14])(x).)

Explain what is occuring in (1.1) and why it is occuring.

Consider the Taylor polynomial of degree 14 found above.

Use this polynomial to approximate (sin^2)(18°), note: 18° = (π/10).

Find the Taylor polynomial of degree 14 for f centered at a=(π/8).  Use this polynomial to approximate (sin^2)(18°).

Compare each of these to the value of (sin^2)(18°) given by Mathematica.  Which of the two approximations is better and why?

Determine the interval on the x-axis such that (Subscript[T, 18])(x) approximates f to within 0.01.  For your plot choose the window so that x∈[-4, 4] and list below your choice for the y interval.

y interval:

Solution x interval:

If we use (Subscript[T, 18])(3) to approximate f(3), explain how we can use the previous problem to determine the accuracy of this approximation and then determine how accurate is this approximation.

Determine the minimal n such that (Subscript[T, n])(x) approximates f(x) to within 0.01 on the entire interval [-4, 4].  (Use Taylor’s inequality.)