Numerical integration of $\sin(p_{m})$ and $\cos(p_{m})$ for a polynomial $p_{m}$ I was wondering if anyone knew about any numerical methods specifically designed for integrating functions of the form $\sin(p_{m})$ and $\cos(p_{m})$ where $p_{m}$ is a polynomial of degree $m$. I don't think $m$ will be too large in the application, but it will probably be at least $4$. I was reading this thread about Laplace's method but I'm not really sure that's what I want.

I think you can use Gaussian quadrature with weight functions $w(x)=\sin(p_m)$ and $w(x)=\cos(p_m)$. For any weight function there is a family of orthogonal polynomials related to that function in $[a,b]$. This family can be obtained by Gram-Schmidt orthogonalization process on $1,x,x^2,\ldots,x^n$.
Let $w(x)$ be a weight function in $[a,b]$ and $\{p_0,p_1,\ldots,p_n\}$ be a family of orthogonal polynomials with degree of $p_k=k$. Let $x_1,x_2,\ldots,x_n$ be the roots of $p_n(x)$ and
$$
L_i(x)=\prod_{j=1, j\ne i}^{n}{\frac{x-x_j}{x_i-x_j}}
$$
be the Lagrange polynomials of these roots. Then the Gaussian quadrature is defined by
$$
\int_a^b{w(x)f(x)dx}\approx \sum_{i=1}^{n}{w_i f(x_i)}=\sum_{i=1}^{n}{\left(\int_a^b{w(x)L_i(x)dx} \right) f(x_i)}
$$
The above formula is exact for all polynomials of degree $\le 2n-1$. This is better than Newton-Cotes formulas since the $(n+1)$ points Newton-Cotes rule is exact for polynomials of degree $\le n$ ($n$ odd) or $\le (n+1)$ ($n$ even).
