Math Numerical Analysis

Similar documents
Taylor and Maclaurin Series. Approximating functions using Polynomials.

Taylor Series. Math114. March 1, Department of Mathematics, University of Kentucky. Math114 Lecture 18 1/ 13

Taylor and Maclaurin Series. Approximating functions using Polynomials.

Outline. Math Numerical Analysis. Intermediate Value Theorem. Lecture Notes Zeros and Roots. Joseph M. Mahaffy,

Math Numerical Analysis

Taylor and Maclaurin Series

8.5 Taylor Polynomials and Taylor Series

Completion Date: Monday February 11, 2008

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

Section 5.8. Taylor Series

Section 8.7. Taylor and MacLaurin Series. (1) Definitions, (2) Common Maclaurin Series, (3) Taylor Polynomials, (4) Applications.

Section Taylor and Maclaurin Series

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

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

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 =

3.4 Introduction to power series

1 Question related to polynomials

(c) Find the equation of the degree 3 polynomial that has the same y-value, slope, curvature, and third derivative as ln(x + 1) at x = 0.

Math 113 (Calculus 2) Exam 4

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

8.7 MacLaurin Polynomials

11.10a Taylor and Maclaurin Series

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

Numerical Analysis and Computing

8.7 Taylor s Inequality Math 2300 Section 005 Calculus II. f(x) = ln(1 + x) f(0) = 0

Infinite Series. Copyright Cengage Learning. All rights reserved.

Introduction Derivation General formula List of series Convergence Applications Test SERIES 4 INU0114/514 (MATHS 1)

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

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

MAT137 Calculus! Lecture 45

The polar coordinates

Ma 530 Power Series II

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

Math 115 HW #5 Solutions

You can learn more about the services offered by the teaching center by visiting

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.

July 21 Math 2254 sec 001 Summer 2015

TAYLOR AND MACLAURIN SERIES

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

Sequences and Series

AP Calculus Chapter 9: Infinite Series

Math 106 Fall 2014 Exam 2.1 October 31, ln(x) x 3 dx = 1. 2 x 2 ln(x) + = 1 2 x 2 ln(x) + 1. = 1 2 x 2 ln(x) 1 4 x 2 + C

Introduction Derivation General formula Example 1 List of series Convergence Applications Test SERIES 4 INU0114/514 (MATHS 1)

Physics 250 Green s functions for ordinary differential equations

Chapter 8: Taylor s theorem and L Hospital s rule

Study # 1 11, 15, 19

f (x) = k=0 f (0) = k=0 k=0 a k k(0) k 1 = a 1 a 1 = f (0). a k k(k 1)x k 2, k=2 a k k(k 1)(0) k 2 = 2a 2 a 2 = f (0) 2 a k k(k 1)(k 2)x k 3, k=3

SECTION A. f(x) = ln(x). Sketch the graph of y = f(x), indicating the coordinates of any points where the graph crosses the axes.

Examples of the Fourier Theorem (Sect. 10.3). The Fourier Theorem: Continuous case.

Let s Get Series(ous)

Lecture 5: Function Approximation: Taylor Series

Infinite series, improper integrals, and Taylor series

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

Chapter 3: Root Finding. September 26, 2005

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

Math 162 Review of Series

Advanced Calculus Math 127B, Winter 2005 Solutions: Final. nx2 1 + n 2 x, g n(x) = n2 x

Calculus (Math 1A) Lecture 6

Analysis II: Basic knowledge of real analysis: Part V, Power Series, Differentiation, and Taylor Series

Math 1102: Calculus I (Math/Sci majors) MWF 3pm, Fulton Hall 230 Homework 4 Solutions

CHALLENGE! (0) = 5. Construct a polynomial with the following behavior at x = 0:

MATH 118, LECTURES 27 & 28: TAYLOR SERIES

B553 Lecture 1: Calculus Review

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

Part 3.3 Differentiation Taylor Polynomials

Math Review for Exam Answer each of the following questions as either True or False. Circle the correct answer.

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

a x a y = a x+y a x a = y ax y (a x ) r = a rx and log a (xy) = log a (x) + log a (y) log a ( x y ) = log a(x) log a (y) log a (x r ) = r log a (x).

