This entry is now part of the unified function reference. Open the unified page →
integrate
integrate(expr: ExpressionInput, dx: ExpressionInput, depth: number): ExpressionFinds a symbolic indefinite integral with respect to a plain variable. Constants and linear sums are separated first. The remaining integrand is tried against the integral table and bounded strategies for radical and algebraic substitution, quadratic radicals, integration by parts, derivative-pattern substitution, rational decomposition, and the Weierstrass tangent half-angle substitution.
This function returns an antiderivative only; it does not append a constant of integration and it does not accept definite-integration bounds. An unsupported integral, or a strategy that reaches the recursion guard, is represented as an unevaluated
`integrate(expr, dx)`Expression rather than an exception. Branch-sensitive transformations are limited to patterns recognized by the implementation. The result should not be read as a global statement about every real or complex branch outside those supported patterns.
`depth`is the internal strategy-recursion counter and should normally be omitted by direct callers.
UnexpectedInputError If
`dx`is not a plain variable.
Parameters
| Name | Type | Description |
|---|---|---|
expr | ExpressionInput | Integrand to normalize and integrate. |
dx | ExpressionInput | Plain integration variable. |
depth | number | Internal recursion depth. Defaults to zero. |
Returns
Expression — A symbolic antiderivative without an integration constant, or an unevaluated `integrate(...)` Expression.
Examples
integrate('2*x*cos(x^2)', 'x').text();