How to Numerically Solve an integral equation. First I really doon't have any background with integral equations! That said, I would like to solve the following:
$$\int_a^b \frac{K(t)}{t-x} \phi(t) dt=f(x) , a<x<b$$
where$$\int_a^b \phi(t) dt=0$$
Specifically, $a=-1, b=1$, $K(t) = \sqrt{\frac{1-t}{1+t}}$, and $f(x)=1$.
I'd like to turn this into a linear system $MX=Y$ where $X_i=\phi(t_i)$ and $Y_j=f(x_j)$
I've chosen $t$ to run from -1 to 1 with $dt=.2$ and I've chosen x to be the midpoints between the $t_i$'s to avoid any zero denominators.
My dilemma is how to create M. What should be in M actually. How does the condition that the integral of $\phi$ being zero come into play?
 A: Partial answer : Because of the kernel $1/(t-x)$, the integral exists only as a Cauchy principal value, so naive methods of quadrature will give you gibberish. Your equation is not the usual Fredholm integral equation, but a singular integral equation. 
As it happens, this particular equation has nice closed form solutions (For instance, look at the text by Kanwal and Estrada). If you have taken a complex variables course, you should be able to follow it. The other thing is that you have to specify what class of solutions you are interested in (bounded at both ends, unbounded at both ends or mixed). Without that, the equation does not have a unique solution. 
Your scheme of choosing the x locations to be midway between the t is not guaranteed to minimize the error in quadrature. This is why numerical methods for singular equations use orthogonal polynomials in a way to minimize the error (in this case, you would use Chebychev polynomials). It is too long to summarize here, but Chebychev polynomials have nice closed form expressions for their cpv, e.g. with the weight function $\sqrt{1-s^2}$
$$
p.v. \int_{-1}^{1} \dfrac{U_n(s)\sqrt{1-s^2}}{s-t} = -\pi T_{n+1}(t)
$$
where $U$ and $T$ are Chebychev polynomials of the first and second kind.
