SymbolicIntegration: can I do definite integrals?

Does SymbolicIntegration.jl support definite integrals? Including to +/- infinity? If so, what is the syntax for specifying integration bounds?

SymbolicIntegration.integrate returns a Symbolics.Num which you can just evaluate with Symbolics.evaluate. The fundamental theorem of calculus should do the rest. For example

using SymbolicIntegration, Symbolics

@variables x
f = integrate(exp(-0.01 * x), x)

Symbolics.evaluate(f, Dict(x => Inf)) - Symbolics.evaluate(f, Dict(x => 0.))
1 Like

Ah. So it would be trivial to make a dispatch of integrate or add keywords lower and upper? I can live with evaluate, though.

If you need a helper function, something like

function integratedefinite(f, x, a, b, method)
    F = integrate(f, x, method)
    return Symbolics.evaluate(F, Dict(x => b)) - Symbolics.evaluate(F, Dict(x => a))
end

works.

1 Like