EVALUATING A POLYNOMIAL

Similar documents
Advanced Math Quiz Review Name: Dec Use Synthetic Division to divide the first polynomial by the second polynomial.

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

Numerical Mathematical Analysis

Solving Differential Equations Using Power Series

Solving Differential Equations Using Power Series

Review of Power Series

A. H. Hall, 33, 35 &37, Lendoi

A first order divided difference

MAT137 Calculus! Lecture 45

NUMERICAL MATHEMATICS & COMPUTING 6th Edition

Downloaded from

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i

Section 5.2 Series Solution Near Ordinary Point

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

Learning Objectives. Zeroes. The Real Zeros of a Polynomial Function

SYSTEMS OF NONLINEAR EQUATIONS

Appendix: Synthetic Division

6.5 Dividing Polynomials

Roots and Coefficients Polynomials Preliminary Maths Extension 1

15 Nonlinear Equations and Zero-Finders

Method of Frobenius. General Considerations. L. Nielsen, Ph.D. Dierential Equations, Fall Department of Mathematics, Creighton University

Power Series Solutions for Ordinary Differential Equations

Chapter 3: Polynomial and Rational Functions

CALCULUS JIA-MING (FRANK) LIOU

MATH 423 Linear Algebra II Lecture 3: Subspaces of vector spaces. Review of complex numbers. Vector space over a field.

Solving Quadratic and Other Polynomial Equations

MT804 Analysis Homework II

Math 302 Module 4. Department of Mathematics College of the Redwoods. June 17, 2011

1 Lecture 8: Interpolating polynomials.

6.4 Division of Polynomials. (Long Division and Synthetic Division)

Power Series Solutions of Ordinary Differential Equations

ZEROS OF POLYNOMIAL FUNCTIONS ALL I HAVE TO KNOW ABOUT POLYNOMIAL FUNCTIONS

Polynomial Interpolation Part II

Chapter 3: Polynomial and Rational Functions

1. For each statement, either state that it is True or else Give a Counterexample: (a) If a < b and c < d then a c < b d.

(2) Dividing both sides of the equation in (1) by the divisor, 3, gives: =

Homework 8 Solutions to Selected Problems

Polynomial Interpolation with n + 1 nodes

Chapter 5B - Rational Functions

Ch 5.4: Regular Singular Points

3.1 Interpolation and the Lagrange Polynomial

Section 3.1: Characteristics of Polynomial Functions

Chapter 1 Divide and Conquer Algorithm Theory WS 2016/17 Fabian Kuhn

Principle of Mathematical Induction

Numerical Analysis Spring 2001 Professor Diamond

Rational Exponents. Polynomial function of degree n: with leading coefficient,, with maximum number of turning points is given by (n-1)

Let s Get Series(ous)

Dividing Polynomials: Remainder and Factor Theorems

BSM510 Numerical Analysis

Review all the activities leading to Midterm 3. Review all the problems in the previous online homework sets (8+9+10).

Math Numerical Analysis

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

( ) y 2! 4. ( )( y! 2)

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

1.2 Finite Precision Arithmetic

Series Solutions of Differential Equations

Algebra Review. Terrametra Resources. Lynn Patten

MATH NEW HOMEWORK AND SOLUTIONS TO PREVIOUS HOMEWORKS AND EXAMS

Skills Practice Skills Practice for Lesson 10.1

Two Posts to Fill On School Board

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

INTERPOLATION Background Polynomial Approximation Problem:

446 CHAP. 8 NUMERICAL OPTIMIZATION. Newton's Search for a Minimum of f(x,y) Newton s Method

6.1. Rational Expressions and Functions; Multiplying and Dividing. Copyright 2016, 2012, 2008 Pearson Education, Inc. 1

Honors Advanced Mathematics November 4, /2.6 summary and extra problems page 1 Recap: complex numbers

Polynomial Interpolation

Numerical Analysis and Computing

MA4001 Engineering Mathematics 1 Lecture 15 Mean Value Theorem Increasing and Decreasing Functions Higher Order Derivatives Implicit Differentiation

A description of a math circle set of activities around polynomials, especially interpolation.

MTH 05. Basic Concepts of Mathematics I

LIMITS AT INFINITY MR. VELAZQUEZ AP CALCULUS

