Numerically integrate bivariate function

Click For Summary

Discussion Overview

The discussion revolves around methods for numerically integrating a bivariate function, specifically in the context of double integrals over specified limits. Participants explore various numerical techniques without resorting to symbolic integration, addressing both theoretical and practical aspects of the problem.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about available methods for numerically integrating a double integral involving functions f(x) and g(x,y).
  • Another participant suggests treating the integral as a bounded integral under the assumption that the function approaches zero for sufficiently large x, proposing a midpoint rule for numerical approximation.
  • A different participant proposes transforming the integral into polar coordinates, detailing a change of variables to facilitate integration over a finite rectangle, while also discussing potential issues with evaluating the integrand at certain limits.
  • One participant questions the need for an algorithm that avoids evaluating the integrand at specific points, expressing uncertainty about available algorithms.
  • A later reply recommends consulting a specific edition of a reference book for algorithms related to the approximation of single and double integrals.

Areas of Agreement / Disagreement

Participants present multiple approaches and suggestions for numerical integration, but there is no consensus on a single method or algorithm. The discussion remains unresolved regarding the best approach to take.

Contextual Notes

Some participants express uncertainty about the assumptions underlying their proposed methods, such as the behavior of the functions at certain limits and the need for specific algorithms. There are also unresolved questions about the correct formulation of integrals after variable substitutions.

sunrah
Messages
191
Reaction score
22
What methods are available for integrating, e.g.
[itex] \int^{\infty}_{0} f(x) dx \int^{x}_{0} g(x,y) dy[/itex]

numerically without resorting to symbolic integration. Thanks
 
Physics news on Phys.org
Assuming that the integral exists and there is a sufficiently large x for which the function is approximately zero, then you could look at this as a bounded integral.
## \int_0^L\int_0^x f(x) g(x,y) dy dx ##
Numerically, you would partition the interval from 0 to L with N+1 points ##\{x_i\}_{i=0}^N##, such that ##x_0 = 0 ## and ##x_N = L. ##
Then you would have a region of integration that grows like half a square.

If you apply a midpoint rule for a simple approximation, this might look like ( with ##dx_i = x_i - x_{i-1}##) :
## \int_0^L\int_0^x f(x) g(x,y) dy dx \approx \sum_{ i = 1 }^N dx_i f\left( \frac{x_i + x_{i-1}}{2}\right) \sum_{j=1}^i dx_j g\left(\frac{x_i + x_{i-1}}{2}, \frac{x_j + x_{j-1}}{2} \right)##

Does that help?
 
I think I would first move to polar coordinates, so that [tex]I = \int_0^\infty \int_0^x f(x)g(x,y)\,dy\,dx = <br /> \int_0^\infty \int_0^{\pi/4} f(r\cos\theta) g(r\cos\theta, r\sin\theta) r\,d\theta\,dr.[/tex] Then I'd set [itex]r = \mathrm{arctanh}(s)[/itex] so that [tex] I = \int_0^1 \int_0^{\pi/4} f(\mathrm{arctanh}(s)\cos\theta) g(\mathrm{arctanh}(s)\cos\theta, \mathrm{arctanh}(s)\sin\theta) \frac{\mathrm{arctanh}(s)}{1 - s^2}\,d\theta\,ds.[/tex]
Now I'm integrating over a finite rectangle, and I probably want to use an algorithm which doesn't require me to evaluate the integrand at [itex]s = 1[/itex].

Alternatively, I could split the integral as [tex] \int_0^1 \int_0^{\pi/4} f(r\cos\theta) g(r\cos\theta, r\sin\theta) r\,d\theta\,dr + \int_1^\infty \int_0^{\pi/4} f(r\cos\theta) g(r\cos\theta, r\sin\theta) r\,d\theta\,dr[/tex]
and in the second integral make the substitution [itex]z = 1/r[/itex], to obtain [tex] I = \int_0^1 \int_0^{\pi/4} f(r\cos\theta) g(r\cos\theta, r\sin\theta) r<br /> + f(r^{-1}\cos\theta)g(r^{-1}\cos\theta,r^{-1}\sin\theta)r^{-3}\,d\theta\,dr[/tex] and this time I probably want to use an algorithm which doesn't require me to evaluate the integrand at [itex]r = 0[/itex].
 
  • Like
Likes   Reactions: sunrah
pasmith said:
use an algorithm which doesn't require me to evaluate the integrand at [itex]s = 1[/itex]

Thanks, the change of variables is intuitive, but I don't know any algorithms?
Also, in the last step in your alternative procedure shouldn't the second integral be over z not r?
 
Last edited:
For algorithms I suggest the Burden Faires, 8th edition, there is a section regarding the approximations of single and double integrals ...
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 27 ·
Replies
27
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 25 ·
Replies
25
Views
4K