API
SymbolicNumericIntegration.integrate
— Functionintegrate(eq, x; kwargs...)
is the main entry point to integrate a univariate expression eq
with respect to `x' (optional).
julia> using Symbolics, SymbolNumericIntegration
julia> @variables x a
julia> integrate(x * sin(2x))
((1//4)*sin(2x) - (1//2)*x*cos(2x), 0, 0)
julia> integrate(x * sin(a * x), x; symbolic = true, detailed = false)
(sin(a*x) - a*x*cos(a*x)) / (a^2)
julia> integrate(x * sin(a * x), (x, 0, 1); symbolic = true, detailed = false)
(sin(a) - a*cos(a)) / (a^2)
Arguments:
eq
: a univariate expressionx
: independent variable (optional ifeq
is univariate) or a tuple of (independent variable, lower bound, upper bound) for definite integration.
Keyword Arguments:
abstol
(default:1e-6
): the desired tolerancenum_steps
(default:2
): the number of different steps with expanding basis to be triednum_trials
(default:10
): the number of trials in each step (no changes to the basis)show_basis
(default:false
): if true, the basis (list of candidate terms) is printedbypass
(default:false
): if true do not integrate terms separately but consider all at oncesymbolic
(default:false
): try symbolic integration first (will be forced ifeq
has symbolic constants)max_basis
(default:100
): the maximum number of candidate terms to considerverbose
(default:false
): print a detailed reportcomplex_plane
(default:true
): generate random test points on the complex plane (if false, the points will be on real axis)radius
(default:1.0
): the radius of the disk in the complex plane to generate random test pointsopt
(default:STLSQ(exp.(-10:1:0))
): the sparse regression optimizer (from DataDrivenSparse)homotopy
(default:true
): deprecated, will be removed in a future versionuse_optim
(default:false
): deprecated, will be removed in a future versiondetailed
(default:true
):(solved, unsolved, err)
output format. Ifdetailed=false
, only the final integral is returned.
Returns a tuple of (solved, unsolved, err) if detailed == true
, where
solved: the solved integral
unsolved: the residual unsolved portion of the input
err: the numerical error in reaching the solution
Returns the resulting integral or nothing if detailed == false