solutions are put in notion, chack it out
notion:
https://www.notion.so/hw3-Numerical-Analysis-f793529dc61e4202b9e5bef2430713b2
Part A. (20%) A.1 Using the error analysis for the trapezoidal and rectangle rules, show that Simpson’s rule for integration over the entire interval is fourth-order accurate. A.2 Explain why the rectangle and trapezoidal rules can integrate a straight line exactly and the Simpson’s rule can integrate a cubic exactly.
Part B. (20%) Use the Richardson extrapolation to compute f ′ (1.0) and f ′ (5.0) to five place accuracy with f = (x + 0.5)−2 . Use the central difference formula f ′ (x) ≈ f(x + h) − f(x − h) 2h and take the initial grid spacing h0 = 0.5. The other grid spacings you may choose, for example, are h1 = 0.5h0, h2 = 0.5h1, h3 = 0.5h2, h4 = 0.5h3, etc. Does f ′ (1.0) or f ′ (5.0) converge faster? Can you explain the reason?
Part C. (20%) We would like to calculate I = Z π 0 sin(x)dx. C.1 Develop a quadrature method for x ∈ [xj , xj+2] based on the cubic spline interpolation. C.2 Use this method to calculate the integral using 4, 8, 16, 32 intervals. Show the absolute values of error versus grid spacing on a log-log plot. What is the order of accuracy of this method?
Part D. (20%) Combine Simpson’s rule with the trapezoidal rule with end correction to obtain a more accurate method for the integral of Z xj+h xj−h f(x)dx. You may use the values of f(xj − h), f(xj ), f(xj + h), f ′ (xj − h), f ′ (xj + h). What is the order of accuracy of your scheme? What will be the global scheme for 1 Z b a f(x)dx based on this method?
Part E. (20%) We now compute the following integral (which has the exact value as listed) using different methods. Here logx represents ln(x) or loge (x). Z 8 1 logx x dx = 2.1620386 E.1 Use Simpson’s rule with nine points (eight panels). What is the value of the numerical integral and what is the absolute value of the error? E.2 Use Gauss-Legendre quadrature with nine points. What is the value of the numerical integral and what is the absolute value of the error? (You may use the subroutine gauss leg provided on CEIBA to compute the points and weights in Gauss-Legendre quadrature.)