Double Integral in MATLAB
The double integral of a non-negative function f(x, y) defined on a region in the plane tells us about the volume of the region under the graph. The double integral of a function of two variables, f(x, y) over the region R can be expressed as follows :
MATLAB allows users to calculate the double integral of a function using the integral2() method. Different syntax of integral2() method are:
- F = integral2(fun,xmin,xmax,ymin,ymax)
- F = integral2(fun,xmin,xmax,ymin,ymax,Name,Value)
This function approximates the integral of any function f = fun(x,y) in the region xmin ≤ x ≤ xmax and ymin(x) ≤ y ≤ ymax(x)
F = integral2(fun,xmin,xmax,ymin,ymax,Name,Value)
It specifies additional options with one or more Name, Value pair arguments. The most popular Name used is ‘Method’
The Possible values are:
- tiled: The limits for the integration must be finite for this method to work. It subdivides the integration zone into simpler rectangular areas if needed after transforming it to a rectangular shape.
- iterated: In this method, iterated integration is applied. It is the process of repeatedly integrating the results of the previous integrations when the function consists of more than one variable. In the function. In this method, the integration limits can be infinite.
- auto: The ‘auto’ method is used as the default value. It chooses tiled or iterated based on the limits chosen. If limits are infinite then it chooses ‘iterated’ otherwise it calculates using the ’tiled’ method.