# Assignment 7

Recall that the composite Simpson rule for approximating an integral of a function $$f$$ over an interval $$[a,b]$$ is given by $\int_a^b f(x)\,dx =\frac h3 \left[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+2f(x_4)+\cdots +4f(x_{N-1})+f(x_N) \right] +O(h^4),$ where $$a=x_0\lt x_1\lt\dots\lt x_N=b$$ is a uniform partition of $$[a,b]$$ with $$x_n-x_{n-1}=h$$ for every $$n=1,2,\dots, N$$. The integer $$N$$ must be positive and even. Your assignment is to make a Matlab function that computes a composite Simpson Rule approximation to the integral of a function that the user supplies, over an interval that is also supplied by the user. The Matlab Simpson approximation will be called as simpson(f,a,b,N) where f is a function that the user defines which is to be integrated, a is the left endpoint of the interval of integration, b is the right endpoint of the interval of integration, and N is the number of subintervals used. The function must return the value of the approximation to the integral. It is important that it have some lines of helpful text regarding its use, in case the user types help simpson.

The assignment is worth 35 points and is due at 9 AM on Thursday, 27 October. The assignment is turned in when it appears as an attachment to a message in the instructors email inbox. The last test will take place at the final exam time, Monday 12 December, 1:30-3:30. It will be written as a one-hour in-class on-line test. As usual, you can use any resources you want. A Sample Exam is available. Note that the URL for the exam will not be emailed to all. If you need to take the exam from outside class, contact the instructor to get on the email list. Assignment B is posted. Most recent scores are on-line at My.math. Check the Info page. Let the instructor know if you find a discrepancy.

Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us