Math 0230 Calculus 2 Lectures

Math 221 Notes on Rolle s Theorem, The Mean Value Theorem, l Hôpital s rule, and the Taylor-Maclaurin formula. 1. Two theorems

MATH 1372, SECTION 33, MIDTERM 3 REVIEW ANSWERS

Section 10.7 Taylor series

THE LIMIT PROCESS (AN INTUITIVE INTRODUCTION)

Math 180, Final Exam, Fall 2012 Problem 1 Solution

Tangent Lines Sec. 2.1, 2.7, & 2.8 (continued)

MA2501 Numerical Methods Spring 2015

Numerical Methods. King Saud University

MTAEA Differentiation

Chapter 4 Sequences and Series

LIMITS AT INFINITY MR. VELAZQUEZ AP CALCULUS

This practice exam is intended to help you prepare for the final exam for MTH 142 Calculus II.

MATH 1910 Limits Numerically and Graphically Introduction to Limits does not exist DNE DOES does not Finding Limits Numerically

1.4 Techniques of Integration

Power Series Solutions We use power series to solve second order differential equations

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

Math 227 Sample Final Examination 1. Name (print) Name (sign) Bing ID number

False. 1 is a number, the other expressions are invalid.

WebAssign Lesson 6-3 Taylor Series (Homework)

Taylor Series and Maclaurin Series

11.5. The Chain Rule. Introduction. Prerequisites. Learning Outcomes

Learning Objectives for Math 166

Power Series. x n. Using the ratio test. n n + 1. x n+1 n 3. = lim x. lim n + 1. = 1 < x < 1. Then r = 1 and I = ( 1, 1) ( 1) n 1 x n.

Section 9.7 and 9.10: Taylor Polynomials and Approximations/Taylor and Maclaurin Series

Making Models with Polynomials: Taylor Series

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

Chapter 9: Infinite Series Part 2

AP Calculus BC Spring Final Part IA. Calculator NOT Allowed. Name:

3.1 Interpolation and the Lagrange Polynomial

MATH1190 CALCULUS 1 - NOTES AND AFTERNOTES

PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435

Transcription:

Math 541 - Numerical Analysis Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 918-770 http://jmahaffy.sdsu.edu Spring 018 (1/4)

Outline 1 Definitions Taylor s Theorem (/4)

Why Review Calculus??? Definitions Taylor s Theorem It s a good warm-up for our brains! When developing numerical schemes we will use theorems from calculus to guarantee that our algorithms make sense. If the theory is sound, when our programs fail we look for bugs in the code! (3/4)

Definitions Taylor s Theorem Background Material A Crash Course in Calculus Key concepts from Calculus Limits Continuity Differentiability Taylor s Theorem (4/4)

Limit Definitions Taylor s Theorem The most fundamental concept in Calculus is the limit. Definition (Limit) A function f defined on a set X of real numbers X R has the limit L at x 0, written lim f(x) = L x x 0 if given any real number ɛ > 0, there exists a real number δ > 0 such that f(x) L < ɛ whenever x X and 0 < x x 0 < δ. (5/4)

Continuity Definitions Taylor s Theorem Definition (Continuity (at a point)) Let f be a function defined on a set X of real numbers, and x 0 X. Then f is continuous at x 0 if lim f(x) = f(x 0 ). x x 0 It is important to note that computers only have discrete representation, not continuous. Thus, the computer is often making approximations. (6/4)

Derivative Definitions Taylor s Theorem Definition (Differentiability (at a point)) Let f be a function defined on an open interval containing x 0 (a < x 0 < b). f is differentiable at x 0 if f (x 0 ) = lim x x 0 f(x) f(x 0 ) x x 0 exists. If the limit exists, f (x 0 ) is the derivative at x 0. Note: This is the slope of the tangent line at f(x 0 ). The derivative is used often in this course, and sometimes an approximate derivative is adequate. (7/4)

