Discretization of an integral Given $f: [a,b] \to R $ and $K: [a,b]$ x $[a,b]$ $\to R$, we want to find a solution
$\varphi:[a,b] \to R $ to the Fredholm integral equation: 
$$\varphi(x) = f(x)+\int _{ a }^{ b }{ K( x,t)\varphi (t)dt } $$
For a given integer n, we will consider a set of n+1 equispaced points $x_0$ ,..., $x_n$ with $x_0 = a$ and $x_n = b$. We let $h = (b−a)/n$. We want to find values $\varphi_0$, ..., $\varphi_n$ such that $\varphi(x_i) \approx \varphi_i$ for $i = 1...n$. Note that we have for each i:  
$$\varphi(x_i) = f(x_i)+\int _{ a }^{ b }{ K({ x }_{ i },t)\varphi (t)dt } $$


*

*How would we discretize the above integral using points $x_0,...,x_n$ and values $\varphi_0,...,\varphi_n$ using an integration scheme?

*How would we find the system of linear equations that determines the values $\varphi_0,...,\varphi_n$?
Any ideas?
 A: You could use Simpson's rule to discretize the integral, which is indepedent from $x$ (I mean none of the limits are $x$) and for every $x$ sweeps the domain $(a,b)$. For your problem, this reads:

$${ \color{blue}{\phi_i = f_i + \sum^{n-1}_{j=0} \frac{t_{j+1}-t_j}{6} \left[ K(x_i,t_j) \phi_j + 4 K \left( x_i,\frac{t_{j+1}+t_j}{2} \right) \phi_{j+\frac{1}{2}} + K(x_i,t_{j+1}) \phi_{j+1} \right] }} $$

Notice that the LHS is independent from $j$ and $t_j = x_j$. Also, you may approach $\phi_{j+1/2} \approx (\phi_{j+1}+\phi_{j})/2$, as well as for $K_{i,j+1/2}$. If you expand a few terms of the sum for several values of $i$, I believe you can find the matrix formulation of the problem, which hopefully will be of the form: 

$$\color{blue}{ A \vec{\phi} = C, \quad \vec{\phi} = (\phi_0,\ldots,\phi_n) }$$

with $A$ a $(n+1) \times (n+1) $ matrix and $C$ a $(n+1)\times 1$ vector.
Hope this helps!

PS: I have written $\phi$ instead of $\varphi$ for the sake of simplicity.

PS2: Spoiler

 It seems that: $$A= \left( \begin{array}{cccc}  \alpha _{00}-1 & \alpha _{01} & \cdots  & \alpha _{0,n+1} \\  \alpha _{10} & \alpha _{11}-1 & \cdots  & \alpha _{1,n+1} \\  \vdots  & \vdots  & \ddots & \vdots  \\  \alpha _{n,0} & \alpha _{n,1} & \cdots  & \alpha_{n,n}-1 \end{array} \right), $$ and $$ C = \left( \begin{array}{c}  -f_0 \\  -f_1 \\  \vdots  \\ -f_n \end{array} \right),$$ where the $\alpha_{ji}$ coefficients are obtained from the coefficients of the Simpson's rule.

