I am curretly working to numerically evaluate an integral of the form:
$$\int_{-1}^{1} f(x) \sqrt{1-x^2} dx$$
For this issue Gauss-Chebysehv integration of second kind seems ideal as it uses the weighting funtion:
$$w(x)=\sqrt{1-x^2}$$
As $f(x)$ is very steep locally, i'd like to subdivide the interval into smaller pieces. To do so I used the commonly known formula:
$$\int_{a}^{b} f(x) dx \approx \frac{b-a}{2} \sum_{i=1}^{n} w_i \int_{-1}^{1} f\left ( \frac{b-a}{2}x_i +\frac{a+b}{2}\right )$$
to my embazzlement It doesn't work at all. Instead of giving me say, half the integral , if $a$,$b$ are chosen from -1 to 0, it gives me the integral of: $$\int_0^{1} \sqrt{1-\left (2 \left (x-\frac{1}{2}\right )\right )^2} f(x)$$
Help would be greatly appreciated.
Cheers!
Looking at the paragraph "fundamental theory" on Wikipedia it seems to me, that weights are defined as: $$w_{i} = \frac{a_{n}}{a_{n-1}}\frac{\int_{a}^{b}\omega(x)p_{n-1}(x)^{2}dx}{p'_{n}(x_{i})p_{n-1}(x_{i})}$$ If you use however the formula for the weights, also delivered by the Wikipedia $$ w_i = \frac {\pi} {n+1} \sin^2 \left( \frac {i} {n+1} \pi \right)$$ this does not seem to account in any way for variation of integration borders. Yet the weights describing half or quarter of a circular object as like the weight function should somehow look different as the y describe a different thing.
Hope this helps.