Taylor s Theorem Definitions Taylor s Theorem The following theorem is the most important one for you to remember from Calculus. Theorem (Taylor s Theorem with Remainder) Suppose f C n [a, b], f (n+1) exists on [a, b], and x 0 [a, b]. Then for all x (a, b), there exists ξ(x) (x 0, x) with f(x) = P n (x) + R n (x) where P n (x) = n k=0 f (k) (x 0 ) (x x 0 ) k, k! R n (x) = f (n+1) (ξ(x)) (x x 0 ) (n+1). (n + 1)! P n (x) is called the Taylor polynomial of degree n, and R n (x) is the remainder term (truncation error). Note: f (n+1) exists on [a, b], but is not necessarily continuous. (8/4)

Important Important : Below are important functions studied in Calculus e x = cos(x) = sin(x) = x n n! ( 1) n x n (n)! ( 1) n x n+1 (n + 1)! (9/4)

Example 1: Approximate sin 1 Example 1: Approximate sin(x) with x near π 6 We know sin ( ) π 6 = 1, so what about sin ( π 6 + 0.1) Since f(x) C (, ), we can use Taylor s theorem: f(x) = f(x 0 ) + f (x 0 )(x x 0 ) + 1! f (x 0 )(x x 0 ) +... = 1 n! f (n) (x 0 )(x x 0 ) n (10/4)

Example 1: Approximate sin From Taylor s theorem sin(x) with x near π 6 1 d n sin(x) = n! dx n sin(x) x= π 6 = ( π ) ( π ) ( = sin + cos x π 6 6 6 1 ( π ) (! sin x π 6 6 But sin ( ) π 6 = 1 and cos ( ) π 6 = 3 ( x π ) n 6 ) ) 1 3! cos ( π 6 ) ( x π 6 ) 3 +... (11/4)

