Taylor series in numerical computations (review)

Slides:



Advertisements
Similar presentations
Section 11.6 – Taylor’s Formula with Remainder
Advertisements

3- 1 Chapter 3 Introduction to Numerical Methods Second-order polynomial equation: analytical solution (closed-form solution): For many types of problems,
Taylor’s Theorem Section 9.3a. While it is beautiful that certain functions can be represented exactly by infinite Taylor series, it is the inexact Taylor.
CSE Differentiation Roger Crawfis. May 19, 2015OSU/CIS 5412 Numerical Differentiation The mathematical definition: Can also be thought of as the.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
INFINITE SEQUENCES AND SERIES
Part 3 Truncation Errors Second Term 05/06.
Taylor Series (11/12/08) Given a nice smooth function f (x): What is the best constant function to approximate it near 0? Best linear function to approximate.
Lecture 2: Numerical Differentiation. Derivative as a gradient
Part 3 Truncation Errors.
NUMERICAL ERROR ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier.
Taylor Series. Theorem Definition The series is called the Taylor series of f about c (centered at c)
Calculus I – Math 104 The end is near!. 1. Limits: Series give a good idea of the behavior of functions in the neighborhood of 0: We know for other reasons.
Taylor Series (4/7/06) We have seen that if f(x) is a function for which we can compute all of its derivatives (i.e., first derivative f '(x), second derivative.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
9.2 Taylor Series Quick Review Find a formula for the nth derivative of the function.
Taylor Series & Error. Series and Iterative methods Any series ∑ x n can be turned into an iterative method by considering the sequence of partial sums.
The Scientific Method 1. Using and Expressing Measurements Scientific notation is written as a number between 1 and 10 multiplied by 10 raised to a power.
Lecture 2 Number Representation and accuracy
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
ES 240: Scientific and Engineering Computation. Chapter 4 Chapter 4: Errors Uchechukwu Ofoegbu Temple University.
Taylor’s Polynomials & LaGrange Error Review
Consider the following: Now, use the reciprocal function and tangent line to get an approximation. Lecture 31 – Approximating Functions
Chapter 8-Infinite Series Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 31.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter.
9.7 and 9.10 Taylor Polynomials and Taylor Series.
CSE Differentiation Roger Crawfis Prepaid by:
In section 11.9, we were able to find power series representations for a certain restricted class of functions. Here, we investigate more general problems.
The Convergence Problem Recall that the nth Taylor polynomial for a function f about x = x o has the property that its value and the values of its first.
9.3 Taylor’s Theorem Quick Review Tell whether the function has derivatives of all orders at the given values of a.
Remainder Theorem. The n-th Talor polynomial The polynomial is called the n-th Taylor polynomial for f about c.
Numerical Analysis CC413 Propagation of Errors.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Truncation Errors and the Taylor Series Chapter 4.
Maclaurin and Taylor Polynomials Objective: Improve on the local linear approximation for higher order polynomials.
9.3 Taylor’s Theorem: Error Analysis yes no.
Copyright © Cengage Learning. All rights reserved Applications of Taylor Polynomials.
Convergence of Taylor Series Objective: To find where a Taylor Series converges to the original function; approximate trig, exponential and logarithmic.
S ECT. 9-4 T AYLOR P OLYNOMIALS. Taylor Polynomials In this section we will be finding polynomial functions that can be used to approximate transcendental.
Machine arithmetic and associated errors Introduction to error analysis Class II.
In the special case c = 0, T (x) is also called the Maclaurin Series: THEOREM 1 Taylor Series Expansion If f (x) is represented by a power series.
Lecture 25 – Power Series Def: The power series centered at x = a:
Machine arithmetic and associated errors Introduction to error analysis (cont.) Class III.
Section 11.3 – Power Series.
The Taylor Polynomial Remainder (aka: the Lagrange Error Bound)
Taylor series in numerical computations (review, cont.)
Interpolation.
PROGRAMME 12 SERIES 2.
CSE Differentiation Roger Crawfis.
Calculus BC AP/Dual, Revised © : Lagrange's Error Bound
Clicker Question 1 What is the interval of convergence of A. (-, )
Find the Taylor polynomial {image} for the function f at the number a = 1. f(x) = ln(x)
Expressing functions as infinite series
Section 11.3 Power Series.
Taylor and Maclaurin Series
Clicker Question 1 What is the interval of convergence of A. (-, )
FP2 (MEI) Maclaurin Series
CSE Differentiation Roger Crawfis.
Find the Taylor series for f (x) centered at a = 8. {image} .
Taylor Series and Maclaurin Series
Section 11.6 – Taylor’s Formula with Remainder
11.10 – Taylor and Maclaurin Series
Numerical Analysis Lecture 2.
9.7 Taylor Polynomials & Approximations
Chapter 1 / Error in Numerical Method
9.2 Taylor Series.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Applications For practice we denote
Presentation transcript:

Taylor series in numerical computations (review) Class IV

Last time We finish to consider truncation and round-off errors using as an example calculation of the derivative of F(x)=exp(x) Concept of significant digits Loss of significance in numerical subtraction How loss of significance can be avoided. Example – the code loss_of_significance.cc

Taylor’s theorem Any function satisfying certain conditions can be expressed as a Taylor series. A Taylor series is an expansion of a real function f(x) about a point x=c given by the power series ------------------|--------------------------------------------------- > c x 𝒇 𝒙 =𝒇 𝒄 + 𝒇 ′ 𝒄 𝒙−𝒄 + 𝒇 ′′ 𝒄 𝒙−𝒄 𝟐 𝟐! + 𝒇 𝟑 (𝒄) 𝒙−𝒄 𝟑 𝟑! + …+ 𝒇 𝒏 𝒄 𝒙−𝒄 𝒏 𝒏! + 𝑬 𝒏+𝟏 where the error term 𝐸 𝑛+1 = 𝒇 𝒏+𝟏 𝝃 (𝒙−𝒄 𝒏+𝟏 (𝒏+𝟏)! and c < 𝜉<𝑥 If c=0, this expansion is also known as Maclaurin series: (x-c) => x, 𝑓 (𝑛) (c) = 𝑓 (𝑛) (0) and 𝑥< 𝜉<𝑥+ℎ

Taylor series - examples expansion at c=0 , e^(0) = 1 |x| < infinity expansion at c=0, sin(0)=0 |x| < infinity expansion at c=0, cos(0)=1 |x| < infinity

Taylor series - examples expansion at c=0 |x| < 1 expansion at c=0 -1 < x < or = 1

Why do we need to represent a function as a sum of terms? For fast estimation of the value of function To control the errors during estimating the value of the function

Approximation of ln(1.1) using 5 terms in the expansion of ln(1+x) about c=0 ln(1.1) = ln(1+0.1) ~ 0.1 – 0.01/2 + 0.001/3 – 0.0001/4 + 0.00001/5 = = 0.0953103333… The result is correct to six decimal places of accuracy The correct value is 0.09531018...

Summary of these two examples: Approximation of exp(8) using 6 terms in the expansion of exp(x) about c=0 e^8 ~ 1 + 8 + 64/2 + 512/6 + 4096/24 + 32768/120 = 570.066665 Exact value (9 significant digits) e^8 = 2980.95798 Obviously that at x=8 six terms of expansion of exp(x) about c=0 is not sufficient even for very approximate evaluation of exp(8) Summary of these two examples: A Taylor series converges rapidly near the point of expansion (c=0 in our two cases) and slowly (or not at all) at more remote points.

Example of expansions: y = sin(x) A few partial sums of a Taylor series for sin(x) S1 = x S3 = x – (x^3)/6 S5 = x – (x^3)/6 + (x^5)/120 Let us plot the behavior of these partial sums

Taylor series of a polynomial function. Example f(x) = 13 x^2 – 12 x – 5 What is the Taylor series of this function at the point c=2 ? The expansion coefficients are: f(2) = 52 – 24 - 5 = 23 f’(2) = 26* x -12 = 40 f’’(2) = 26 f’’’(2) = 0 . All higher derivatives are zero as well Combining all nonzero terms, we have f(x) ~ 23 + 40*(x-2) + (1/2)*26*(x-2)^2 =? f(x) Yes!

Example of expansion: f(x) = exp(x) A few partial sums of a Taylor series for exp(x) f0 = 1 f1 = 1 + x f2 = 1 + x + (x^2)/2 Let us plot the behavior of these partial sums

f(x+h) In previous lectures we used notation for the function arguments x+h and x which correspond to our current notations as (x+h) -> x, h -> (x-c) , f(x+h) -> f(x) An expansion of f( ) about point x in these old notations can be written as 𝒇 𝒙+𝒉 =𝒇 𝒙 + 𝒇 ′ 𝒙 𝒉 + 𝒇 ′′ 𝒙 𝒉 𝟐 𝟐! + 𝒇 𝟑 (𝒙) 𝒉 𝟑 𝟑! + …+ 𝒇 𝒏 𝒙 𝒉 𝒏 𝒏! + 𝑬 𝒏+𝟏 where 𝐸 𝑛+1 = 𝒇 𝒏+𝟏 (𝝃) 𝒉 𝒏+𝟏 (𝒏+𝟏)! is an error term and 𝑥< 𝜉<𝑥+ℎ