## Author: M. Turhan ÇOBAN
## Created: 2021-11-19

function retval = Gauss_Legendre_integral1(f,a,b,n)
  [r,c]=root_P(n);
  z=0;
  k1=(b-a)/2.0;
  k2=(b+a)/2.0;
  y1=0;
  for i=1:n
    x=k2+k1*r(i);
    y=f(x);
    y1=c(i)*y;
    z=z+y1;
  endfor
  retval =k1*z;
endfunction