# Homework Help: Trapezoidal rule

1. Oct 25, 2009

### sara_87

1. The problem statement, all variables and given/known data

if i have an integral equation of the form:

$$\lambda x(t)-\int{K(t,s)x(s)ds}=y(t)$$

and i want to apply the nystrom method to find a numerical solution, then the quadrature rule gives:

$$\lambda x(t_i)-\sum^n_{j=1}{w_{j}K(t_i,t_j)x(t_j)}=y(t_i)$$

my question is:
What is (using the trapezoidal rule) the expression for wj

2. Relevant equations

3. The attempt at a solution

i have no idea except that there's a 'h' somewhere (step length)
thank you

2. Oct 25, 2009

### Staff: Mentor

At the risk of telling you something you might already know, here's what's going on in the trapezoid rule.

You have a function f(t) that you want to integrate, and you have divided your interval [a, b] into n subintervals of length h, using a partition {t0, t1, ... , ti, ti + 1, ..., tn}.

The trapezoid rule approximates $$\int_{t_i}^{t_{i + 1}} f(t) dt$$ by a trapezoid whose area is $$\frac{f(t_i) + f(t_{i + 1}}{2}h$$.

When you add up all the trapezoidal regions, you get
$$\frac{f(t_0) + f(t_{1})}{2}h + \frac{f(t_1) + f(t_{2})}{2}h + \frac{f(t_2) + f(t_{3})}{2}h + ... + \frac{f(t_{n - 1}) + f(t_{n})}{2}h$$

This works out to (1/2)h*[f(t0) + 2f(t1) + 2f(t2) + ... + 2f(tn - 1) + f(tn)], because all of the f(ti) terms appear twice except for the first one and the last one.

So... my guess is that wj in your integral is going to one of two different values, depending on the value of j; wj = (h/2) for j = 0 and j = n, and wj = h for 0 < j < n.