# Techniques to optimise the integral of a function of known analytical form

I need to compute repeatedly a function that depends on an integral. The integral is not solvable analytically, but it depends on the argument of the function parametrically, like this:

$$f(x) = \int_0^1g(x, u)du$$

The function $$g(x,u)$$ is of known and fixed analytical shape, infinitely differentiable. My question is, is there any specialised algorithm that I can use to optimise this integral as much as possible, exploiting what I know of the function? I tried to see if it could be expressed as a Chebyshev series but no luck.

• Could you clarify what you mean by "optimising this integral"? – smh Jun 24 at 17:11
• What do you know about the dependence of $g$ on $x$? Could you do a Taylor expension of $f$ around some $x$ by doing a Taylor expansion of $g$ around some $x$ for every $u$? – Wolfgang Bangerth Jun 24 at 18:53
• Are you trying to differentiate $f(x)$ with respect to $x$? Could you differentiate $g(x,u)$ with respect to $x$ inside the integral? – Brian Borchers Jun 24 at 21:41
• @smh I want to make it as fast as possible to compute exploiting the fact that I know the integrand. Basically, I'd like a specialised algorithm rather than a general-purpose one like your typical quadrature. – Okarin Jun 25 at 9:30
• @WolfgangBangerth everything, I know the exact function, though it's rather complicated to write. But I'm not sure a Taylor expansion is any good as I need to cover a large range of $x$. I can expand in $u$ and thus define the integral as a sum of polynomial integrals on each small $du$, though. That's my first idea. – Okarin Jun 25 at 9:32