Skip to contents

SymbolicIntegrate: antiderivative of an elementary expression parsed with ShuntingYard and kept in a canonical sum-of-products form. Rules, in order: constants and linearity, the elementary table for arguments linear in x, rational functions by polynomial division and partial fractions over the Durand-Kerner roots of the denominator (the rational part of the Risch-Bronstein algorithm), integration by parts, exp-trig products, derivative-divides substitution and distribution over sums; the result is verified by differentiating it back at five points. SymbolicDiff: derivative by the sum, product, power and chain rules. Identical to the Python arm morie.fn.symint.

Usage

SymbolicIntegrate(expr, x = "x")

SymbolicDiff(expr, x = "x")

Arguments

expr

Expression string.

x

Variable name.

Value

List. SymbolicIntegrate: antiderivative (NULL when no rule applies), verified, max_rel_error, expression. SymbolicDiff: derivative, expression.

References

Bronstein, M. (1997). Symbolic Integration I: Transcendental Functions. Springer.

Geddes, K. O., Czapor, S. R. and Labahn, G. (1992). Algorithms for Computer Algebra. Kluwer.

Examples

SymbolicIntegrate("x*exp(2*x)")$antiderivative
#> [1] "-0.25*exp(2*x) + 0.5*exp(2*x)*x"
SymbolicIntegrate("1/(x^2 + 1)")$antiderivative
#> [1] "atan(x)"
SymbolicDiff("x^3*sin(x)")$derivative
#> [1] "cos(x)*x^3 + 3*sin(x)*x^2"