SymbolicNumericIntegration -- definite integral?

Does SymbolicNumericIntegration support definite integration? [I don’t find this in the documentation… I tried with `integrate(f(x),x~x0…x1)` and also with `integrate(f(x), x=x0…x1)` without much success…]

If not, it is relatively straightforward to write my own function for this…

1 Like

I think you have to write your own function for this.

1 Like

I’ve played around with a function. A couple of “problems”:

  • Is there a way to test whether a quantity is a (Symbolics) variable or not? Like isvariable(x) or issymbol(x) or something? I’d need that to test whether integral bounds are numeric values (so I can use substitute) or variables…
  • Unfortunately, it seems like the integrate function does not work with integers/rational numbers – it would have been nice if functions with rational coefficients preserved the type after doing integration. [Or did I do something wrongly?]

x isa SymbolicUtils.BasicSymbolic.

There’s an open issue on that:

1 Like


> using Symbolics
> @syms t
> t isa SymbolicUtils.BasicSymbolic

> @variables u
> u isa SymbolicUtils.BasicSymbolic

I could probably use @syms, but it seems like a @syms generated variable does not support plotting. In other words: if I create a function of the variable, Plots command plot works if I have defined the variable via @variables, but not if I define it via @syms.

If I stick with @variables, the following may work…

> Symbolics.get_variables(t) |> length ==1
> Symbolics.get_variables(pi) |> length ==1

Perhaps not elegant?