Example 1: Approximate sin 3 With information above and x = π 6 + 0.1, we have sin(x) = 1 3 + = 1 [ 1 1 ( x π ) 1 +! 6 4! [ ( x π ) 1 6 3! ( 1) n (n)! ( x π ) ] 4... 6 ) ] 3 +... ( x π 6 ( x π ) n 3 + 6 It follows that sin ( π 6 + 0.1) satisfies: ( π ) sin 6 + 0.1 = 1 ( 1) n (n)! (0.1)n + 3 ( 1) n ( x π ) n+1 (n + 1)! 6 ( 1) n (n + 1)! (0.1)n+1 (1/4)

Example 1: Approximate sin 4 Examining the infinite sums, we see both the (0.1) n and the factorials in the denominator resulting terms going to zero We truncate the series at n = N, gives the approximation at x = π 6 + 0.1 ( π ) sin 6 + 0.1 1 N ( 1) n 3 (n)! (0.1)n + N ( 1) n (n + 1)! (0.1)n+1 Truncating the series at n = N leaves a polynomial of order N + 1 T N (x) = 1 N ( 1) n (n)! where x is close to π 6 ( x π ) n 3 + 6 N ( 1) n ( x π ) n+1, (n + 1)! 6 (13/4)

Example 1: Approximate sin 5 The error or remainder satisfies: R N (x) = 1 n=n+1 ( 1) n (n)! ( x π ) n+ 3 6 n=n+1 Thus, sin ( π 6 + 0.1) = T N ( π 6 + 0.1) + R N ( π 6 + 0.1) ( 1) n ( x π ) n+1, (n + 1)! 6 If we use the approximation from the previous page with x = π 6 + 0.1, we find the following polynomial evaluations: Poly Order Approximation Error sin ( π ( 6 + 0.1) 0.58396036 T π 1 ( 6 + 0.1) 1 0.5866054 0.4546% T π ( 6 + 0.1) 3 0.5839580-0.00037% T π 3 6 + 0.1) 5 0.58396036 8.56 10 8 % (14/4)

Example 1: Approximate sin 6 Below is the graph of y = sin(x) with the Taylor polynomial fits of order 1, 3, and 5, passing through x 0 = π 6 1.5 1 sin(x) T1(x) T(x) T3(x) x0 sin(x) 0.5 y 0 0.5 1 1.5 π/ π/3 π/6 0 π/6 π/3 π/ x We observe even a cubic polynomial fits the sine function well (15/4)

Example 1: Approximate sin 7 The remainder term in Taylor s theorem is useful for finding bounds on the error. Recall R n (x) = f (n+1) (ξ) (n + 1)! (x x 0) (n+1) with ξ (x 0, x). However, we rarely know ξ. A bound on the error satisfies max R n(x) = max x [x 0 δ,x 0+δ] x [x 0 δ,x 0+δ] f (n+1) (ξ) x x 0 (n+1) (n + 1)! δ n+1 max (n + 1)! f (n+1) (ξ) x [x 0 δ,x 0+δ] (16/4)

Example 1: Approximate sin 8 For this example, the (n + 1) st derivative of f(x) = sin(x) satisfies f (n+1) (ξ) 1, and we are taking δ = 0.1 It follows that max R n(x) x [x 0 δ,x 0+δ] δ n+1 max (n + 1)! f (n+1) (ξ) x [x 0 δ,x 0+δ] δ n+1 (n + 1)! (0.1)n+1 (n + 1)! We saw the error for T (x) (cubic fit) was.16 10 6. The error approximation gives E 3 (x) (0.1)4 4! which is only double the actual error 4.17 10 6, (17/4)

Example : Integrate cos(cos(x)) 1 Example : Consider the following integral: π 0 cos(cos(x))dx This is not an integral that is readily solvable with standard methods Can we obtain a reasonable approximation? Maple and MatLab can numerically solve this problem Later in the course we learn quadrature methods for solving Polynomials are easy to integrate, so let s try using Taylor s theorem and integrate the truncated polynomial. (18/4)

Example : Integrate cos(cos(x)) Our function is clearly C (, ), so Taylor s theorem readily applies 1 d n f(0) f(x) = cos(cos(x)) = n! dx n xn There is no easy form for dn f(0) dx, but taking a few terms is not hard n f(0) = cos(cos(0)) = cos(1) f (0) = sin(cos(0)) sin(0) = 0 f (0) = cos(cos(0)) sin (0) + sin(cos(0)) cos(0) = sin(1) It follows that a quadratic approximating polynomial is: f(x) P (x) = cos(1) + sin(1) x 0 (19/4)

Example : Integrate cos(cos(x)) 3 The integral gives the area under the curve. The figure below shows f(x) = cos(cos(x)) and the second order Maclaurin series expansion P (x) = cos(1) + sin(1) x f(x) P(x) f(x) = cos(cos(x)) 1.5 y 1 0.5 0 0 π/4 π/ x (0/4)

Example : Integrate cos(cos(x)) 4 The nd order Maclaurin series expansion P (x) = cos(1) + sin(1) x is easily integrable π 0 cos(cos(x))dx = π 0 ( cos(1) + sin(1) ) x dx (cos(1)x + sin(1)x3 = π cos(1) 6 + π3 sin(1) 48 ) π 0 1.3965, which is larger than the actual value (1.01970) as seen in the graph. This is a 15.8% error, so not great. (1/4)

Example : Integrate cos(cos(x)) 5 How much is the error improved if the interval is divided into two equal intervals? This time we use Taylor s expansions around x 0 = 0 and x 0 = π 4, and again truncate with nd order polynomials About x 0 = π 4, Taylor s series is ( ) ( ) sin T (x) = cos + ( ) ( sin cos + 4 0.7604 + 0.45936 4 ( x π ) 4 ) ( x π 4 ) ( x π ) ( + 0.03960 x π ) 4 4 (/4)

Example : Integrate cos(cos(x)) 6 The integral is now approximated by π 4 0 where π cos(cos(x))dx + cos(cos(x))dx π 4 P (x) 0.54030 + 0.4074 x and ( T (x) 0.7604 + 0.45936 x π 4 π 4 0 π P (x)dx + T (x)dx, π 4 ) + 0.03960 ( x π ) 4 However, integrating these quadratic polynomials is easy π 4 0 π P (x)dx + T (x)dx 0.4997 + 0.74517 = 1.37469, π 4 which is only a.95% error from the actual value (3/4)

Example : Integrate cos(cos(x)) 7 The figure below shows a diagram for the computations done above with two approximating quadratics for finding the area f(x) = cos(cos(x)) 1.5 1 f(x) P (x) T (x) y 0.5 0 0 0.7854 1.5708 x (4/4)