Function reference · Calculus
integrate
Finds an antiderivative of an expression.
It handles sums, constant factors, the elementary functions, scaled arguments, and many algebraic and trigonometric forms.
If it can't find an antiderivative, it returns the integral unevaluated rather than a wrong answer. For a value between two bounds, use defint.
Notation
integrate(expression[, variable])
Write it in an expression: nerdamer('integrate(x^2+3*x+1,x)'), or in the Playground.
nerdamer.integrate
nerdamer.integrate(expression: Expression, variable?: ExpressionInput): Expression
A method on the default import. Arguments can be strings, as in Notation.
import { integrate }
import { integrate } from 'nerdamer/calculus';
integrate(input: ExpressionInput, dx?: ExpressionInput, depth: number): Expression
Import only this function, from nerdamer/calculus.
Parameters
expression- Expression to integrate.
variable- Optional integration variable.
Examples
No elementary antiderivative: unevaluated.
integrate(e^(x^2),x)
// → integrate(e^x^2, x)Open in PlaygroundLeave out the variable when the expression has only one.
integrate(x^2)
// → (1/3)*x^3Open in PlaygroundGood to know
- Without a variable, the expression must have exactly one:
integrate(5)andintegrate(x*y)are errors. - The variable is local to the call: a value stored under its name, as in
x:5, isn't substituted inside it.
