integral_comparar
Compares rectangle, trapezoid, Simpson 1/3, and Simpson 3/8 rules on the same integral, returning per-method results and an optional bar chart.
Instructions
Compare rectangle, trapezoid, Simpson 1/3 and Simpson 3/8 on the same integral.
Args: func_str: Math expression in x. a, b: Integration limits (b > a). n: Number of subintervals. Must be a multiple of 6 (2 for Simpson 1/3 and 3 for Simpson 3/8), so all four rules can run on the same grid. epsilon, precision: Error-bound and rounding settings. plot: When True, also return a PNG bar chart comparing the four rules.
Returns:
Dict with per-method results and success flags. 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 |