+ All Categories
Home > Documents > Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer...

Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer...

Date post: 20-Mar-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
61
SE301: Numerical Methods Topic 1: Introduction to Numerical methods and Taylor Series Lectures 1-4: SE301_Topic1 (c) AL-AMER2006 ١ Dr. Samir Al-Amer (Term 071)
Transcript
Page 1: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301: Numerical MethodsTopic 1:

Introduction to Numerical methods and Taylor Series

Lectures 1-4:

SE301_Topic1 (c) AL-AMER2006 ١

Dr. Samir Al-Amer(Term 071)

Page 2: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

Lecture 1Introduction to Numerical Methods

SE301_Topic1 (c) AL-AMER2006 ٢

What are NUMERICAL METHODS?Why do we need them?Topics covered in SE301.

Reading Assignment: pages 3-10 of text book

Page 3: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣

Numerical MethodsNumerical Methods:

Algorithms that are used to obtain numerical solutions of a mathematical problem.

Why do we need them?1. No analytical solution exists,2. An analytical solution is difficult to obtain

or not practical.

Page 4: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤

What do we needBasic Needs in the Numerical Methods:

Practical: can be computed in a reasonable amount of time.

Accurate: Good approximate to the true valueInformation about the approximation error (Bounds, error order,… )

Page 5: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥

Outlines of the CourseTaylor TheoremNumber RepresentationSolution of nonlinear EquationsInterpolationNumerical DifferentiationNumerical Integration

Solution of linear EquationsLeast Squares curve fittingSolution of ordinary differential equationsSolution of Partial differential equations

Page 6: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٦

Solution of Nonlinear Equations

Some simple equations can be solved analytically

