Integrating B-Spline composed with log If $f$ is a real B-Spline and $a, b$ are real numbers, then is there a numerically stable way to evaluate the definite integral
$$\int_a^b f (\log x) \,\mathrm{d}x\,?$$
 A: The $\int_a^b f(\log x) dx$ expression actually has a nice analytical form, which enables to evaluate it in an elegant manner.
First, we perform a change of variables $y=\log x$, $dx = x dy = e^y dy$.
We get the expression:
$$
\int_A^B e^y f(y) dy
$$
where $A = \log a$ and $B=\log b$.
Now, integrating by parts we get:
$$
\int e^y f(y) dy = e^y f(y) dy - \int e^y f'(y) dy = e^y f(y) dy - e^y f'(y) + \int e^y f''(y) dy = ...
$$
and this continues until the derivative of the spline degree $d$, after which all derivatives are zero.
Thus, we have:
$$
\int e^y f(y) dy = e^y(\sum_{k=0}^{d} (-1)^{k}f^{(k)}(y))
$$
Evaluating the B-spline and all its derivative values has well-known stable methods (see for example The NURBs book Section 3.3, or here) so the expression is computed in the following manner.
Evaluate the B-spline $f$ and all its derivatives $f^{(k)}(y)$, $k = 0...d$ at $y = A=\log a$ and $y = B=\log b$, and assign the values into the expression above. We get:
$$
\int_a^b f(\log x) dx = \int_A^B e^y f(y) dy = b\sum_{k=0}^{d} (-1)^{k}f^{(k)}(B) - a\sum_{k=0}^{d} (-1)^{k}f^{(k)}(A)
$$
