$I_k=\int_0^1 \frac{1}{\mathbf{B}(\alpha , \beta )} \cos^k (\pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta -1}d\theta $

let $\alpha>0$ , $\beta>0$ , $k\in \{1,2,\cdots \}$ and $\mathbf{B}(\alpha , \beta )=\frac{\Gamma (\alpha ) \Gamma (\beta)}{\Gamma (\alpha + \beta )}$.

Q1:how can we solve following integrals: $$I_k(\alpha , \beta)=\int_0^1 \frac{1}{\mathbf{B}(\alpha , \beta )} \cos^k (\pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta -1}d\theta $$

$$J_k(\alpha , \beta)=\int_{0}^{1} \frac{1}{\mathbf{B}(\alpha , \beta )} \sin^k (\pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta -1}d\theta$$

My try for $k=1$ (using Taylor series ):

\begin{eqnarray*} I_1(\alpha , \beta)&=& \int_{0}^{1} \frac{1}{\mathbf{B}(\alpha , \beta)} \cos (\pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \int_{0}^{1} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(\pi \theta)^{2n} \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ & \overset{DominatedCT}{=}& \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(\pi )^{2n} \int_{0}^{1} \theta^{2n+\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(\pi )^{2n} \mathbf{B}(2n+\alpha ,\beta) \\ &=& \frac{\Gamma (\alpha + \beta )}{\Gamma (\alpha )} \sum_{n=0}^{\infty }\frac{(-1)^n}{(2n)!}(\pi )^{2n} \frac{\Gamma (2n+\alpha )}{\Gamma (2n+\alpha+ \beta )} \\ &=& 1+\sum_{n=1}^{\infty }\frac{(-1)^n}{(2n)!}(\pi )^{2n} \frac{(2n+\alpha-1 )(2n+\alpha-2)\cdots (\alpha )}{(2n+\alpha+ \beta -1 )(2n+\alpha+ \beta -2 ) \cdots (\alpha+ \beta ) } \\ &=& 1+\sum_{n=1}^{\infty }\frac{(-1)^n}{(2n)!}(\pi )^{2n} \prod_{r=0}^{2n-1} \frac{\alpha +r}{\alpha +\beta +r} \end{eqnarray*}

I can use Taylor series of $\cos^k(\pi \theta)$ but I want a closed form for $I_1(\alpha , \beta)$ and $I_2(\alpha , \beta)$. that is, I need to solve the summation above.

Q2:is there a better way?

I searched a little but i got nothing.

\begin{eqnarray} I_2(\alpha , \beta)&=& \int_{0}^{1} \frac{1}{\mathbf{B}(\alpha , \beta)} \cos^2 (\pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \int_{0}^{1} \left( 1+ \sum_{n=1}^{\infty}\frac{(-1)^n}{2(2n)!}(2\pi \theta)^{2n} \right) \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \\ &=& 1+\frac{1}{2 \mathbf{B}(\alpha , \beta)} \int_{0}^{1} \sum_{n=1}^{\infty}\frac{(-1)^n}{(2n)!}(2\pi )^{2n} \int_{0}^{1} \theta^{2n+\alpha -1} (1-\theta)^{\beta -1} d\theta \\ &=& 1+\frac{1}{2 \mathbf{B}(\alpha , \beta)} \sum_{n=1}^{\infty}\frac{(-1)^n}{(2n)!}(2\pi )^{2n} \mathbf{B}(2n+\alpha ,\beta) \\ &=& 1+\frac{1}{2} \sum_{n=1}^{\infty}\frac{(-1)^n}{(2n)!}(2\pi )^{2n} \prod_{r=0}^{2n-1} \frac{\alpha +r}{\alpha +\beta +r} \end{eqnarray}

I found a better way to calculate $I_k(\alpha , \beta )$ and $J_k(\alpha , \beta )$ by reducing power.

define

\begin{eqnarray} I^{(m)}(\alpha , \beta)&=&\int_0^{1} \frac{1}{\mathbf{B}(\alpha , \beta)} \cos (m \pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(m \pi )^{2n} \int_{0}^{1} \theta^{2n+\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(m \pi )^{2n} \mathbf{B}(2n+\alpha ,\beta) \nonumber \\ &=& \frac{\Gamma(\alpha + \beta)}{\Gamma(\alpha)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(m \pi )^{2n} \frac{\Gamma(2n+\alpha )}{\Gamma(2n+\alpha+ \beta )} \nonumber \\ &=& 1+\sum_{n=1}^{\infty}\frac{(-1)^n}{(2n)!}(m \pi )^{2n} \frac{(2n+\alpha-1 )(2n+\alpha-2)\cdots (\alpha)}{(2n+\alpha+ \beta -1 )(2n+\alpha+ \beta -2 ) \cdots (\alpha+ \beta ) } \nonumber \\ &=& 1+\sum_{n=1}^{\infty }\frac{(-1)^n}{(2n)!}(m \pi )^{2n} \prod_{r=0}^{2n-1} \frac{\alpha +r}{\alpha +\beta +r} \end{eqnarray}

\begin{eqnarray} J^{(m)}(\alpha , \beta)&=&\int_0^{1} \frac{1}{\mathbf{B}(\alpha , \beta)} \sin (m \pi \theta) \theta^{\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \int_0^{1} \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \theta^{2n+1 +\alpha -1} (1-\theta)^{\beta-1} d\theta \nonumber \\ &=& \frac{1}{\mathbf{B}(\alpha , \beta)} \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \mathbf{B}(2n+1+\alpha , \beta) \nonumber \\ &=& \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \frac{ \mathbf{B}(2n+1+\alpha , \beta)}{\mathbf{B}(\alpha , \beta)} \nonumber \\ &=&\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \frac{ \Gamma (2n+1+\alpha) \Gamma(\alpha +\beta )}{\Gamma (\alpha ) \Gamma (2n+1 + \alpha +\beta ) } \nonumber \\ &=& \sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \frac{ (2n+\alpha) (2n+\alpha -1) \cdot (\alpha)}{ (2n + \alpha +\beta ) (2n + \alpha +\beta ) \cdots (\alpha +\beta )} \nonumber \\ &=&\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(m \pi )^{2n+1} \prod_{r=0}^{2n} \frac{\alpha + r}{\alpha + \beta +r} \nonumber \end{eqnarray}

so by reducing power formula

\begin{eqnarray*} \cos^2(\pi \theta)&=&\frac{1}{2} \left(1+ \cos (2\pi \theta)\right) \\ \cos^3(\pi \theta)&=&\frac{3}{4} \cos (\pi \theta)+\frac{1}{4} \cos (3 \pi \theta) \\ \sin^2(\pi \theta)&=&\frac{1}{2} \left(1- \cos (2\pi \theta)\right) \\ \sin^3(\pi \theta)&=&\frac{3}{4} \sin (\pi \theta)-\frac{1}{4} \sin (3 \pi \theta) \end{eqnarray*}

so

\begin{eqnarray*} I_2(\alpha , \beta )&=&\frac{1}{2} \left(1+ I^{(2)}(\alpha , \beta ) \right) \\ I_3(\alpha , \beta )&=&\frac{3}{4} I^{(1)}(\alpha , \beta )+\frac{1}{4} I^{(3)}(\alpha , \beta ) \\ J_2(\alpha , \beta )&=&\frac{1}{2} \left(1- I^{(2)}(\alpha , \beta )\right) \\ J_3(\alpha , \beta )&=&\frac{3}{4} J^{(1)}(\alpha , \beta )+\frac{1}{4} J^{(3)}(\alpha , \beta ) \end{eqnarray*}

work with $J^{(m)} (\alpha , \beta )$ and $J^{(m)} (\alpha , \beta )$ is much easier.

so we want formula for $J^{(m)} (\alpha , \beta )$ and $J^{(m)} (\alpha , \beta )$.

New idea:

\begin{eqnarray} I^{(m)}(a,b)&=&\frac{1}{\mathbf{B}(a,b)}\int_{0}^{1} u^{a-1} (1-u)^{b-1} \cos (m\pi u) du \nonumber \\ &=& \frac{1}{\mathbf{B}(a,b)}\int_{0}^{1} u^{a-1} (1-u)^{b-1} \frac{1}{2} (e^{i m \pi u}+e^{-i m \pi u}) du \nonumber \\ &=& \frac{1}{2} ( CF(i m \pi) +CF(i m \pi)) \nonumber \\ &=& \frac{1}{2} ( {}_1F_1(a;a+b;i m \pi)+{}_1F_1(a;a+b;-i m \pi)). \end{eqnarray} is it right? R code:

library(hypergeo)
a<<-3
b<<-4
m<<-1
IM.fn<-function(u){
ret<-cos(m*pi*u)*dbeta(u,a,b)
return(ret)
}

U<-c(a)
L<-c(a+b)
z<-(m*pi)*1i
.5*(genhypergeo(U,L,z) +genhypergeo(U,L,-z)) # 0.1953108+0i
integrate(IM.fn,lower=0,upper=1) #0.1953108 with absolute error < 4.9e-15

similarity: \begin{eqnarray*} J^{(m)}(a,b)&=&\frac{1}{\mathbf{B}(a,b)}\int_{0}^{1} u^{a-1} (1-u)^{b-1} \sin (m\pi u) du \\ &=& \frac{1}{B(a,b) }\int_{0}^{1} \frac{1}{2i}(e^{i m\pi u}-e^{- i m \pi u}) u^{a-1} (1-u)^{b-1} du \\ &=& \frac{1}{2i} (CF(im\pi)-CF(im\pi)) \\ &=& \frac{1}{2i} ({}_1F_1(a;a+b;im\pi)-{}_1F_1(a;a+b;-im\pi)) \\ &=& -\frac{1i}{2} ({}_1F_1(a;a+b;im\pi)-{}_1F_1(a;a+b;-im\pi)) \end{eqnarray*}

R code for $J^m$

 library(hypergeo)
 a<<-4
 b<<-3
 m<<-5
 #
 fn<-function(u){
 ret<-sin(m*pi*u)*dbeta(u,a,b)
 return(ret)
 }
 ## 1F1
 U<-c(a)
 L<-c(a+b)
 z<-(m*pi)*1i
 -((1i)/2)*(genhypergeo(U,L,z) -genhypergeo(U,L,-z))
 integrate(fn,lower=0,upper=1,abs.tol=1.7e-10)
 #output
 #> -((1i)/2)*(genhypergeo(U,L,z) -genhypergeo(U,L,-z))
 #[1] -0.02945569+0i
 #> integrate(fn,lower=0,upper=1,abs.tol=1.7e-10)
 #-0.02945569 with absolute error < 1.9e-12

Solution 1:

added superscript form according to Maple. It seems these work even when $m$ is not an integer. $$ I^{(m)}(a,b) ={}_2F_3\left( \frac{a}{2},\frac{a+1}{2}; \frac{1}{2},\frac{a+b}{2},\frac{a+b+1}{2}; \frac{-m^2\pi^2}{4}\right) \\ J^{(m)}(a,b) = \frac{m \pi}{a+b}\;{}_2F_3\left( \frac{a+1}{2},\frac{a+2}{2}; \frac{3}{2},\frac{a+b+1}{2},\frac{a+b+2}{2}; \frac{-m^2\pi^2}{4} \right) $$