Making Models with Polynomials: Taylor Series

Similar documents
Outline. Making Models with Polynomials: Interpolation Making Models with Monte Carlo Error, Accuracy and Convergence Floating Point

Section Taylor and Maclaurin Series

Chapter 11. Taylor Series. Josef Leydold Mathematical Methods WS 2018/19 11 Taylor Series 1 / 27

Math 651 Introduction to Numerical Analysis I Fall SOLUTIONS: Homework Set 1

Numerical Methods. CS Spring 2017

Optimization using Calculus. Optimization of Functions of Multiple Variables subject to Equality Constraints

Taylor and Maclaurin Series

TAYLOR AND MACLAURIN SERIES

Math Numerical Analysis

Math 112 Rahman. Week Taylor Series Suppose the function f has the following power series:

July 21 Math 2254 sec 001 Summer 2015

Section Example Determine the Maclaurin series of f (x) = e x and its the interval of convergence.

Math 115 HW #5 Solutions

MATH 1231 MATHEMATICS 1B Calculus Section 4.4: Taylor & Power series.

e x = 1 + x + x2 2! + x3 If the function f(x) can be written as a power series on an interval I, then the power series is of the form

AP Calculus Testbank (Chapter 9) (Mr. Surowski)

Lecture 32: Taylor Series and McLaurin series We saw last day that some functions are equal to a power series on part of their domain.

Math Real Analysis II

Floating Point Number Systems. Simon Fraser University Surrey Campus MACM 316 Spring 2005 Instructor: Ha Le

Review: Power series define functions. Functions define power series. Taylor series of a function. Taylor polynomials of a function.

DSP-I DSP-I DSP-I DSP-I

Integration by Substitution

Numerical Methods. King Saud University

Chapter 8: Taylor s theorem and L Hospital s rule

MATH 1231 MATHEMATICS 1B CALCULUS. Section 5: - Power Series and Taylor Series.

Representation of Functions as Power Series.

AP Calculus (BC) Chapter 9 Test No Calculator Section Name: Date: Period:

Part 3.3 Differentiation Taylor Polynomials

4.4 Uniform Convergence of Sequences of Functions and the Derivative

n f(k) k=1 means to evaluate the function f(k) at k = 1, 2,..., n and add up the results. In other words: n f(k) = f(1) + f(2) f(n). 1 = 2n 2.

Review of Power Series

Math 106 Calculus 1 Topics for first exam

Examination paper for TMA4215 Numerical Mathematics

MATH 163 HOMEWORK Week 13, due Monday April 26 TOPICS. c n (x a) n then c n = f(n) (a) n!

Math 200 University of Connecticut

8.3 Partial Fraction Decomposition

Completion Date: Monday February 11, 2008

(x 3)(x + 5) = (x 3)(x 1) = x + 5. sin 2 x e ax bx 1 = 1 2. lim

Differentiation. Table of contents Definition Arithmetics Composite and inverse functions... 5

EXAMPLE OF ONE-STEP METHOD

5.9 Representations of Functions as a Power Series

Lecture 5: Function Approximation: Taylor Series

b n x n + b n 1 x n b 1 x + b 0

Taylor and Maclaurin Series. Copyright Cengage Learning. All rights reserved.

AP Calculus Chapter 9: Infinite Series

Applied Calculus I. Lecture 29

MAT137 Calculus! Lecture 45

Computing Taylor series

Chapter 3: Root Finding. September 26, 2005

Learning From Data Lecture 25 The Kernel Trick

Hermite Interpolation

MATH141: Calculus II Exam #4 review solutions 7/20/2017 Page 1

B553 Lecture 1: Calculus Review

Chapter 11 - Sequences and Series

Final exam (practice) UCLA: Math 31B, Spring 2017

CALCULUS JIA-MING (FRANK) LIOU

Ma 530 Power Series II

x 2 y = 1 2. Problem 2. Compute the Taylor series (at the base point 0) for the function 1 (1 x) 3.

SOLVED PROBLEMS ON TAYLOR AND MACLAURIN SERIES

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

Lecture 22: Integration by parts and u-substitution

Principles of Scientific Computing Local Analysis

Exploring Substitution

Math 113 (Calculus 2) Exam 4

On the number of ways of writing t as a product of factorials

cse547, math547 DISCRETE MATHEMATICS Professor Anita Wasilewska

Introduction and Review of Power Series

Mathematics 136 Calculus 2 Everything You Need Or Want To Know About Partial Fractions (and maybe more!) October 19 and 21, 2016

