2

We know the coefficients of Newton-Cotes method in numerical integration are:

2-points $ 0.5$ , $0.5$

3-points $ 1/6$, $2/3$, $ 1/6$

4-points $1/8$, $3/8$, $3/8$, $1/8$

and so on

I ask if there is a formula of all coefficients in this method.

  • Yes, for example the trapezoid-rule and the simpson-rule. – Peter Jan 21 '15 at 17:47
  • sorry, I ask if there is a formula or equation which gives these coefficients –  Jan 21 '15 at 17:49
  • Oops, I misread the question, sorry. – Peter Jan 21 '15 at 17:51
  • The coefficients can be calculated using that the integration has to be exact upto some degree. This can be turned into a general formula. – Peter Jan 21 '15 at 17:53
  • I think, the values for $3$-points have actually to be $1/6,4/6,1/6$ because the sum must be $1$, if the interval [$0,1$] is chosen. But if [$-1,1$] is chosen, the given sequence is OK, but the $2$-point sequence should be $1,1$ in this case. – Peter Jan 21 '15 at 17:58
  • Thanks, I have edited this value and the others –  Jan 21 '15 at 18:05

1 Answers1

1

Maybe read: http://people.clas.ufl.edu/kees/files/NewtonCotes.pdf

It presents a method easily convertible to MATLAB that can be used to generate the coefficients:

function q = NewtonCotesCoefficients(degree)

  q = 0:degree;
  m = fliplr(vander(q));
  for ii = 0: degree
    b(ii + 1) = degree^(ii + 1)/(ii + 1);
  end
  q = m'\b';
end