Problem 43129. Find the coefficients for numerical integration using Simpson's rule

For using numerical integration using Simpson's rule, we need some coefficients to be determined first. Suppose the n is the number of divisions between a and b the limits of integration. First of all n should be even so for odd numbers the program return empty vector []. For n=2 the coefficients are [1 4 1] and for n=4, coefficients are [1 4 2 4 1]. The first and the last elements are 1 and the remaining elements are 4 and 2. Also zero or negative n has meaning.

Solution Stats

68.42% Correct | 31.58% Incorrect
Last Solution submitted on Jun 16, 2020