Newton-Cotes formula problem Please help me to solve this problem...

By the method of undetermined coefficients I found $a=c=1/6$ and $b=2/3$ and $\alpha=\gamma=2/3$ and $\beta=-1/3$. Also that both are exact for polynomials of degree $\leq 3$.
But I cannot figure out which one is better.
Thank you.
 A: Considering function $f(x)$ to be integrated between $a$ and $b$, let me set $f_i=f(x_i)$ where $x_i=a+(b-a)\frac in$ where $n$ is the degree. We shall consider $n=3$ which is your problem.
Closed Newton-Cotes formula is $$\int_a^b f(x)\,dx\approx \frac{b-a}{6}\,(f_0+4f_1+f_2)$$ and the error is $-\frac{(b-a)^5}{2880}f^{(4)}(\xi)$.
Open Newton-Cotes formula is $$\int_a^b f(x)\,dx\approx \frac{b-a}{3}\,(2f_1-f_2+2f_3)$$ and the error is $\frac{7(b-a)^5}{23040}f^{(4)}(\xi)$.
As you can see, assuming similar $\xi$'s, the errors are in a ratio of $7:8$ slightly favouring the open form (just as Rory Daulton answered).
A: "Better" is vague here. I tested both approximations using $f(x)=x^4$, and the approximation errors I got were:


*

*about $0.00833$ for the first (out of $0.2$),

*about $0.00729$ for the second (out of $0.2$).


So, for this example, the second was slightly "better" in terms of error. However, other examples may give different results.
Another way the second is better is that it can handle improper integrals, where the values of $f(x)$ are not defined at the endpoints $x=0$ and $x=1$. For example, the second could approximate
$$\int_0^1 \frac 1{\sqrt x}\,dx$$
to an error of about $0.36827$ (out of $2$), whereas the first could not give any approximation at all.
I therefore conclude that the second approximation formula is "better."
