I wish to find the value of the integral
$$
\int_0^1 x^n \prod_{i=1}^q(a_i-x)^{m_i} dx,
$$
where $n,m_i,q$ are positive integers and $a_i \geq 1$ for all $i$.
I am hoping at the end to find a computationally less demanding formula.
I tried to expanding the product of powers following @Jonas to arrive at an expression without integration. But... it is a costly product of summations that I don't see how to convert back to a product of powers because of the denominator in terms of $r_i$: \begin{align} \int_0^1 & x^n \prod_{i=1}^q (a_i-x)^{m_i} dx \\ &= \int_0^1 x^n \prod_{i=1}^q \sum_{r=0}^{m_i} \binom{m_i} r a_i^{r} (-x)^{m_i-r}dx \\ &=\int_0^1 x^n \sum_{r_1=0}^{m_1} \binom {m_1}{r_1} {a_1}^{r_1} (-x)^{m_1-r_1}\cdots\sum_{r_q=0}^{m_q} \binom {m_q} {r_q} {a_q}^{r_q} (-x)^{m_q-r_q} dx \\ & =\int_0^1 \sum_{r_1=0}^{m_1} \binom {m_1}{r_1} {a_1}^{r_1}{(-1)^{m_1-r_1}}\cdots\sum_{r_q=0}^{m_q} \binom {m_q} {r_q} {a_q}^{r_q}{(-1)^{m_q-r_q}} x^{n+\sum_{i=1}^qm_i-\sum_{i=1}^qr_i} dx \\ &=\sum_{r_1=0}^{m_1} \binom {m_1}{r_1} {a_1}^{r_1}{(-1)^{m_1-r_1}}\cdots\sum_{r_q=0}^{m_q} \binom {m_q} {r_q} {a_q}^{r_q}{(-1)^{m_q-r_q}}\int_0^1 x^{n+\sum_{i=1}^qm_i-\sum_{i=1}^qr_i} dx \\ &=\sum_{r_1=0}^{m_1} \cdots \sum_{r_q=0}^{m_q} \binom {m_1}{r_1} \cdots \binom {m_q} {r_q} \frac {{(-1)^{\sum_{i=1}^qm_i-\sum_{i=1}^qr_i}} a_1^{r_1} \cdots a_q^{r_q} }{{n+1+\sum_{i=1}^qm_i-\sum_{i=1}^qr_i}}. \end{align}
Due to the number of terms $m_1\cdots m_q$, it seems computationally infeasible to carry out this sum directly. I was hoping to obtain a nice answer as in Why $\int_0^1(1-x^4)^{2016}dx=\prod_{j=1}^{2016}\left(1-\frac1{4j}\right)$?. Any hints in this direction, or arguments why no nice expression exists will be appreciated!