Derive the following quadrature formula :

$$\int_0^1 f(x)dx=C_1 f \left(\frac{1}{4}\right) + C_2 f \left(\frac{1}{2}\right) + C_3 f \left(\frac{3}{4}\right)$$

then determine error, and after that, using the formula you got, calculate $$\int_\frac{\pi}{4}^\frac{\pi}{2} \frac{sinx}{x} dx$$

Ok, deriving the given formula isn't much of a problem, we form a system using functions $f(x)=1$, $f(x)=x$,$f(x)=x^2$

From there, i got the following values:

$C_1=C_3=\frac{2}{3}$ and $C_2=-\frac{1}{3}$

so we have $$\int_0^1 f(x)dx=\frac{2}{3} f \left(\frac{1}{4}\right) +\frac{1}{3} f \left(\frac{1}{2}\right) + \frac{2}{3} f \left(\frac{3}{4}\right)$$

When i insert $f(x)=x^3$ it turns out that RHS is equal to LHS which means that this formula works even for third degree, but it turns out it does not work for the fourth, all of this is not a big deal actually

now, since i got $R(f) \leq 3.35 \times10^{-6}$ we should have take six decimal places in calculations of integral however, main thing now is how to calculate the given integral.

First thing i would do is that i would make a substitution:

$x=\frac{(t+1)\pi}{4}$ so i could get proper limits of integration, however, i have no idea how to proceed beyond this, i mean, i don't know how to use the formula i derived to find the solution since in every book i have, there are only procedures up to finding constants and errors, there is no explanation on how to implement this formulas to a particular integral like this one. Any help appreciated!

• There are no $f_1,f_2,f_3$, just $f$. – Yves Daoust Sep 6 '18 at 12:25
• Yves Daoust I fixed it! Thanks for the heads up! – cdummie Sep 6 '18 at 12:29
• The rest is mere substitution, but mind the rescaling of the variable. – Yves Daoust Sep 6 '18 at 12:30
• Im sorry, but i think i don't understand you very well, what do you mean by "mere substitution" and "rescaling the variable"? – cdummie Sep 6 '18 at 12:32