1. May 8, 2012

### Fidelio

Hello, anyone knows where y can find a program to compute the integral

∫ ( from -1 to 1) f(x)/ √(1-x^2) using the Gauss-Chebyshev quadrature, on matlab?

Thanks!

2. May 8, 2012

### AlephZero

Last edited by a moderator: May 6, 2017
3. May 9, 2012

### Fidelio

thanks so much AlephZero,

Could you check If it is correct ?

f = inline(funct);
old_int = inf;
for n=1:1000

x = cos(((2*(1:n) - 1)/(2*n))*pi);
w = pi/n;
fx = f(x);
int = sum(w.*fx);
if abs(int_old-int) < abs(tol*int),
converge='y';
break;
end
old_int = int;
end

And now If I want to compute this integral $$\int_1^2 dx \frac { e^{2x} }{ ( (2-x) ( (1-x))^{1/2} }$$ with an accuracy 10^-8 what could I do?