Documentation moved.
This entry is documented with its primary interface. Open the documentation →
Function
src/math/defint/defint.ts:118defint
defint(f: ExpressionInput, dx: ExpressionInput, from: ExpressionInput, to: ExpressionInput): ExpressionCalculates the definite integral numerically when the bounds are numbers, with Decimal
arithmetic at the configured precision. Setting USE_NATIVE_DEFINT uses adaptive Simpson
with native JS numbers instead, which is faster but limited to about 16 digits.
Parameters
| Name | Type | Description |
|---|---|---|
f | ExpressionInput | The function being integrated |
dx | ExpressionInput | The variable of integration |
from | ExpressionInput | The lower limit of the integral |
to | ExpressionInput | The upper limit of the integral |
Returns
Expression — The numeric value if possible else a symbolic function
Examples
defint('cos(x)-x^2+6', 'x', 1, 6); // -42.787553149673489046