Section 1.x: The Variety of Asymptotic Experiences

lecture 4: Constructing Finite Difference Formulas

JUST THE MATHS UNIT NUMBER DIFFERENTIATION APPLICATIONS 5 (Maclaurin s and Taylor s series) A.J.Hobson

1.4 Techniques of Integration

1 Introduction; Integration by Parts

Numerical Analysis and Computing

Bindel, Spring 2012 Intro to Scientific Computing (CS 3220) Week 12: Monday, Apr 16. f(x) dx,

3.4. ZEROS OF POLYNOMIAL FUNCTIONS

Calculus II Study Guide Fall 2015 Instructor: Barry McQuarrie Page 1 of 8

Announcements. Topics: Homework:

Power Series Solutions And Special Functions: Review of Power Series

Chapter 13: Integral Calculus. SSMth2: Basic Calculus Science and Technology, Engineering and Mathematics (STEM) Strands Mr. Migo M.

Methods of Integration

Math 162: Calculus IIA

SOLVING DIFFERENTIAL EQUATIONS

REVIEW OF DIFFERENTIAL CALCULUS

Let s Get Series(ous)

MAT137 Calculus! Lecture 48

1 Solutions to selected problems

Math 142, Final Exam, Fall 2006, Solutions

Solutions to Calculus problems. b k A = limsup n. a n limsup b k,

MTH4101 CALCULUS II REVISION NOTES. 1. COMPLEX NUMBERS (Thomas Appendix 7 + lecture notes) ax 2 + bx + c = 0. x = b ± b 2 4ac 2a. i = 1.

Introduction to Numerical Analysis

2 Analogies between addition and multiplication

Lecture for Week 2 (Secs. 1.3 and ) Functions and Limits

IRRATIONALITY OF π AND e

Math 201 Solutions to Assignment 1. 2ydy = x 2 dx. y = C 1 3 x3

11.10a Taylor and Maclaurin Series

Sequences and Series

Chapter 9: Infinite Series Part 2

Math 0230 Calculus 2 Lectures

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

Transcription:

Making Models with Polynomials: Taylor Series

Why polynomials? i a 3 x 3 + a 2 x 2 + a 1 x + a 0 How do we write a general degree n polynomial? n a i x i i=0 Why polynomials and not something else? We can add, multiply, maybe divide (grade school, computer HW) 1

Why polynomials? ii More complicated functions (e x, sin x, x) have to be built from those parts at least approximately Easy to work with as a building block. General recipe for numerics: Model observation with a polynomial, perform operation on that, evaluate. (e.g. calculus, root finding) 2

Reconstructing a Function From Derivatives i Given f ( ), f ( ), f ( ),... can we reconstruct a polynomial f? f (x) =??? +???x +???x 2 + For simplicity, let us consider = 0 and a degree 4 polynomial f f (x) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + a 4 x 4 Note that a 0 = f (0). Now, take a derivative f (x) = a 1 + 2a 2 x + 3a 3 x 2 + 4a 4 x 3 3

Reconstructing a Function From Derivatives ii we see that a 1 = f (0), differentiating again f (x) = 2a 2 + 3 2a 3 x + 4 3a 4 x 2 yields a 2 = f (0)/2, and finally f (x) = 3 2a 3 + 4 3 2a 4 x yields a 3 = f (0)/3!. In general, a i = f (i) (0)/i!. 4

Reconstructing a Function From Derivatives i Found: Taylor series approximation. f (0 + x) f (0) + f (0)x + f (0) x 2 + 2 The general Taylor expansion with center = 0 is f (x) = i=0 f (i) (0) x i i! Demo: Polynomial Approximation with Derivatives (click to visit) (Part I) 5

Shifting the Expansion Center i Can you do this at points other than the origin? In this case, 0 is the center of the series expansion. We can obtain a Taylor expansion of f centered at by defining a shifted function g(x) = f (x + ) The Taylor expansion g with center 0 is as before g(x) = i=0 g (i) (0) x i i! 6

Shifting the Expansion Center ii This expansion of g yields a Taylor expansion of f with center f (x) = g(x x0) = i=0 g (i) (0) (x ) i i! It suffices to note that f (i) ( ) = g (i) (0) to get the general form f (x) = i=0 f (i) ( ) (x ) i or f ( + h) = i! i=0 f (i) ( ) h i i! 7

