# What's the fastest way to get an exact value for a product of (powers of polynomials)?

Suppose we have two integers $a$ and $b$. Also, suppose we have polynomials in $x$, $p_k(x)$. Finally, suppose we have a sequence of integers, where an integer in the sequence is denoted by $c_k$.

What's the fastest way to get an exact value for $\int_a^b{\left(\displaystyle \prod_k{\left(p_k(x)\right)^{c_k}}\right) dx}$, with the $c_k$s large?

This is a more complicated version of this question. Perhaps "What's the fastest way to get an exact value for integrate a power of a polynomial?" may help with ideas.

-
I'd forget about the integral for a moment. And deal with the problem as computing the polynomial $$R(x) = \displaystyle \prod_k{\left(p_k(x)\right)^{c_k}}$$ which you can do using evaluation-then-interpolation. Afterwords, a definite integration of $R(x)$ should be straightforward operation. – user2468 Feb 19 '12 at 16:14
I'd first try the question when all $c_k=1$, or when the number of polynomials is $1$ and $c_1>1$. – Thomas Andrews Feb 19 '12 at 16:15
There's now a link to the easier version. – Matt Groff Feb 19 '12 at 16:40

I'd forget about the integral for a moment. And deal with the problem as computing the polynomial $$R(x) = \displaystyle \prod_k{\left(p_k(x)\right)^{c_k}}$$ which you can do using evaluation-then-interpolation (e.g. my other answer). Afterwords, a definite integration of $R(x)$ should be straightforward operation.
Another approach to compute $R(x)$ is to consider the following Jordan block matrix: $$A = \begin{pmatrix} C(p_1(x)^{c_1}) && 0 && \ldots && 0 \\ 0 && C(p_2(x)^{c_2}) && 0 && \ldots && 0 \\ 0 && \ldots && \ldots && \ldots && \\ 0 && \ldots && 0 && \ldots && C(p_n(x)^{c_n}) \end{pmatrix}$$ where $C(p_k(x)^{c_k})$ is the block companion matrix of $p_k(x)$. Then $R(x) = \operatorname{charpoly}(A)$ which can be computed using fast linear algebra methods.