These instructions are written with the assumption that codewill be done in matlab. You might find the following built incommands useful: length, plot, xlabel, ylabel, title, legend,fzero, plot, disp, axis, axes, min, max.
2. Numerical Integration (Quadrature). Write FOUR of your ownnumerical integration routines. One should use left-end, right-end,or mid-points, another should use the trapezoid method, anothershould use Simpson’s method, and the fourth should use eitherGuassian Quadrature or Romberg’s method. Use your four routines toapproximate two integrals numerically so that they are accurate to1 part in 1 billion (if possible, if this is not possible explainwhy). First use your routines to approximate f(x) = x 3 − x cos(x)on the interval [0, 2π], you can and should check that your answeris correct. Then use your routines to approximate f(x) = 4e −2x 2on the interval [−1, 1]. Use one of matlab’s built in integrationfunctions to approximate both integrals also. Each integral shouldbe: numerically approximated FOUR ways, checked vs one of matlab’sbuilt-in numerical integration methods, and the polynomial/trigfunction should be checked exactly.