Question: is the half - width of the - subinterval is the number of node points are the weights are the node points for the -
is the halfwidth of the subinterval
is the number of node points
are the weights
are the node points for the subinterval.
Summing over all subintervals yields the numerical approximation of the integral A popular quadrature method of this form is Simpson's rule. Here, three uniformly spaced node points are used; the endpoints and the midpoint of the subinterval. The quadrature rule is:
where is the midpoint of the subinterval. Note that for this rule, the halfwidth of the subinterval is also the spacing between the node points within the subinterval.
Write a function that implements Simpson's rule using uniformly spaced subintervals without using a loop. Your function should accept inputs:
fun a handle to the integrand function
a lower limit of integration
b upper limit of integration
n number of uniform subintervals
and return output:
Q value of the integral
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
