Homework 06: due Thursday, November 30, 2017 (HW06)



This time, do the codes in C:
  1. Write a C code to find all roots of sin(cosh(x)) for x in [0,5] with bisection and Newton-Raphson refinement.
  2. Write C code to integrate (sin(x)/x)**2 over [1,20] using trapezoidal, Simpson, and Gaussian integration with 3 points (i.e., on the interval [-1,1] the abscissae [-sqrt(3/5), 0, sqrt(3/5)] and the corresponding weights [8/9, 5/9, 8/9]). Let the length of sub-intervals h be (x2-x1)/2**k for k=2,16. Plot the integrals as a function of k with logarithmic y axis for all 3 methods on the same plot. You should see convergence at a different rate.

Work in the assigned groups. Turn in only one copy of the codes, output files, and graph(s). Graphs should be pdf files. Make sure your codes are properly commented.