Taylor Polynomials

MAT 229, Spring 2021

Week 8

Supporting materials

If you wish to get a different perspective on the notes below, try either of the following textbook sections.

Stewart’s Calculus
	11.11: Taylor Polynomials

Boelkins/Austin/Schlicker’s Active Calculus
	8.5 Taylor Polynomials and Taylor Series

Tangent line approximation

Questions

Let f(x)=(tan^(-1))(3x).

What is an equation of the tangent line to y=f(x) at x=0?

What is the tangent line approximation to f(x) at 0?

(Video)

f[x_]:=ArcTan[3x]
a=0;
tangent[x_]:=f'[a](x-a)+f[a]
Plot[{f[x],tangent[x]},{x,a-1/2,a+1/2},PlotLabels->Automatic]

Formula

Given a general function g(x) and value x=a, the tangent line approximation to g(x) at a is
	T(x)=g(a)+g'(a)(x-a)

Questions

How does T(a) compare to g(a)?

How does T'(a) compare to g'(a)?

(Video)

Quadratic approximation

The quadratic approximation to function g(x) at x=a is the quadratic polynomial function (Subscript[T, 2])(x)=P (x^2)+Q x+R such that

(Subscript[T, 2])(a)=g(a)

(Subscript[T, 2])'(a)=g'(a)

(Subscript[T, 2])''(a)=g''(a)

It is a little easier to work with (Subscript[T, 2])(x) when it has the form 
	(Subscript[T, 2])(x)=A+B(x-a)+((C(x-a))^2)

Questions

Consider f(x)=cos(x)+sin(2x). We want to find its quadratic approximation when a=0. Let (Subscript[T, 2])(x)=A+B(x-a)+((C(x-a))^2)

What does (Subscript[T, 2])(0)=f(0) tell us about A,B,C?

What does (Subscript[T, 2])'(0)=f'(0) tell us about A,B,C?

What does (Subscript[T, 2])''(0)=f''(0) tell us about A,B,C?

Plot y=f(x) and y=A+B x+C (x^2) together on the same coordinate axes and compare them.

(Video)

f[x_]:=Cos[x]+Sin[2x]
a=0;
quadraticApproximation[x_]:=f''[a]/2(x-a)^2+f'[a](x-a)+f[a]
Plot[{f[x],quadraticApproximation[x]},{x,a-1,a+1},PlotLabels->Automatic]

Questions

Consider g(x)=x ln(x). We want to find its quadratic approximation when a=1. Let (Subscript[T, 2])(x)=A+B(x-a)+((C(x-a))^2)=A+B (x-1)+C (((x-1))^2)

Find the values of A,B,C that make (Subscript[T, 2])(1)=g(1), (Subscript[T, 2])'(1)=g'(1),(Subscript[T, 2])''(1)=g''(1)

What is the absolute error in approximating g(0.8) with (Subscript[T, 2])(0.8)?

What is the absolute error in approximating g(1.5) with (Subscript[T, 2])(1.5)?

(Video)

f[x_]:=x Log[x]
a=1;
quadraticApproximation[x_]:=f''[a]/2(x-a)^2+f'[a](x-a)+f[a]
Plot[{f[x],quadraticApproximation[x]},{x,a-1,a+1},PlotLabels->Automatic]
b=0.8;
Abs[f[b]-quadraticApproximation[b]]
b=1.5;
Abs[f[b]-quadraticApproximation[b]]

Taylor polynomial approximation

Notation

For the next month we will be taking higher order derivatives. Denote the (k^th) derivative of f(x) as (f^((k)))(x).

Factorials

If k is a whole number we say the factorial of k, denoted k!, is the quantity
	k! =1·2·3·4·…·(k-1)·k
Because it is useful to do so, define 0! = 1.

Examples

0 ! = 1

1! =1

2! =1·2=2

3! =1·2·3=6

4! =1·2·3·4=24

5! =1·2·3·4·5=120

Taylor polynomials

The (n^th) degree Taylor polynomial approximation of f(x) at x=a is
	(Subscript[T, n])(x)=(Underoverscript[Σ, (k=0), n])(((f^((k)))(a))/(k!))(((x-a))^k)
	=f(a)+f'(a)(x-a)+(1/(2!))f''(a)(((x-a))^2)+(1/(3!))(f^((3)))(a)(((x-a))^3)+…+(1/((n-1)!))(f^((n-1)))(a)(((x-a))^(n-1))+(1/(n!))(f^((n)))(a)(((x-a))^n)

Notes

The first degree Taylor polynomial approximation is the linear approximation.

The second degree Taylor polynomial approximation is the quadratic approximation.

Questions

What is the fourth degree Taylor polynomial for f(x)=(e^x) at a=0?

Approximate (e^0.5) with this Taylor polynomial. What is the absolute error in this approximation?

Plot it along with y=(e^x).

(Video)

f[x_]:=E^x
a=0;
fourthApproximation[x_]:=f''''[a]/4!(x-a)^4+f'''[a]/3!(x-a)^3+f''[a]/2!(x-a)^2+f'[a](x-a)+f[a]
Plot[{f[x],fourthApproximation[x]},{x,a-2,a+2},PlotLabels->Automatic]
b=0.5;
Abs[f[b]-fourthApproximation[b]]
Plot[Abs[f[x]-fourthApproximation[x]],{x,a-2,a+2},PlotLabel->"Absolute Error"]

Questions

What is the fifth degree Taylor polynomial for g(x)=cos(x) at a=π? Plot it along with y=cos(x).

From this graph, estimate for which range of values of x, this Taylor polynomial approximates cos(x) with error less than 0.1.

(Video)

f[x_]:=Cos[x]
a=Pi;
f'''''[a]
f'''[a]
f'[a]
fourthApproximation[x_]:=f''''[a]/4!(x-a)^4+f''[a]/2!(x-a)^2+f[a]
Plot[{f[x],fourthApproximation[x]},{x,a-Pi,a+Pi},PlotLabels->Automatic]
Plot[{0.1,Abs[f[x]-fourthApproximation[x]]},{x,a-Pi,a+Pi},PlotLabel->"Absolute Error"]

Questions

Given a general differentiable function f(x). Reminder:

The (n^th) degree Taylor polynomial approximation of f(x) at x=a is

	(Subscript[T, n])(x)=f(a)+f'(a)(x-a)+(1/(2!))f''(a)(((x-a))^2)+(1/(3!))(f^((3)))(a)(((x-a))^3)+…+(1/((n-1)!))(f^((n-1)))(a)(((x-a))^(n-1))+(1/(n!))(f^((n)))(a)(((x-a))^n)

How does (Subscript[T, n])(a) compare with f(a)?

How does ((Subscript[T, n])^((1)))(a) compare with (f^((1)))(a)?

How does ((Subscript[T, n])^((2)))(a) compare with (f^((2)))(a)?

How does ((Subscript[T, n])^((3)))(a) compare with (f^((3)))(a)?

(Video)

Clear[a,f]
t4[x_]:=f[a]+f'[a](x-a)+f''[a]/2!(x-a)^2+f'''[a]/3!(x-a)^3+f''''[a]/4!(x-a)^4
t4[a]
t4'[a]
t4''[a]
t4'''[a]
t4''''[a]
t4'''''[a]

Homework

IMath problems on Taylor Polynomials.