# Chapter 4 - Numerical Differentiation and Integration -...

• Notes
• jay_zhang
• 5
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 3 out of 5 pages.

Chapter 4Numerical Differentiation and IntegrationPer-Olof Persson[email protected]Department of MathematicsUniversity of California, BerkeleyMath 128A Numerical AnalysisNumerical DifferentiationForward and Backward DifferencesInspired by the definition of derivative:f(x0) = limh0f(x0+h)-f(x0)h,choose a smallhand approximatef(x0)f(x0+h)-f(x0)hThe error term for the linear Lagrange polynomial gives:f(x0) =f(x0+h)-f(x0)h-h2f(ξ)Also known as theforward-difference formulaifh >0and thebackward-difference formulaifh <0General Derivative ApproximationsDifferentiation of Lagrange PolynomialsDifferentiatef(x) =nk=0f(xk)Lk(x) +(x-x0)· · ·(x-xn)(n+ 1)!f(n+1)(ξ(x))to getf(xj) =nk=0f(xk)Lk(xj) +f(n+1)(ξ(xj))(n+ 1)!k=j(xj-xk)This is the(n+ 1)-point formulafor approximatingf(xj).Commonly Used FormulasUsing equally spaced points withh=xj+1-xj, we have thethree-point formulasf(x0) =12h[-3f(x0) + 4f(x0+h)-f(x0+ 2h)] +h23f(3)(ξ0)f(x0) =12h[-f(x0-h) +f(x0+h)]-h26f(3)(ξ1)f(x0) =12h[f(x0-2h)-4f(x0-h) + 3f(x0)] +h23f(3)(ξ2)f(x0) =1h2[f(x0-h)-2f(x0) +f(x0+h)]-h212f(4)(ξ)and thefive-point formulaf(x0) =112h[f(x0-2h)-8f(x0-h) + 8f(x0+h)-f(x0+ 2h)]+h430f(5)(ξ)OptimalhConsider the three-point central difference formula:f(x0) =12h[f(x0+h)-f(x0-h)]-h26f(3)(ξ1)Suppose that round-off errorsεare introduced whencomputingf. Then the approximation error isf(x0)-˜f(x0+h)-˜f(x0-h)2hεh+h26M=e(h)where˜fis the computed function and|f(3)(x)| ≤MSum oftruncation errorh2M/6andround-off errorε/hMinimizee(h)to find the optimalh=33ε/MRichardson’s ExtrapolationSupposeN(h)approximates an unknownMwith errorM-N(h) =K1h+K2h2+K3h3+· · ·then anO(hj)approximation is given forj= 2,3, . . .byNj(h) =Nj-1h2+Nj-1(h/2)-Nj-1(h)2j-1-1The results can be written in a table:O(h)O(h2)O(h3)O(h4)1:N1(h)N(h)2:N1(h2)N(h2)3:N2(h)4:N1(h4)N(h4)5:N2(h2)6:N3(h)7:N1(h8)N(h8)8:N2(h4)9:N3(h2)10:N4(h)
Richardson’s ExtrapolationIf some error terms are zero, different and more efficientformulas can be derivedExample: IfM-N(h) =K2h2+K4h4+· · ·then anO(h2j)approximation is given forj= 2,3, . . .byNj(h) =Nj-1h2+Nj-1(h/2)-Nj-1(h)4j-1-1Numerical QuadratureIntegration of Lagrange Interpolating PolynomialsSelect{x0, . . . , xn}in[a, b]and integrate the Lagrange polynomialPn(x) =ni=0f(xi)Li(x)