Approximating Integral w/ Singularity at x=0 Using Trapezoidal Rule

  • Thread starter sara_87
  • Start date
  • Tags
    Numerical
In summary, trapezoidal method won't work for this particular case because there is a singularity at the end point.
  • #1
sara_87
763
0

Homework Statement



I want to approximate the following integral:

[tex]\int^{1}_{0}\frac{1}{x}dx[/tex]

using the trapezoidal quadrature rule.
However there is a singularity at x=0.

Homework Equations



trapezoidal method:

[tex] \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))[/tex]

where x_i = i*h and h=1/n and i = 0,1,2,...,n

The Attempt at a Solution



[tex] \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)[/tex]

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.
 
Physics news on Phys.org
  • #2
It's worse than just the function having a singularity. The singularity is bad enough that the integral doesn't exist. In some sense, the answer to the integral is +infinity. There is an infinite amount of area under the curve. How can you (or why would you want to) approximate that?
 
  • #3
thank you.
But, If i was to use the trapezoidal method in this case, or in any other case where i have a singularity in the function at the end point, how would i get rid of the singularity?
 
  • #4
sara_87 said:
thank you.
But, If i was to use the trapezoidal method in this case, or in any other case where i have a singularity in the function at the end point, how would i get rid of the singularity?

There's no way to 'get rid of it'. I think numerical methods for integrating functions with singularities are complicated. You could always make a small interval around the singularity and throw it away and apply the trapezoid method to the rest. It would be an estimate anyway.
 
  • #5
thank you :)
i will consider this.
 

Related to Approximating Integral w/ Singularity at x=0 Using Trapezoidal Rule

1. What is the Trapezoidal Rule used for?

The Trapezoidal Rule is a numerical method used to approximate the value of a definite integral. It is particularly useful for integrals that cannot be solved analytically.

2. How does the Trapezoidal Rule work?

The Trapezoidal Rule works by dividing the interval of integration into smaller subintervals and approximating the area under the curve with trapezoids. The area of each trapezoid is then calculated and summed to get an approximation of the integral.

3. What is a singularity at x=0?

A singularity at x=0 is a point on the graph of a function where the function is undefined or discontinuous. In the context of approximating integrals, a singularity at x=0 means that the function has a sharp change or infinite value at that point.

4. Why is the Trapezoidal Rule useful for integrals with a singularity at x=0?

The Trapezoidal Rule is useful for integrals with a singularity at x=0 because it can still provide a good approximation of the integral even if the function is undefined or infinite at that point. The trapezoids used in the approximation can be adjusted to fit the shape of the curve near the singularity, resulting in a more accurate approximation.

5. Are there any limitations to using the Trapezoidal Rule for integrals with a singularity at x=0?

Yes, there are some limitations to using the Trapezoidal Rule for integrals with a singularity at x=0. If the singularity is too sharp or the interval of integration is too large, the approximation may not be accurate. In these cases, other numerical methods such as Simpson's Rule may be more suitable.

Back
Top