integral_rectangulo
Compute definite integrals numerically using the composite midpoint (rectangle) rule from a math expression, limits, and subinterval count; optionally return error estimates and a plot.
Instructions
Approximate ∫ₐᵇ f(x) dx with the composite midpoint (rectangle) rule.
Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. epsilon: Optional point in [a, b] for the truncation error bound. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) over [a, b].
Returns:
Dict with the integral, error estimates and table. With plot=True a
list [dict, Image] is returned instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| n | Yes | ||
| plot | No | ||
| epsilon | No | ||
| func_str | Yes | ||
| precision | No |