L1 2.1 Long Division of Polynomials and The Remainder Theorem Lesson MHF4U Jensen

MA2501 Numerical Methods Spring 2015

Chapter 1 Divide and Conquer Polynomial Multiplication Algorithm Theory WS 2015/16 Fabian Kuhn

Ch 7 Summary - POLYNOMIAL FUNCTIONS

Section 4.3. Polynomial Division; The Remainder Theorem and the Factor Theorem

Applications of Homotopy

A Surprising Application of Non-Euclidean Geometry

Topic 17. Analysis of Algorithms

Question 1: The graphs of y = p(x) are given in following figure, for some Polynomials p(x). Find the number of zeroes of p(x), in each case.

Lecture Note 3: Polynomial Interpolation. Xiaoqun Zhang Shanghai Jiao Tong University

Introduction and Review of Power Series

We consider the problem of finding a polynomial that interpolates a given set of values:

Roots of Polynomials

Theory of Equations. Lesson 6. Barry H. Dayton Northeastern Illinois University Chicago, IL 60625, USA. bhdayton/theq/

Fall 2017 Test II review problems

Review of Linear Algebra

Limit Theorems. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Limit Theorems

1. Is the set {f a,b (x) = ax + b a Q and b Q} of all linear functions with rational coefficients countable or uncountable?

Module 5 : Linear and Quadratic Approximations, Error Estimates, Taylor's Theorem, Newton and Picard Methods

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

UMUC MATH-107 Final Exam Information

Series Solution of Linear Ordinary Differential Equations

Introduction to Series and Sequences Math 121 Calculus II Spring 2015

AP Calculus AB. Limits & Continuity.

We say that a polynomial is in the standard form if it is written in the order of decreasing exponents of x. Operations on polynomials:

Roots of Equations Roots of Polynomials

Sect Complex Numbers

Series Solutions Near a Regular Singular Point

4 Nonlinear Equations

Transcription:

EVALUATING A POLYNOMIAL Consider having a polynomial p(x) = a + a 1 x + a 2 x 2 + + a n x n which you need to evaluate for many values of x. How do you evaluate it? This may seem a strange question, but the answer is not as obvious as you might think. The standard way, written in a loose algorithmic format: poly = a for j = 1 : n poly = poly + a j x j end

To compare the costs of different numerical methods, we do an operations count, and then we compare these for the competing methods. Above, the counts are as follows: additions : n multiplications : 1 + 2 + 3 + + n = n(n + 1) 2 This assumes each term a j x j is computed independently of the remaining terms in the polynomial.

Next, do the terms x j recursively: x j = x x j 1 Then to compute { x 2, x 3,..., x n} will cost n 1 multiplications. Our algorithm becomes The total operations cost is poly = a + a 1 x power = x for j = 2 : n power = x power poly = poly + a j power end additions : n multiplications : n + n 1 = 2n 1 When n is not small, this is much less than for the first method of evaluating p(x). E.g., with n = 2, the first method has 21 multiplications, whereas the second has 39 multiplications.

We now considered nested multiplication. As examples of particular degrees, write n = 2 : p(x) = a + x(a 1 + a 2 x) n = 3 : p(x) = a + x (a 1 + x (a 2 + a 3 x)) n = 4 : p(x) = a + x (a 1 + x (a 2 + x (a 3 + a 4 x))) These contain, respectively, 2, 3, and 4 multiplications. This is less than the preceding method, which would have need 3, 5, and 7 multiplications, respectively. For the general case, write p(x) = a + x (a 1 + x (a 2 + + x (a n 1 + a n x) )) This requires n multiplications, which is only about half that for the preceding method. For an algorithm, write poly = a n for j = n 1 : 1 : poly = a j + x poly end With all three methods, the number of additions is n; but the number of multiplications can be dramatically different for large n.

NESTED MULTIPLICATION Imagine we are evaluating the polynomial p(x) = a + a 1 x + a 2 x 2 + + a n x n at a point x = z. Thus with nested multiplication p(z) = a + z (a 1 + z (a 2 + + z (a n 1 + a n z) )) We can write this as the following sequence of operations: b n = a n b n 1 = a n 1 + zb n b n 2 = a n 2 + zb n 1. b = a + zb 1 The quantities b n 1,..., b are simply the quantities in parentheses, starting from the inner most and working outward.

