# Solving integral equation with nystrom method

1. Nov 24, 2015

### huyhohoang

Hello everyone!
I am building set of Fortran code to solve integral equation. I have read "Numerical recipe" and heard about "Nystrom method". But there's no sample problem, I found it difficult to understand. Can anyone explain "Nystrom method" for me with a simple problem???
Many thanks

2. Nov 24, 2015

### Staff: Mentor

Do you have a particular equation you want to solve?

3. Nov 24, 2015

### huyhohoang

Here my equation $$f(x)=x+\int_{-1}^{1}xyf(y)dy$$
Can you solve it in detail for me? I am an amauteur :)
Thank you so much

4. Nov 25, 2015

### .Scott

I can. But I'm not inclined to. The purpose of this forum is education. So you are a student - not an amateur - and let's find out whether you understand what you're wading into:

What's your experience so far as a Fortran programmer? Took a course? In a course?

Do you know what the Nyström method is?

Do you realize the significance of function "f" being used both inside the integration and out? What problem does that pose?

5. Nov 25, 2015

### huyhohoang

Thanks for your advice! Would you mind send me some articles or books for more details?

6. Nov 25, 2015

### .Scott

If you attempt to answer those questions I posed, I would be able to gauge where you are starting from.

I would guess that you have the Fortran covered - you have coded, perhaps already taken a course or two - and you have reference material and a development environment set up.

The Nyström method is just a few equations and it is covered in a wiki article. When it is implemented in software, the weights are commonly set equal and the x's are the midpoints of the ranges - with each range being of equal width.

As I suggested before, having the function f() inside and outside of the integral adds a complicating twist to the problem. I would suggest you start with a simpler integral, get your Fortran program working with it. Once you've done that, you should understand the complication. There are methods and college course available for solving those kinds of integral problems. And there are potential ways of attacking them by computer - but they require considerable expertise on the part of the software developers.

And, of course, it may already be done. Mathematica sells products for solving these types of equations.
Here's a link to their online integral calculator. It won't do the integral you posed, but it will do many others:
http://integrals.wolfram.com/index.jsp

7. Nov 25, 2015

### huyhohoang

An integral is approximated by $$\int_{a}^{b}f(x)dx=\sum_{i=1}^{n}w_{i}f(x_{i})$$
I am very confused with the weights wi in Nystrom equation. How can I find it?

8. Nov 25, 2015

### .Scott

As I said:
So, for example, if you divide this integral into 100 pieces, then:
x1=a+(1(b-a)/200), x2=a+(3(b-a)/200), ... x100=a+(199(b-a)/200)
w1 = w2 = ... = w100 = (b-a)/100

In general, you might want to use x values that are not evenly spaced - in which case you might use this formula for the weights: wn=(xn+1-xn-1)/2
But for now, keep it simple and use the values I posted above.

9. Nov 25, 2015

### huyhohoang

I have known how to solve my equation :) Thanks for your help.