0

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.

Rubenz
  • 421
  • 1
    "Integrarion" is a nice word... – Dietrich Burde Oct 12 '17 at 19:51
  • Your questions shows an example that a formula with high degree of algebraic precision (i.e. accurate to high orders of Taylor terms) breaks down when the integrand has a singularity. Can you say more about how the nodes and coefficients get recalculated for the singular integrand? – Zhuoran He Oct 12 '17 at 19:58
  • @ZhuoranHe either I'm unable to understand how they did it or they don't have a clue too. They seem to have once again applied the formula on the same basis but now with the square root built in. for ex. the first equation comes from integrating $\frac{1}{\sqrt{|x|}}1$ the 2nd from $\frac{1}{\sqrt{|x|}} x$ and so on and so forth and solving the system gives $-\sqrt{\frac{3}{10}},0,\sqrt{\frac{3}{10}}$ and the $C=\frac{4}{3}$ – Rubenz Oct 12 '17 at 20:11
  • Ah, I see. So if the new formula has been required to produce accurately the result for the type of singularity the integrand has ($1/\sqrt{|x|}$), then it would perform much better. Apparently there is no cure-all in numerical methods. – Zhuoran He Oct 12 '17 at 23:03

0 Answers0