integral_simpson13
Approximate definite integrals of f(x) on [a,b] via composite Simpson 1/3; returns value, error estimates, table, and optional plot.
Instructions
Approximate the definite integral of f(x) on [a, b] with composite Simpson 1/3.
Args: func_str: Math expression in x, e.g. "sin(x)/x". a: Lower integration limit. b: Upper integration limit (must be > a). n: Number of subintervals (must be even). Error is O(h^4). epsilon: Point in [a, b] used to report 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 approximated integral, error estimates and table.
With plot=True a list [dict, Image] is returned instead.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"func_str": "<func_str>",
"a": "<a>",
"b": "<b>",
"n": "<n>"
},
"name": "integral_simpson13"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| n | Yes | ||
| plot | No | ||
| epsilon | No | ||
| func_str | Yes | ||
| precision | No |