# formula that can be used to integrate powers of log-sin

I found a formula which, upon differentiating, can be used to evaluate various powers of log-sine or log-cos integrals.

$\displaystyle I(a,p)=\int_{0}^{\frac{\pi}{2}}x\cos^{p-1}(x)\sin(ax)dx$

$=\displaystyle\frac{\pi}{2^{p+1}}\Gamma(p)\left(\frac{\psi(\frac{p+a+1}{2})-\psi(\frac{p-a+1}{2})}{\Gamma(\frac{p+a+1}{2})\Gamma(\frac{p-a+1}{2})}\right); \;\ p>0, \;\ |a|<|p+1|$

For example, this can be differentiated w.r.t $a$, set $a=0$, then differentiate w.r.t $p$, then the result

$\displaystyle\int_{0}^{\frac{\pi}{2}}x^{2}\ln^{2}(2\cos(x))dx=\frac{11{\pi}^{5}}{1440}$

is obtained.

My question is, how can the above formula be derived. I realize it looks nasty, but may not be as bad as it appears. It would seem the trig version of the Beta function could be applied, but that $ax$ in the $\sin$ throws me off. The digammas in the solution make it seem as if some differentiating of the Gamma function has been done. Does anyone have any ideas how to evaluate the above integral to that result? I know some here, like Sasha and Robjohn, are very adept at using the digamma, so I thought perhaps this problem would be of interest. I ran a few examples, and it does work. The differentiation is a little tedious, though, depending on the power one wants to integrate.

I had a thought. For what it's worth. Maybe the identity:

$\displaystyle\frac{1}{\pi}\int_{0}^{\pi}\left(2\cos(t/2)\right)^{x}\cos(ty)dt=\frac{\Gamma(x+1)}{\Gamma(\frac{x}{2}+y+1)\Gamma(\frac{x}{2}-y+1)}$ could be applied with $x=p-1$ and $y=a/2$. It looks like it may be promising. :)

-
In your right hand side of the above equality, "a" (appeared in the left hand side) is missing, so maybe some typoes. – ougao Dec 14 '12 at 21:45
and you have not given the meaning of the $\psi$ function appeared in your first formula. – ougao Dec 14 '12 at 21:49
and have your checked your first formula for $p=1$? – ougao Dec 14 '12 at 21:51
Did you try to differentiate your last equation with respect to $y$? – Fabian Dec 14 '12 at 22:05
Thank you all very much. I managed to get it. Yes, I did differentiate w.r.t y. – Cody Dec 14 '12 at 23:08