Calculates the definite double integral of a function f(x, y) over a general region D, which can be defined as Type I (dy dx) or Type II (dx dy). Uses the Composite Simpson's Rule for numerical approximation.
integrate_double_xy(
f,
const_min,
const_max,
limit1,
limit2,
region_type = "type1",
n_outer = 100,
n_inner = 100,
plot_domain = TRUE
)A list containing:
integral_value: The calculated approximation of the integral.
domain_plot: The ggplot2 object representing the domain (if plot_domain = TRUE).
A function in R of two variables, f(x, y), returning a numeric value.
The constant lower limit of the outer integration (a for Type I, c for Type II).
The constant upper limit of the outer integration (b for Type I, d for Type II).
A function in R of one variable defining the inner integral's lower limit (h1(x) or h1(y)).
A function in R of one variable defining the inner integral's upper limit (h2(x) or h2(y)).
A string specifying the region type: "type1" (dy dx) or "type2" (dx dy). Default is "type1".
Number of subintervals for the outer integration. Must be even. Default is 100.
Number of subintervals for the inner integration. Must be even. Default is 100.
Logical. If TRUE, generates a ggplot2 plot of the integration domain. Default is TRUE.