Numerical integration - Techniques to remove singularities

Click For Summary

Discussion Overview

The discussion revolves around numerical integration techniques, particularly focusing on how to handle singularities in integrals. Participants explore the behavior of a specific integral involving a singularity at x=0 and the implications of using absolute values and square roots in the integrand.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions why the integral ∫dx1/(sin(abs(x)^(1/2))) from x=-1 to x=2 does not pose numerical problems despite the singularity at x=0.
  • Another participant emphasizes that obtaining a numerical result does not guarantee accuracy, suggesting that convergence must be verified through other analytical methods.
  • A different participant argues that the integral can be accurately computed by splitting it into two parts, excluding the singularity, and that numerical methods converge even for functions like 1/x that pass through singularities.
  • One participant proposes expanding the function as a power series near the singularity, indicating that the function behaves like |x|^{-1/2}, which is integrable.
  • Another suggestion involves separating the function into a singular part and a well-behaved part, allowing for analytical integration of the singular component and numerical integration of the remainder.

Areas of Agreement / Disagreement

Participants express differing views on the accuracy of numerical results in the presence of singularities. While some assert that convergence can be achieved through specific techniques, others caution against assuming accuracy without further analysis. The discussion remains unresolved regarding the best methods for handling singularities in numerical integration.

Contextual Notes

Participants mention various numerical methods and their convergence properties, but there are no explicit resolutions to the questions raised about the underlying reasons for convergence or the effectiveness of different singularity removal techniques.

franciobr
Messages
13
Reaction score
0
Hello everyone!

I am trying to understand why the following function does not provide problems to being computed numerically:

∫dx1/(sin(abs(x)^(1/2))) from x=-1 to x=2.

Clearly there is a singularity for x=0 but why does taking the absolute value of x and then taking its square root solve the problem?

I searched for quite a while on the internet and on numerical integration books and was surprised that I couldn't find the answer for that. Apparentlly there is a lack of documentation on singularity removal techniques on the web or I am not searching with the right keywords. Any introductory documentation on the subject is welcome!

For the record I am using MATLAB built-in functions such as quadtx() or integral() to solve it but I that's not the point since it turns out even the most simple simpson rule algorithm can deal with that integral.
 
Technology news on Phys.org
Just because you get a certain number out of a numerical routine does not mean it is accurate. Convergence for a particular definite integral containing a singularity within the limits of integration must be shown using other analysis methods before judging whether the resulting evaluation has any meaning.
 
Yes. The result is accurate since if you exclude the singularity by simply integrating from -1 to 0 and then from 0 to 2 and sum them up the answer is exactly the same. I do not know how to analytically solve this integral and, well, that's the whole point of numerical integration.

I dind't mention that if you try to take the integral without taking the absolute value or the square root you get no answer and there is no convergence of the method. I am interested on why quadrature methods of integration converges on these cases. I am not interested on that particular integral, if you do the same with 1/x kinds of functions and integrate it going through its singularity on 0 you get convergence for the same methods of integration and they agree with analytical results. There is a reason why taking taking a square root and the absolute value of the denominator the numerical methods converges.

The absolute value application seems logical since you don't want a imaginary number coming out of the square root. But the convergence of the method is what astonishes me. I would like to know why there is the convergence and also if anyone has a good source for these techniques of excluding singularities for numerical integration.
 
It's fairly easy to see that the integral is convergent. Expand the function as a power series and you get $$\frac{1}{|x|^{1/2}} \frac {1}{1 - |x|/3! + |x|^2/5! - \cdots}$$

So close to ##x = 0## the function is similar to ##|x|^{-1/2}## which can be integrated everywhere.

If you want to remove the singularity before you do the numerical integration, one way is to write the function as ##f(x) = s(x) + g(x)## where the ##s(x)## contains the singular part and can be integrated explicitly.

Then integrate ##s(x)## analytically and ##g(x)## numerically.

For this example you could take ##s(x) = |x|^{-1/2}## and ##g(x) = f(x) - s(x)## (where ##f(x)## is the function the OP wants to integrate).

You know that ##g(0) = 0## and ##g(x)## is well behaved near ##x = 0##, so any numerical integration method should converge quickly.
 
Last edited:
Good job Aleph, it makes sense now. Thanks!
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
7K
  • · Replies 13 ·
Replies
13
Views
3K
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 5 ·
Replies
5
Views
938
  • · Replies 2 ·
Replies
2
Views
2K