# Problems with a Definite Integral Resulting in the Hypergeometric Function

I am attempting to find $$\int_{a}^{b}(\cos^n{x} )dx$$ by using $$\int(\cos^n{x}) dx=-\frac{\cos^{n+1}x}{n+1}{_2}F_1(\frac{n+1}{2},\frac{1}{2};\frac{n+3}{2};\cos^{2}x)+c.$$ However, when $a$ and $b$ are multiples of $\frac{\pi }{2}$ the integral evaluates to zero due to the term involving $\cos x$ before the hypergeometric function. I know that this shouldn't happen, for example: $$\int_{\frac{5 \pi }{2}}^{\frac{-5 \pi }{2}}(\cos^3{x} )dx = \frac{4}{3}$$ So I think that there must be some problem with the way that I am using the hypergeometric function to evaluate the integral. I found that particular integral derived at http://www.integraltec.com/math/math.php?f=cosPower.html.

Clearly I have missed something important. I'm not sure where to begin here, but after a hint I should be able to figure it out, so many thanks in advance.

For $0\leq b \leq \pi/2$, Mathematica 7.0 gives:

$$\int_{-b}^{0}\cos^n x dx=\int_0^{b}\cos^n x dx=c_n-\frac{\cos^{n+1} b}{n+1}{_2}F_1\left(\frac{n+1}{2},\frac{1}{2};\frac{n+3}{2};\cos^{2}b\right)\tag{1}$$

$$c_n=\frac{\sqrt{\pi}\Gamma((n+3)/2)}{(n+1)\Gamma(1+n/2)}\tag{2}$$

For $0\leq a,n \geq 1$, Mathematica 7.0 gives: $$\int_{-a}^{0}\sin^n x dx=d_n-\cos a\left(\frac{\sin a}{|\sin a|}\right)^{n+1}{_2}F_1\left(\frac{1-n}{2},\frac{1}{2};\frac{3}{2};\cos^{2}a\right)\tag{3}$$

$$d_n=\frac{\sqrt{\pi}\Gamma((n+1)/2)}{2\Gamma(1+n/2)}\tag{4}$$

$$\int_{0}^{a}\sin^n x dx=(-1)^n d_n+\cos a\left(\frac{-\sin a}{|\sin a|}\right)^{n-1} {_2}F_1\left(\frac{1-n}{2},\frac{1}{2};\frac{3}{2};\cos^{2}a\right)\tag{5}$$

You may use the formulas above to work out you examples.

• Are you sure that (4) and (5) are valid for all specified regions? For example, $\int_{0}^{\frac{5\pi }{2}}\sin^3 x dx=\frac{2}{3}$, while according to (5) the result is $-\frac{2}{3}$. – Condensate Jan 1 '15 at 6:14