I am asked to find the coefficent $C$ and the nodes $ x_i$ such that the following formula will be accurate for any cubic polynomial,
$\int_{-1}^{1}f(x)dx=C[f(x_0)+f(x_1)+f(x_2)]+E$
applying the formula on $\{1,x,x^2,x^3\}$ yields 4 equations for which we have,
$\int_{-1}^{1}f(x)dx=\frac{2}{3}[f(-\frac{1}{\sqrt2})+f(0)+f(\frac{1}{\sqrt2})]$
now 1), when I'm asked to estimate the error do I expand both sides of the formula using Taylor-expansion and after some simple algebra find the order of the first non-zero term? 2), I am asked to calculate $\int_{-1}^{1}{\frac{1}{\sqrt{|x|}}dx}$ using the aforementioned formula and cautioned to adjust it to the given function.
now, since it is clear to me that a problem arises when trying to calculate the function at the node $x_1=0$, I decided to a) break it in half since $f$ is even, and b) change integration interval from $(0,1)$ to $(-1,1)$ thus, adjusting it to the integration boundaries of the given formula.
Solving this way yields the answer 3.4064...
In a different solution which I can't seem to understand, they recalculated the nodes and the coefficient $C$ and got the exact answer, 4.
if you could either comment on the logic or over all explain i'll be thankful.