Applying the Composite Trapezoidal Rule to Fredholm Integral Equations of the Second Kind

July 1, 2019

Fredholm integral equations of the second kind are of the form:

u(x)=f(x)+abK(x,t)u(t)dtu(x) = f(x) + \int_{a}^{b} K(x,t)u(t)dt

Given f(x)f(x) and K(x,t)K(x,t), can we find the solution for the unknown function u(x)u(x)? The most difficult part of this problem is evaluating the integral abK(x,t)u(t)dt\int_{a}^{b} K(x,t)u(t) dt, which often has no analytical solution if the kernel function K(x,t)K(x,t) is complicated. It is helpful to approach these problems numerically.

One naive approach to this problem is to try to approximate abK(x,t)u(t)dt\int_{a}^{b} K(x,t)u(t) dt. We will solve it using the composite trapezoidal rule. Assuming a uniform grid with nn equal partitions and step-size h=banh=\frac{b-a}{n}, the composite trapezoidal rule is as stated:

abf(x)dxh2(f(x0)+2i=1n1f(xi)+f(xn))\int_{a}^{b} f(x)dx \approx \frac{h}{2}\left(f(x_0) + 2\sum_{i=1}^{n-1}f(x_i) + f(x_n)\right)

where xi[a,b]x_i \in [a,b] for i=0,1,,ni = 0, 1, \dots, n. When we apply the composite trapezoidal rule to our integral, we get

abK(x,t)u(t)dt=h2(K(x,x0)u(x0)+2i=1n1K(x,xi)u(xi)+K(x,xn)u(xn))\int_{a}^{b}K(x, t)u(t)dt = \frac{h}{2}\left(K(x, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x, x_i)u(x_i) + K(x, x_n)u(x_n)\right)

By substituting this information into our original equation, we can define u(x)u(x) in the following way:

u(x)=f(x)+h2(K(x,x0)u(x0)+2i=1n1K(x,xi)u(xi)+K(x,xn)u(xn))u(x) = f(x) + \frac{h}{2}\left(K(x, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x, x_i)u(x_i) + K(x, x_n)u(x_n)\right)

When we evaluate u(x)u(x) at all the evenly spaced nodes x0,x1,,xn[a,b]x_0, x_1, \dots , x_n \in [a,b], we can construct the system of equations:

u(x0)=f(x0)+h2(K(x0,x0)u(x0)+2i=1n1K(x0,xi)u(xi)+K(x0,xn)u(xn))u(x1)=f(x1)+h2(K(x1,x0)u(x0)+2i=1n1K(x1,xi)u(xi)+K(x1,xn)u(xn))u(xn1)=f(xn1)+h2(K(xn1,x0)u(x0)+2i=1n1K(xn1,xi)u(xi)+K(xn1,xn)u(xn))u(xn)=f(xn)+h2(K(xn,x0)u(x0)+2i=1n1K(xn,xi)u(xi)+K(xn,xn)u(xn))\begin{aligned} u(x_0) &= f(x_0) + \frac{h}{2}\left(K(x_0, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x_0, x_i)u(x_i) + K(x_0, x_n)u(x_n)\right) \\ u(x_1) &= f(x_1) + \frac{h}{2}\left(K(x_1, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x_1, x_i)u(x_i) + K(x_1, x_n)u(x_n)\right) \\ &\vdots \\ u(x_{n-1}) &= f(x_{n-1}) + \frac{h}{2}\left(K(x_{n-1}, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x_{n-1}, x_i)u(x_i) + K(x_{n-1}, x_n)u(x_n)\right) \\ u(x_n) &= f(x_n) + \frac{h}{2}\left(K(x_n, x_0)u(x_0) + 2\sum_{i=1}^{n-1}K(x_n, x_i)u(x_i) + K(x_n, x_n)u(x_n)\right) \\ \end{aligned}

Solving this system yields the values for u(x0),u(x1),,u(xn)u(x_0), u(x_1),\dots,u(x_n). The matrix form of this system looks like

