From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integral function f(x,y) has singularity ?
Date: Tue, 8 Nov 2011 07:29:10 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 19
Message-ID: <j9alo6$3vq$>
References: <j9abju$4uh$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1320737350 4090 (8 Nov 2011 07:29:10 GMT)
NNTP-Posting-Date: Tue, 8 Nov 2011 07:29:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:748623

"mathslife " <> wrote in message <j9abju$4uh$>...
> hi,
> i am working on a program about collocation method and i need to find 
> \int_{0}^{2+pi} 1/cos(x+y)dy
> i would like to use guad function. for the collocation point we have x_k=2*pi*i*k/(2*n+1)
>  i wrote a program for it like 
>  m=@(y) 1./ cos(x(k+n+1)+y);
>                 T=quad(m,0,2*pi);

It looks like you are building the matrix of integral equation.

The matrix is a limits when the singularity converges towards the collocation points, and not taken the integral when the singularity is AT the collocation which - in some case such as double layer potential - gives a meaningless answer as Roger pointed out.

This limit is called "jump relation" and you can find the close form expression in many books. No need to compute limit of the integral numerically.