Introduce q(x) = b 1 + b 2 x + b 3 x 2 + + b n x n 1 Claim: p(x) = b + (x z)q(x) ( ) Proof: Simply expand b + (x z) ( b 1 + b 2 x + b 3 x 2 + + b n x n 1) and use the fact that zb j = b j 1 a j 1, j = 1,..., n With this result (*), we have p(x) x z = b x z + q(x) Thus q(x) is the quotient when dividing p(x) by x z, and b is the remainder.

If z is a zero of p(x), then b = ; and then p(x) = (x z)q(x) For the remaining roots of p(x), we can concentrate on finding those of q(x). In rootfinding for polynomials, this process of reducing the size of the problem is called deflation. Another consequence of (*) is the following. Form the derivative of (*) with respect to x, obtaining p (x) = (x z)q (x) + q(x) p (z) = q(z) Thus to evaluate p(x) and p (x) simultaneously at x = z, we can use nested multiplication for p(z) and we can use the intermediate steps of this to also evaluate p (z). This is useful when doing rootfinding problems for polynomials by means of Newton s method.

APPROXIMATING SF (x) Define SF (x) = 1 x x sin t dt, x t We use Taylor polynomials to approximate this function, to obtain a way to compute it with accuracy and simplicity. 1. y.5 8 4 4 8 x

As an example, begin with the degree 3 Taylor approximation to sin t, expanded about t = : with c t between and t. Then x 1 x x sin t = t 1 6 t3 + 1 12 t5 cos c t sin t = 1 1 t 6 t2 + 1 12 t4 cos c t sin t x [ dt = 1 1 t 6 t2 + 1 ] 12 t4 cos c t dt sin t t = x 1 18 x 3 + 1 12 x dt = 1 1 18 x 2 + R 2 (x) R 2 (x) = 1 1 x t 4 cos c t dt 12 x t 4 cos c t dt

How large is the error in the approximation SF (x) 1 1 18 x 2 on the interval [ 1, 1]? Since cos c t 1, we have for x > that R 2 (x) 1 1 12 x x t 4 dt = 1 6 x 4 and the same result can be shown for x <. Then for x 1, we have R 2 (x) 1 6 To obtain a more accurate approximation, we can proceed exactly as above, but simply use a higher degree approximation to sin t.

In the book we consider finding a Taylor polynomial approximation to SF (x) with its error satisfying R 8 (x) 5 1 9, x 1 A MATLAB program, plot sint.m, implementing this approximation is given in the text and is made available to the class.

Begin with a Taylor series for sin t, sin t = t t3 3! + t5 5! + ( 1)n 1 t 2n 1 (2n 1)! + ( 1) n t 2n+1 (2n + 1)! cos(c t) with c t between and t. Then write SF (x) = 1 x [1 t2 x 3! + t4 5! + t 2n 2 ] ( 1)n 1 dt (2n 1)! R 2n 2 (x) = 1 x + R 2n 2 (x) = 1 x 2 3!3 + x 4 5!5 + ( 1)n 1 x 2n 2 (2n 1)!(2n 1) + R 2n 2 (x) x t 2n ( 1) n (2n + 1)! cos(c t) dt

R 2n 2 (x) = 1 x x t 2n ( 1) n (2n + 1)! cos(c t) dt To simplify matters, let x >. Since cos(c t ) 1, R 2n 2 (x) 1 x x t 2n (2n + 1)! dt = x 2n (2n + 1)!(2n + 1) It is easy to see that this bound is also valid for x <. As required, choose the degree so that From the error bound, R 2n 2 (x) 5 1 9 max R 2n 2(x) x 1 1 (2n + 1)!(2n + 1) Choose n so that this upper bound is itself bounded by 5 1 9. This is true if 2n + 1 11, i.e. n 5.

The polynomial is and p(x) = 1 x 2 3!3 + x 4 5!5 x 6 7!7 + x 8 9!9, 1 x 1 SF (x) p(x) 5 1 9, x 1 To evaluate it efficiently, we set u = x 2 and evaluate g(u) = 1 u 18 + u2 6 u3 3528 + u 4 326592 After the evaluation of the coefficients (done once), the total number of arithmetic evaluations is 4 additions and 5 multiplications to evaluate p(x) for each value of x.