When solving $$\int_{-3}^{3}(x^3\cos(x)+x)\,\mathrm{d}x$$ by Simpson's method, taking $n$ subintervals, the exact value is obtained if:
- $n$ is even.
- $n$ is greater than $3$.
- $n$ is even and greater than $6$.
- never possible.
- $n$ is odd.
- none of the above.
Definitions: $$n=\frac{b-a}{h}$$ $$A=\frac{h}{3}(EX+4O+2E),\quad\left\{\begin{aligned}&EX=\text{extremes},\\&O=\text{odd},\\&E=\text{even}.\end{aligned}\right.$$ $$\text{Error}=E=\frac{a-b}{180}h^4f^{(4)}(\xi),\quad\xi\in[a,b].$$
I know the following result:
If $f$ is a cubic function (i.e. a polynomial of degree $3$) then the Simpson's formula calculates the integral exactly whatever $h$ ($n$ must be even).
$b-a=3-(-3)=6\implies n=\dfrac{6}{h}$.
We cannot use the above result since $f(x)=x^3\cos(x)+x$ is not a polynomial, right? So what would be the correct answer?
I thought about using the odd function property: if $g$ is odd then $\int_{-a}^{a}g(x)\,\mathrm{d}x=0$. Since $f(x)=-f(-x)$ then $f$ is odd, so the integral is equal to $0$. But I cannot conclude anything about the parity of $n$ nor the minimum value ($>3$?, $>6$?).
Thanks!!
Hint
You almost wrote everything which is required and the key point is that the integrand is odd.
May be simpler (at least to me) would be to think about the number of sampling points instead of subintervals. To respect the fact that the function is odd and to get $0$ by the end, you need to compute at symmetric points and one of the points will be $x=0$. So, you need an odd number of sampling points which implies $???$ subintervals.