sara_87
- 748
- 0
Homework Statement
I want to approximate the following integral:
\int^{1}_{0}\frac{1}{x}dx
using the trapezoidal quadrature rule.
However there is a singularity at x=0.
Homework Equations
trapezoidal method:
\int^{a}_{b}f(x) dx \approx \frac{h}{2}(f(x_0))+h\sum_{i=1}^{n}(f(x_i))+\frac{h}{2}(f(x_n))
where x_i = i*h and h=1/n and i = 0,1,2,...,n
The Attempt at a Solution
\int^{a}_{b}f(x)dx \approx \frac{h}{2}(1/x_0)+h\sum_{i=1}^{n}(1/x_i)+\frac{h}{2}(1/x_n)
i can implement the second and last term but not the first term due to the singularity (at x=0)
How can i deal with the singularity?
any help or ideas will be very much appreciated.
Thank you.