Many other equations have no analytical solution31

)1(2)3)(1(444

solution Analytic

0342

2

−=−=

−±−=

=++

xandx

roots

xx

solution analytic No052 29

⎪⎭

⎪⎬⎫

==+−

− xexxx

Page 7: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٧

Methods for solving Nonlinear Equations

o Bisection Methodo Newton-Raphson Methodo Secant Method

Page 8: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٨

Solution of Systems ofLinear Equations

unknowns 1000 in equations 1000 have weif do to What

,,

as it solve can We

12325233

523

12

2221

21

21

=−==⇒=+−−=

=+=+

xxxxxx

xxxx

Page 9: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٩

Cramer’s Rule is not practical

compute. toyears 10 than more needscomputer super A

needed. are tionsmultiplica102.3 system, 30by 30 a solve To

tions.multiplica 1)N!1)(N(N need weunknowns Nin equations N solve To

problems. largefor practicalnot is Rule sCramer'But

2

21115131

,1

21112513

system thesolve toused becan Rule sCramer'

20

35

21

×

−+

==== xx

Page 10: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٠

Methods for solving Systems of Linear Equations

o Naive Gaussian Eliminationo Gaussian Elimination with Scaled

Partial pivotingo Algorithm for Tri-diagonal

Equations

Page 11: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١١

Curve FittingGiven a set of data

Select a curve that best fit the data. One choice is find the curve so that the sum of the square of the error is minimized.

x 0 1 2 y 0.5 10.3 21.3

Page 12: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٢

InterpolationGiven a set of data

find a polynomial P(x) whose graph passes through all tabulated points.

xi 0 1 2 yi 0.5 10.3 15.3

tablein the is)( iii xifxPy =

Page 13: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٣

Methods for Curve Fitting o Least Squares

o Linear Regressiono Nonlinear least Squares Problems

o Interpolationo Newton polynomial interpolationo Lagrange interpolation

Page 14: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٤

IntegrationSome functions can be integrated analytically

?

solutions analytical no have functionsmany But

=

=−==

− dxe

xxdx

ax

0

3

1

23

1

2

421

29

21

Page 15: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٥

Methods for Numerical Integration

o Upper and Lower Sumso Trapezoid Methodo Romberg Methodo Gauss Quadrature

Page 16: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٦

Solution of Ordinary Differential Equations

only cases special for available are solutions Analytical *

equations thesatisfies that function a is

0)0(;1)0(0)(3)(3)(

equation aldifferenti theosolution tA

x(t)xx

txtxtx==

=++&

&&&

Page 17: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٧

Solution of Partial Differential EquationsPartial Differential Equations are more

difficult to solve than ordinary differential equations

)sin()0,(,0),1(),0(

022

2

2

2

xxutututu

xu

π===

=+∂∂

+∂∂

Page 18: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ١٨

SummaryNumerical Methods:Algorithms that are used to obtain numerical solution of a mathematical problem.We need them whenNo analytical solution exist or it is difficult to obtain.

Solution of nonlinear EquationsSolution of linear EquationsCurve fitting

Least SquaresInterpolation

Numerical IntegrationNumerical Differentiation Solution of ordinary differential equationsSolution of Partial differential equations

Topics Covered in the Course

Page 19: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

Lecture 2

Number Representation and accurcy

SE301_Topic1 (c) AL-AMER2006 ١٩

Number RepresentationNormalized Floating Point RepresentationSignificant DigitsAccuracy and Precision Rounding and Chopping

Reading assignment: Chapter 3

Page 20: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٠

Representing Real NumbersYou are familiar with the decimal system

Decimal System Base =10 , Digits(0,1,…9)Standard Representations

21012 10510410210110345.312 −− ×+×+×+×+×=

part part fraction integralsign

54.213±

Page 21: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢١

Normalized Floating Point Representation

Normalized Floating Point Representation

No integral part,

Advantage Efficient in representing very small or very large numbers

integer:,0

exponent mantissasign

10.0

1

4321

nd

dddd n

×±

Page 22: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٢

Calculator Examplesuppose you want to compute

3.578 * 2.139using a calculator with two-digit fractions

3.57 2.13 7.60* =

7.653342True answer

Page 23: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٣

Binary System

Binary System Base=2, Digits{0,1}

exponent mantissasign

21.0 432nbbb ×±

10 11 =⇒≠ bb

1010321

2 )625.0()212021()101.0( =×+×+×= −−−

Page 24: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٤

7-Bit Representation(sign: 1 bit, Mantissa 3bits,exponent 3 bits)

Page 25: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٥

FactNumber that have finite expansion in one numbering system may have an infinite expansion in another numbering system

You can never represent 0.1 exactly in any computer

210 ...)011000001100110.0()1.0( =

Page 26: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٦

Representation

Hypothetical Machine (real computers use ≥ 23 bit mantissa)

Mantissa 2 bits exponent 2 bit sign 1 bit

Possible machine numbers

.25 .3125 .375 .4375 .5 .625 .75 .875

1 1.25 1.5 1.75

Page 27: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٧

Representation

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Gap near zero

Page 28: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٨

Remarks

Numbers that can be exactly represented are called machine numbersDifference between machine numbers is not uniformsum of machine numbers is not necessarily a machine

number0.25 + .3125 =0.5625 (not a machine number)

Page 29: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٢٩

Significant Digits

Significant digits are those digits that can be used with confidence.

Page 30: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٠

Accuracy and Precision

Accuracy is related to closeness to the true value

Precision is related to the closeness to other estimated values

Page 31: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣١

Rounding and Chopping

Rounding: Replace the number by the nearest machine number

Chopping: Throw all extra digits

Page 32: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٢

Error DefinitionsTrue Error

can be computed if the true value is known

100* valuetrue

ionapproximat valuetrueError RelativePercent Absolute

ionapproximat valuetrueError True Absolute

t−

=

−=

ε

tE

Page 33: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٣

Error DefinitionsEstimated error

When the true value is not known

100*estimatecurrent

estimate prevoius estimatecurrent Error RelativePercent Absolute Estimated

estimate prevoius estimatecurrent Error Absolute Estimated

−=

−=

a

aE

ε

Page 34: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٤

Notation

We say the estimate is correct to n decimal digits if

We say the estimate is correct to n decimal digits rounded if

n−≤10Error

n−×≤ 1021Error

Page 35: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٥

SummaryNumber Representation

Number that have finite expansion in one numbering system may

have an infinite expansion in another numbering system.

Normalized Floating Point RepresentationEfficient in representing very small or very large numbersDifference between machine numbers is not uniformRepresentation error depends on the number of bits used in the mantissa.

Page 36: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

Lectures 3-4

Taylor Theorem

SE301_Topic1 (c) AL-AMER2006 ٣٦

MotivationTaylor Theorem Examples

Reading assignment: Chapter 4

Page 37: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٧

Motivation

We can easily compute expressions like

?)6.0sin(,4.1 computeyou do HowBut,

)4(2103 2

+×x

way?practical a thisis?)6.0sin(

compute todefinition theusecan We

0.6

ab

Page 38: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٨

Taylor Series

∑∞

000

)(

000

)(

30

0)3(

20

0)2(

00'

0

0

)()(!

1)(

can write weconverge series theif

)()(!

1

...)(!3

)()(!2

)()()()(

about )( ofexpansion seriesTaylor The

=

=

−=

−=

+−+−+−+

k

kk

k

kk

xxxfk

xf

xxxfk

SeriesTaylor

or

xxxfxxxfxxxfxf

xxf

Page 39: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٣٩

Taylor SeriesExample 1

∞xfor converges series The!

)()(!

111)0()(

1)0()(1)0(')('1)0()(

∑∑∞

0

000

)(

)()(

)2()2(

<

=−=

≥==

==

==

==

== k

k

k

kkx

kxk

x

x

x

kxxxxf

ke

kforfexffexffexffexf

0=about =)( ofexpansion seriesTaylor Obtain xexf x

Page 40: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٠

Taylor SeriesExample 1

-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

2

2.5

3

1

1+x

1+x+0.5x2

exp(x)

Page 41: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤١

Taylor SeriesExample 2

∞xfor converges series The

....!7!5!3

)(!

)()sin(

1)0()cos()(

0)0()sin()(

1)0(')cos()('0)0()sin()(

753∞

00

0)(

)3()3(

)2()2(

∑<

+−+−=−=

−=−=

=−=

====

=

xxxxxxkxfx

fxxf

fxxf

fxxffxxf

k

kk

0about )sin()( ofexpansion seriesTaylor Obtain == xxxf

Page 42: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٢

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

x

x-x3/3!

x-x3/3!+x5/5!

sin(x)

Page 43: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٣

Convergence of Taylor Series(Observations, Example 1)

The Taylor series converges fast (few terms are needed) when x is near the point of expansion. If |x-c| is large then more terms are needed to get good approximation.

Page 44: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٤

Taylor SeriesExample 3

( )

( )

( )

....11

1 ofExpansionSeriesTaylor

6)0(1

6)(

2)0(1

2)(

1)0(1

1)('

1)0(1

1)(

01

1f(x) ofexpansion seriesTaylor Obtain

32

4)3(

3)2(

2

++++=−

=−

=

=−

=

=−

=

=−

=

=−

=

xxxx

fx

xf

fx

xf

fx

xf

fx

xf

xaboutx

Page 45: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٥

Example 3remarks

Can we apply Taylor series for x>1??

How many terms are needed to get good approximation???

These questions will be answered using Taylor Theorem

Page 46: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٦

Taylor Theorem

c. andbetween x is)()!1(

)(

where

)(!

)()(

b][a,∈cany for then b][a, interval closed ain 1)(n1,2,..., orders ofsderivative continuous possesf(x)function a If

1)1(

1

1

n

0

)(∑

ξξ andcxnfE

Ecxkcfxf

nn

n

nk

kk

++

+

+=

−+

=

+−=

+

(n+1) terms Truncated Taylor Series

Reminder

Page 47: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٧

Taylor Theorem

.applicablenot is TheoremTaylor defined.not are sderivative

its andfunction then the1],[

1||if0expansion ofpoint with 1

1for remTaylor thoapply can We

=

<=−

=

xincludesbaif

xcx

f(x)

Page 48: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٨

Error Term

. and between allfor

)()!1(

)(

on boundupper an derivecan We

errorion approximat about the ideaan get To

1)1(

1

cxofvalues

cxnfE nn

n

ξ

ξ ++

+ −+

=

Page 49: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٤٩

Error Term forExample 4

?2.0=0=about expansion seriesTaylor its of3)=(n terms4first the

by =)( replaced weiferror theis large How

xwhenx

exf x

( ) 0514268.82.0)!1(

)()!1(

)(

1≥≤)()(

41

2.0

1

1)1(

1

2.0)()(

−≤⇒+

−+

=

=

++

++

+

EEneE

cxn

fE

kforefexf

nn

nn

n

kxk

ξ

ξ

Page 50: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٠

Alternative form of Taylor Theorem

hxxwherehnfE

Ehkxfhxf

[a,b]hx[a,b]x[a,b]

xfLet

nn

n

n

n

k

kk

++

=

+=+

∈+∈+

++

+

+=∑

and between is)!1(

)(

!)()(

then and and , intervalan on 1)1,2,...(n orders of sderivative continuous have)(

1)1(

1

10

)(

ξξ

Page 51: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥١

Taylor TheoremAlternative forms

hxxwhere

hnfh

kxfhxf

xchxx

cxwhere

cxnfcx

kcfxf

nnn

k

kk

nnn

k

kk

+

++=+

→+→

−+

+−=

++

=

++

=

and between is)!1(

)(!

)()(

,

and between is

)()!1(

)()(!

)()(

1)1(

0

)(

1)1(

0

)(

ξ

ξ

ξ

ξ

Page 52: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٢

Mean Value Theorem

(b-a)dxdf(ξf(a)f(b)

bhxax(b-a)

f(a)f(b)dxdf(ξ

baξ

) ,0,n TheoremTaylor Use:Proof

)],[exist then there

b)(a, intervalopen on the defined is derivative its andb][a, interval closed aon function continuous a isf(x) If

+=

=+==

−=

Page 53: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٣

Alternating Series Theorem

termomittedFirst :n terms)first theof (sum sum partial:

converges series The

0lim

Sseries galternatin heConsider t

1

1

4321

4321

+

+∞→

⎪⎩

⎪⎨

≤−⎪⎪⎩

⎪⎪⎨

=

≥≥≥≥

+−+−=

n

n

nnnn

aS

aSSandthen

aand

aaaaIf

aaaa

L

L

Page 54: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٤

Alternating SeriesExample 5

!71

!51

!311)1(s

!51

!311)1(s

0limsince series galternatin convergent a is This

!71

!51

!311)1(susingcomputed becansin(1)

4321

≤⎟⎠⎞

⎜⎝⎛ +−−

≤⎟⎠⎞

⎜⎝⎛ −−

=≥≥≥≥

+−+−=

∞→

in

in

Then

aandaaaa

in

nnL

L

Page 55: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٥

Example 6

? 1with xe eapproximat to

used are terms1)(n when beerror can the largeHowexpansion) ofcenter (the5.0ef(x) of

expansion seriesTaylor theObtain

12x

12x

=

+==

+

+ cabout

Page 56: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٦

Example 6

...!

)5.0(2...!2

)5.0(4)5.0(2

)5.0(!

)5.0(

2)5.0(2)(

4)5.0(4)(

2)5.0('2)('

)5.0()(

22

222

0

)(12

2)(12)(

2)2(12)2(

212

212

+−

++−

+−+=

−=

==

==

==

==

=

+

+

+

+

+

kxexexee

xk

fe

efexf

efexf

efexf

efexf

kk

k

kk

x

kkxkk

x

x

x

5.0,)( ofexpansion seriesTaylor Obtain 12 == + cexf x

Page 57: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٧

Example 6Error term

31

1

12]1,5.0[

11

1121

1)1(

12)(

)!1()5.0(2

max)!1()5.0(2

)!1()5.0(2

)5.0()!1(

)(

2)(

en

xError

en

xError

nxeError

xnfError

exf

nn

nn

nn

nn

xkk

+−

+−

+−

=

−+

=

=

++

+

++

+++

++

+

ξξ

ξ

ξ

Page 58: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٨

RemarkIn this course all angles are assumed to be in radian unless you are told otherwise

Page 59: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٥٩

Maclurine seriesFind Maclurine series expansion of cos (x)

Maclurine series is a special case of Taylor series with the center of expansion c = 0

Page 60: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٦٠

Taylor SeriesExample 7

∞xfor converges series The

....!6!4!2

1)(!

)0()cos(

0)0()sin()(1)0()cos()(

0)0(')sin()('1)0()cos()(

642∞

0

)(

)3()3(

)2()2(

∑<

+−+−==

==

−=−=

=−===

=

xxxxk

fx

fxxffxxffxxffxxf

k

kk

)cos()( ofexpansion series MaclurineObtain xxf =

Page 61: Dr. Samir Al-AmerSE301_Topic1 (c) AL-AMER2006 ٩ Cramer’s Rule is not practical A super computer needs more than 10 years to compute. To solve a 30 by 30 system, 2.3 10 multiplications

SE301_Topic1 (c) AL-AMER2006 ٦١

Homework problemsCheck the course webCT for the Homework Assignment


Recommended