Department of Mathematics

Math 300: Mathematical Computing

Simpson's 3/8 Rule

There is a composite Simpson rule for approximating an integral of a function \(f\) over an interval \([a,b]\) that is different from the one we learn in Calculus. It is given by \[ \int_a^b f(x)\,dx =\frac {3h}8 \left[f(x_0)+3f(x_1)+3f(x_2)+2f(x_3)+3f(x_4)+\cdots +3f(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 a multiple of three. 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 simpson38(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 last test will take place at the final exam time on Tuesday, 12 December, from 1:30-3:30. It will be written as a one-hour (not 50 minute) exam, but you may have the full two hours for it. In other respects it will be very like the other tests, but comprehensive - it will emphasize Python, but cover all the topics we have seen. There is a Sample Exam, but be aware that things will have changed somewhat with the advent of ChatGPT.




The scores are posted on the Info tab at My.math. Notify the instructor of discrepancies immediately.








Department of Mathematics, PO Box 643113, Neill Hall 103, Washington State University, Pullman WA 99164-3113, 509-335-3926, Contact Us
Copyright © 1996-2020 Kevin Cooper