Definition of an integral function whose argument is the upper limit of integration

Hi, I want to define a function let’s say,
$$ f(x) = \int_0^x u^2 du /(e^{u^2+16} +1)^{\frac{3/2}}$$
How can I do this?, A naive approach is to use a loop and just each time calculate the whole thing.
But is there any other way?

Just for the sake of clarity, this integral?

f(x) = \int_0^x \frac{u^2 du}{(e^{u^2 + 16} + 1)^{3/2}}

If so, note that in Markdown, the $$ syntax must be like a paragraph mark on a line above and below the LaTeX. I’ll also take a stab at solving it (never used Integrals.jl before):

using Integrals
f(u, p) = u^2 / (exp(u^2 + 16) + 1)^(3/2)
prb(from, to) = solve(IntegralProblem(f, from, to), QuadGKJL()).u
9.105638710911127e-12

Or, you could compute a few representative points in your range of interest and interpolate between them?

See Evaluate integral on many points (Cubature.jl ?)

1 Like