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

  • Thread starter Thread starter sara_87
  • Start date Start date
  • Tags Tags
    Numerical
Click For Summary

Homework Help Overview

The discussion revolves around approximating the integral of the function \( \frac{1}{x} \) from 0 to 1 using the trapezoidal rule, noting the singularity at \( x=0 \). Participants explore the implications of this singularity on the existence of the integral and the challenges it presents for numerical approximation.

Discussion Character

  • Exploratory, Assumption checking

Approaches and Questions Raised

  • Participants discuss the nature of the singularity and its impact on the integral's existence. Questions arise about how to handle the singularity when applying the trapezoidal method and whether it is possible to approximate the integral despite the singularity.

Discussion Status

The discussion is ongoing, with participants sharing insights about the difficulties posed by the singularity. Some suggest that numerical methods for such cases are complex, while others propose potential strategies for managing the singularity, such as excluding a small interval around it.

Contextual Notes

There is an acknowledgment that the integral diverges due to the singularity, leading to questions about the validity and approach of using numerical methods in this context.

sara_87
Messages
748
Reaction score
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.
 
Physics news on Phys.org
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?
 
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?
 
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.
 
thank you :)
i will consider this.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 105 ·
4
Replies
105
Views
11K
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
5
Views
2K