You are on page 1of 1
Chapter 5: Numerical interpolation PIFFECEN Ti Ment ifh=t ‘Question 1: Given f(x)=sin(x*). Approximate f (0.5) by using the 3 point central formula with h=1 and h=05. State (05) = LOSH= LoS) 07781 a which h gives better approximation. 2(i) 2) Solutior lerror| = Given f (x)=sin(x?), then f*(x)= __ and hence. PReos £'(05)= . By using 3 point central formula os) LL0SE051- 1108-08) one for frst derivative, p (aja LE fe) .£"(05) is é 20) 2(03) approximated at h=1 and h=0.5 with its absolute errors as below. lerorl= Since smaller h gives smaller absolute error, hence, smaller h gives better approximation. Solution: Given f (x)=-0-Ix* -0.15x°— 0,52* —0.25x41.2, then Question 2: Given the following set of discrete data: LZ 0.2 03 04 05 06 07 08 3 2. "(x)=-048 -0.453*—s-0.25. ra [1.1286 | 1.0751 [1.0078 | 0.9250 [ 0.8246 | 0.7045 0.5622| Be eee eee By using a step size appropriate difference formulas. For each answer, ‘as compared to the true value of f'(0.4) if f(x) =-O.L ‘of h=0.2, estimate the first derivatives of f(x) at h=0.2 by using the At xe04, f'(04)=-04(0. 4) -0.45 (0.4) -(0.4) -0.25 = -0.7476 calculate the relative error (in percentage Ix* -0,15x° -0.5x* —0.25241.2. mn for f'(0.4)=-0.7476. . Thus, the exact s First order derivative, P@): 2 point F(x+h)- 700) “yay 08a lerron=[-0.7476- _|/-0.7476 2point] LQ) F(04) om + eee difference: Dpoint| _)_ F)-FO=h) Ta) LOOT Jerrorl= packward | f°)" F'(04) norco difference: Bpoint central) flz+h)-F(e=h) oq OSE Jerror|= difference: | SU)" —— 34 F004) F003) Spoint| i Ua)+4f (e+ h)= F(x +2) aa(hovre)ea{ I= Jerror|= forva Fo a £04). difference: Spoint J F(x—2h)-4F (x—A)=37 (8) ‘Since the value of f(0) is not provided, thus the 3-point backward difference formula is ee | 2h not appropriate in this problem. ference: Tipoint central >, _ FlR=2h)-8/ aA) +OF (a+) F (e424) | Since the value of ( rot provided, thus the S-point difference formula is not difference: | f'(*)~ 1h appropriate in this problem.

You might also like