Final Practice Answer - Math 104A Midterm Practice Solution RONGJI QIAN December 8 2015 1(a Lecture note 1 p6 Since Eh[f = c4 h4 R(h and R(h decrease

# Final Practice Answer - Math 104A Midterm Practice Solution...

• Test Prep
• 12
• 95% (19) 18 out of 19 people found this document helpful

This preview shows page 1 - 4 out of 12 pages.

Math 104A Midterm Practice SolutionRONGJI QIANDecember 8, 20151. (a) Lecture note 1, p6. SinceEh[f] =c4h4+R(h) andR(h) decrease faster thanh4ash0,the rate of convergence ofQhis 16 times inh.Eh2[f] =c4(h2)4+R(h2) =c4h416+R(h2),meaning that wheneverhis halved, the error decreased by a factor of 16.1. (b) Lecture note 1, p7-8. SinceI[f] =Eh[f] +Qh[f] =c4h4+R(h) +Qh[f],I[f] =Qh2[f] +c4h416+R(h2). Thenc4h4=1615(Qh2[f]-Qh[f]) +1615(R(h2)-R(h)).The last term of the RHS is of ordero(h4). Thus,Eh[f]C4h41615(Qh2[f]-Qh[f]).1. (c) Lecture note 1, p8. The key is to check isR(h2)-R(h) is small enough to be ignored ash0.Thus, a ratioq(h) =C4h4c4h416Qh2[f]-Qh[f]Qh4[f]-Qh2[f]should be 16 if the approximation is valid.1.(d) Lecture note 1, p8.The key idea is to do the error correction.Thus,Sh[f] =Qh[f] +1615(Qh2[f]-Qh[f]) can be a more accurate quadrature ofI[f]. Let’s check.I[f]-Sh[f] =Qh[f] +Eh[f]-Qh[f]-1615(Qh2[f]-Qh[f])=1615(Qh2[f]-Qh[f]) +1615(R(h2)-R(h)) +R(h)-1615(Qh2[f]-Qh[f])=1615R(h2)-115R(h)Recall thatR(h) is of ordero(h4),decreasing faster thanh4ash0. Thus,Sh[f] approachesI[f]faster thanQh[f], indicating thatSh[f] is a more accurate quadrature.1
2. (a) Lecture note 2, p4. (a) Withl(n)j=Qk=0,k6=jx-xkxj-xk, we havel(2)0=(x-12)(x-1)-12· -1= 2(x-12)(x-1)l(2)1=(x-0)(x-1)12· -12= 4x(x-1)l(2)2=(x-0)(x-12)12·1= 2x(x-12)SincePn(x) =nj=0lj(x)f(xj),Pn(x) = 2(x-12)(x-1)·f(0) + 4x(x-1)·f(12) + 2x(x-12)·f(1)And so,Q[f] =Z10P2(x)dx=Z102(x-12)(x-1)·f(0)dx+Z104x(x-1)·f(12)dx+Z102x(x-12)·f(1)dx=16f(0)-23f(1) +16f(1)=16f(0) + 4f(12) +f(1)2. (b)Qs[f] =ZbaP2(x)dx=Z10P2(x)da+ (b-a)tdtdt= (b-a)Z10P2(t)dt=b-a6f(0) + 4f(12) +f(1)2. (c) Lecture note 2, p4. Iffis a polynomial of degree 2 or less,fof course interpolates itself.However, givenn+1 nodes, there is a unique polynomial of degree at mostn,Pn(x) that interpolatesf. Since 3 nodes are given, there is a unique polynomial of degree at most 2 that interpolatesf.Thus,P2(x) =f. Thus,Qs[f] =ZbaP2(x)dx=Zbaf(x)dx=I[f].We only need to show that given 3 nodes, the interpolating polynomial isfit self whenfis apolynomial of degree of 3. There is a large calculation burden... Letf(x) =a0+a1x+a2x2+a3x3,2
which is a polynomial of degree 3. ThenZbaa0+a1x+a2x2+a3x3dx=a0(b-a) +a12(b2-a2) +a23(b3-a3) +a44(b4-a4)= (b-a)a0+a12(a+b) +a23(a2+b2+ab) +a34(a+b)(a2+b2)Now,f(a) =a0+a1a+a2a2+a3a3f(b) =a0+a1b+a2b2+a3b3f(a+b2) =a0+a1(a+b2) +a2(a+b2)2+a3(a+b2)3f(a) +f(b) + 4f(a+b2) = 6a0+ 3a1(a+b) +a2(2a2+ 2b2+ 2ab) +a32(3a3+ 3a2b+ 3ab2+ 3b3)= 6(a0+a12(a+b) +a23(a2+b2+ab) +a34(a3+a2b+ab2+b3)= 6(a0+a12(a+b) +a23(a2+b2+ab) +a34(a+b)(a2+b2)Therefore,Zbaf(x)dx=Zbaa0+a1x+a2x2+a3x3dx=b-a6(f(a) +f(b) + 4f(a+b2)),which meansQs[f] =I[f] forf, a polynomial of degree 3. This completes the proof.
• • • 