I am looking for ways to evaluate *exactly* (i.e. *analytically* or *semi-analytically*) integrals of the type:
$$
\int\_{-\infty}^{+\infty}B\_{i}^k(u)e^{-\frac{(u-\mu)^2}{2\sigma^2}}du,
$$
where $B\_i^k$ is a spline of order $k$, an element of the B-Spline basis for the linear space of splines of order $k$ on knots $\{t\_i\}$, defined as usual recursively by:
$$
B\_i^k(x)=\frac{x-t\_i}{t\_{i+k}-t\_i}B\_i^{k-1}(x)+\frac{t\_{i+k+1}-x}{t\_{i+k+1}-t\_{i+1}}B\_{i+1}^{k-1}(x),
$$
with
$$
B\_i^0(x)=\begin{cases} 
 1 & x\in [t\_i;t\_{i+1}) \\
 0 & \text{otherwise }
 \end{cases}
$$
Of particular interest would be the case of $\mu=0, \sigma=1$.


I am aware of the [Gauss-Hermite quadrature](https://en.wikipedia.org/wiki/Gauss%E2%80%93Hermite_quadrature) :
$$
\int\_{-\infty}^{+\infty}f(x)e^{-\frac{x^2}{2}}\approx \sum\_{i=1}^n w\_i f(x\_i),
$$
where $x\_i$ are the roots of a Hermite polynomial of order $n$ and $w\_i$ are the associated weights. ***Importantly, the approximation sign can be replaced by an exact equality when $f$ is a polynomial of degree $\leq 2n-1$***. (There are versions where the integral is with respect to $e^{-x^2}$ instead of $e^{-\frac{x^2}{2}}$, by changing the type of Hermite polynomial employed).


My question is : is there such an **exact** equality formula for B-spline basis functions?
I am looking to express the integral at the beginning of this question as a sum analogously to the Gauss-Hermite quadrature.


The problem seems to be that even though $B\_i^k$ is known to have finite support, it is not itself a polynomial: each of the restrictions $B\_i^k|\_{(t\_j;t\_{j+1})}$ is a polynomial, without the full function being a polynomial. Otherwise, the answer would have been a trivial application of the Gauss-Hermite quadrature. Is is possible that there is a Gauss-Hermite-type quadrature for integration domains that are compact intervals (as opposed to integration domains that are $\mathbb{R}$) ?



Integrating a B-Spline basis function with respect to the standard normal PDF
Since a B-spline is a piecewise polynomial function, the question is whether there exists an exact equality formula for the integral $\int\_{-a}^{b}u^pe^{-u^2/2}du$. This integral equals an elementary function of $a$ and $b$ for $p$ an odd integer, while for $p$ an even integer it contains error functions. In general the B-spline will contain both even and odd powers, so no "exact equality formula" in terms of elementary functions will be forthcoming.


For example, the [uniform B-spline](https://en.wikipedia.org/wiki/B-spline#Properties) of order 3 with knots at 0,1,2,3 is given by
$$B(u)=\begin{cases}
0&\text{if}\;\; u<0,\\
u^2/2&\text{if}\;\; 0 \le u < 1,\\
(-2u^2+6u-3)/2&\text{if}\;\; 1 \le u < 2,\\
(3-u)^2/2&\text{if}\;\; 2 \le u < 3,\\
0&\text{if}\;\; u\ge 3,
\end{cases}$$
and the integral $\int\_{-\infty}^\infty B(u)e^{-u^2/2}\,du$ equals
$$\frac{1}{2} \sqrt{\frac{\pi }{2}} \left(6 \,\text{erf}\left(\frac{1}{\sqrt{2}}\right)+10 \,\text{erf}\left(\frac{3}{\sqrt{2}}\right)-15\, \text{erf}\left(\sqrt{2}\right)\right)+\frac{3 \left(1-2 e^{5/2}+e^4\right)}{2e^{9/2}}.$$
No further simplification in terms of elementary functions is possible.