(In+1h2[K(x0,x0)2K(x0,x1)2K(x0,xn1)K(x0,xn)K(x1,x0)2K(x1,x1)2K(x1,xn1)K(x1,xn)K(xn1,x0)2K(xn1,x1)2K(xn1,xn1)K(xn1,xn)K(xn,x0)2K(xn,x1)2K(xn,xn1)K(xn,xn)])[u(x0)u(x1)u(xn1)u(xn)]=[f(x0)f(x1)f(xn1)f(xn)]\left(I_{n+1} - \frac{h}{2}\begin{bmatrix} K(x_0, x_0) & 2K(x_0, x_1) & \cdots & 2K(x_0, x_{n-1}) & K(x_0, x_n) \\ K(x_1, x_0) & 2K(x_1, x_1) & \cdots & 2K(x_1, x_{n-1}) & K(x_1, x_n) \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ K(x_{n-1}, x_0) & 2K(x_{n-1}, x_1) & \cdots & 2K(x_{n-1}, x_{n-1}) & K(x_{n-1}, x_n) \\ K(x_n, x_0) & 2K(x_n, x_1) & \cdots & 2K(x_n, x_{n-1}) & K(x_n, x_n) \end{bmatrix}\right) \begin{bmatrix} u(x_0) \\ u(x_1) \\ \vdots \\ u(x_{n-1}) \\ u(x_n) \end{bmatrix} = \begin{bmatrix} f(x_0) \\ f(x_1) \\ \vdots \\ f(x_{n-1}) \\ f(x_n) \end{bmatrix}

where In+1I_{n+1} is the identity matrix of size n+1n+1.

Let’s try this on an example problem. Let u(x)=ex1+01tu(t)dtu(x) = e^x-1+\int_{0}^{1}tu(t)dt where f(x)=ex1f(x) = e^x-1 and K(x,t)=tK(x,t)=t. The exact solution to this equation is u(x)=exu(x)=e^x1. Let’s use n=4n=4 intervals with a step-size of h=14h=\frac{1}{4}. Our set of nodes will then be 0,14,12,34,1{ 0, \frac{1}{4}, \frac{1}{2}, \frac{3}{4}, 1 }. The matrix equation is

(I518[00.511.5100.511.5100.511.5100.511.5100.511.51])[u(0)u(0.25)u(0.5)u(0.75)u(1)]=[0e0.251e0.51e0.751e1]\begin{pmatrix}I_5 - \frac{1}{8}\begin{bmatrix} 0 & 0.5 & 1 & 1.5 & 1\\ 0 & 0.5 & 1 & 1.5 & 1\\ 0 & 0.5 & 1 & 1.5 & 1\\ 0 & 0.5 & 1 & 1.5 & 1\\ 0 & 0.5 & 1 & 1.5 & 1 \end{bmatrix} \end{pmatrix} \begin{bmatrix}u(0)\\ u(0.25)\\ u(0.5)\\ u(0.75)\\ u(1)\end{bmatrix} = \begin{bmatrix}0\\ e^{0.25}-1\\ e^{0.5}-1\\ e^{0.75}-1\\ e-1\end{bmatrix}

MATLAB spits out

u(0) 1.0461
u(0.25) 1.3302
u(0.5) 1.6949
u(0.75) 2.1631
u(1) 2.7644

Let’s look at a plot of our approximation versus the exact solution:

It looks okay. We can see that there is some error when we only use 44 intervals. Let’s see if we can do better when n=8n=8:

The error is much smaller, which should make sense because the composite trapezoidal rule has error of order O(h3)O(h^3). So when we double our steps-size, our error is 18\frac{1}{8}ed.


  1. Avazzadeh, Z., et al. “Numerical Solution of Fredholm Integral Equations of the Second Kind by Using Integral Mean Value Theorem.” Applied Mathematical Modelling, vol. 35, no. 5, May 2011, pp. 2374–2383.