riemann_sum
Estimate the area under a curve using Riemann sum methods. Specify function, variable, integration limits, subintervals, and method (left, right, midpoint, or trapezoid) to compute the result.
Instructions
Calculate the Riemann sum of a function using different methods
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | Lower limit of integration | |
| b | Yes | Upper limit of integration | |
| expression | Yes | Function to integrate | |
| method | No | Method: left, right, midpoint, or trapezoid | midpoint |
| n | Yes | Number of subintervals | |
| variable | Yes | Variable of integration |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"properties": {
"a": {
"description": "Lower limit of integration",
"type": "number"
},
"b": {
"description": "Upper limit of integration",
"type": "number"
},
"expression": {
"description": "Function to integrate",
"type": "string"
},
"method": {
"default": "midpoint",
"description": "Method: left, right, midpoint, or trapezoid",
"enum": [
"left",
"right",
"midpoint",
"trapezoid"
],
"type": "string"
},
"n": {
"description": "Number of subintervals",
"type": "number"
},
"variable": {
"description": "Variable of integration",
"type": "string"
}
},
"required": [
"expression",
"variable",
"a",
"b",
"n"
],
"type": "object"
}