Errors in Taylor Approximation (I) i Can t sum infinitely many terms. Have to truncate. How big of an error does this cause? Demo: Polynomial Approximation with Derivatives (click to visit) (Part II) Suspicion, as h 0, we have n f (x f (i) ( ) 0 + h) h i C h n+1 i! i=0 }{{} Taylor error for degree n or n f (x f (i) ( ) 0 + h) h i = O(h n+1 ) i! i=0 }{{} Taylor error for degree n 8

Errors in Taylor Approximation (I) ii As we will see, there is a satisfactory bound on C for most functions f. 9

Making Predictions with Taylor Truncation Error i Suppose you expand x 10 in a Taylor polynomial of degree 3 about the center = 12. For h 1 = 0.5, you find that the Taylor truncation error is about 10 4. What is the Taylor truncation error for h 2 = 0.25? Error(h) = O(h n+1 ), where n = 3, i.e. Error(h 1 ) C h 4 1 Error(h 2 ) C h 4 2 10

Making Predictions with Taylor Truncation Error ii While not knowing C or lower order terms, we can use the ratio of h 2 /h 1 ( h2 ) 4 Error(h 1 ) ( ) 4 h2 Error(h 2 ) C h 4 2 = C h 4 1 h 1 h 1 Can make prediction of the error for one h if we know another. Demo: Polynomial Approximation with Derivatives (click to visit) (Part III) 11

Taylor Remainders: the Full Truth i Let f : R R be (n + 1)-times differentiable on the interval (, x) with f (n) continuous on [, x]. Then there exists a ξ (, x) so that f ( + h) n i=0 and since ξ h n f ( + h) i=0 f (i) ( ) i! h i = f (n+1) (ξ) (n + 1)! } {{ } C f (i) ( ) f h i (n+1) (ξ) i! (n + 1)! } {{ } C (ξ ) n+1 h n+1. 12

Intuition for Taylor Remainder Theorem i Given the value of a function and its derivative f ( ), f ( ), prove the Taylor error bound. We express f (x) as x f (x) = f ( ) + f (w 0 )dw 0 13

Intuition for Taylor Remainder Theorem ii We then express the integrand f (w 0 ) for w 0 [, x] using f in the same way f (w )dw x ( w0 ) f (x) = f ( ) + f ( ) + dw 0 1 1 x ( w0 ) = f ( ) + f ( )(x ) + }{{} f (w 1 )dw 1 dw 0 Taylor expansion t 1 (x) 14

Intuition for Taylor Remainder Theorem iii We can bound the error by finding the maximizer ξ = argmax ξ [x0,x] f (ξ) f (x) t 1 (x) x ( w0 ) f (ξ) dw 1 dw 0 = f (ξ) (x ) 2 2! f ( + h) t 1 ( + h) f (ξ) h 2 for x = + h 2! In-class activity: Taylor series 15

Proof of Taylor Remainder Theorem i We can complete the proof by induction of the Taylor degree expansion n f (x) = t n 1 (x) + x w0 wn 1 f (n) (w n )dw n dw 0 Given the formula above, it suffices to expand wn f (n) (w n ) = f (n) ( ) + f (n+1) (w n+1 )dw n+1 16

Proof of Taylor Remainder Theorem ii Inserting this back in gives us the next inductive hypothesis f (x) = t n 1 (x) + f (n) ( ) (x ) n }{{ n! } + Taylor expansion t n(x) x w0 wn f (n+1) (w n+1 )dw n+1 dw 0 17

Proof of Taylor Remainder Theorem iii The bound follows as for n = 1, with ξ = argmax ξ [x0,x] f (n+1) (ξ) f (x) t n (x) x w0 wn = f (ξ) (n + 1)! (x ) n+1 f (n+1) (ξ) dw n+1 dw 0 f ( + h) t n ( + h) f (ξ) (n + 1)! hn+1 for x = + h 18

Using Polynomial Approximation i Suppose we can approximate a function as a polynomial: f (x) a 0 + a 1 x + a 2 x 2 + a 3 x 3. How is that useful? E.g.: What if we want the integral of f? Easy: Just integrate the polynomial: t s f (x)dx t s a 0 + a 1 x + a 2 x 2 + a 3 x 3 dx t t t t = a 0 1dx + a 1 x dx + a 2 x 2 dx + a 3 x 3 dx s s s s 19

Using Polynomial Approximation ii Even if you had no idea how to integrate f using calculus, you can approximately integrate f anyway, by taking a bunch of derivatives (and forming a Taylor polynomial). Demo: Computing Pi with Taylor (click to visit) 20