Numerically integrate bivariate function

In summary, if you want to integrate a function f(x) over an interval from 0 to L and you don't want to use a symbolic integration, then you could use the midpoint rule and or an algorithm which doesn't require you to evaluate the integrand at s = 1.
  • #1
sunrah
199
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
  • #2
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?
 
  • #3
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 =
\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
+ 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 sunrah
  • #4
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:
  • #5
For algorithms I suggest the Burden Faires, 8th edition, there is a section regarding the approximations of single and double integrals ...
 

What is numerical integration of a bivariate function?

Numerical integration of a bivariate function is a method used to approximate the definite integral of a function with two variables over a given region. It involves dividing the region into smaller parts and evaluating the function at specific points within each part.

Why is numerical integration used for bivariate functions?

Numerical integration is used for bivariate functions because it is often not possible to find an analytical solution for the definite integral. Using numerical methods allows for a close approximation of the integral without having to solve it algebraically.

What are the common numerical methods used for bivariate function integration?

The most commonly used numerical methods for bivariate function integration are the Trapezoidal Rule, Simpson's Rule, and Monte Carlo Integration. Each method has its own advantages and disadvantages, and the choice of method depends on the specific function and the desired level of accuracy.

How accurate are the results obtained from numerical integration of bivariate functions?

The accuracy of the results obtained from numerical integration of bivariate functions depends on the method used and the number of intervals or sample points chosen. Generally, as the number of intervals or sample points increases, the accuracy of the approximation also improves.

What are some applications of numerical integration of bivariate functions?

Numerical integration of bivariate functions has many applications in fields such as physics, engineering, economics, and statistics. It is used to solve problems involving area, volume, probability, and optimization, among others.

Similar threads

Replies
3
Views
1K
  • Calculus
Replies
6
Views
1K
Replies
2
Views
931
  • Calculus
Replies
25
Views
1K
Replies
1
Views
937
Replies
31
Views
922
Replies
3
Views
1K
Replies
8
Views
176
  • Calculus
Replies
11
Views
2K
Back
Top