0

NOTE: A similar question asking for the definite integral has been posted elsewhere and the answer by Christian Blatter is good for me. But my question asks how to get to the same answer starting from the indefinite expression supplied by Wolfram Alpha and has elicited some points useful to me on dealing with $\sqrt{\sin^2(x)}\csc{x}$ when $x=0$ or $2\pi$. Also shows that Wolfram Alpha may not be the best place to start from sometimes.

An expression for the indefinite integral $\int \cos^P(x)\text{ d}x$ is given by Wolfram Alpha as:- $$\int \cos^P(x) \text{ d}x=\frac{-\sqrt{\sin^2(x)}\csc(x)\cos^{P+1}(x)_2F_1\big(\frac{1}{2},\frac{P+1}{2};\frac{P+3}{2};\cos^2(x)\big)}{P+1}$$.

I wish to find an expression for the definite integral $\int_0^{2\pi}\cos^P(x)\text{ d}x$ for ($P=\text{positive even integer}$) and ($x=$ real, between $0$ and $2\pi$).

I know that, for any even positive integer $P$, the definite integral takes the form:- $$\int_0^{2\pi}\cos^P(x)\text{ d}x=Q(P)\pi$$ where $Q(P)$ is some fraction $<1$.

But clearly, if I insert $x=2\pi$ or $x=0$ into the indefinite integral expression then the term $\sqrt{\sin(x)}$ becomes zero.

Maybe I have to assume that $\sqrt{sin^2(x)}\csc(x)=1$ when $x=0\text{ or }2\pi$, even though Wolfram Alpha deems the result as undefined?

Wolfram Alpha (for me) does not even recognize the question when I ask for the definite integral: $\int^{2\pi}_0\cos^P(x)\text{ d}x$

steveOw
  • 1,061
  • 1
  • 6
  • 12
  • 2
    It is easier if you write $\cos x=\frac{e^{ix}+e^{-ix}}2,$ and you get $$\frac{2\pi}{2^{P}}\binom P{P/2}.$$ – Thomas Andrews Sep 19 '24 at 21:10
  • 1
    Wolfram Alpha's answer is because it doesn't know $P$ is an integer, requiring some nasty functions to resolve. – Thomas Andrews Sep 19 '24 at 21:11
  • 1
    Also, $\csc x$ evaluates to $+\infty$ when $x=0,\pi,$ so you can't directly evaluate that indefinite integral by substitution getting zero. Indeed, $|\sin x|\csc x=\pm1$ for all $x.$ – Thomas Andrews Sep 19 '24 at 21:13
  • @Thomas Andrews - thanks for the explanation of Wolfram Alpha! I am still digesting tyour previous suggestion :-) – steveOw Sep 19 '24 at 21:16
  • 1
    The key is that expanding $\cos^P x$ with the binomial theorem gives a lot of terms $a_ne^{inx},$ for $-P\leq n\leq P,$ and the integral there is zero except when $n=0,$ so you only need the middle term if the binomial expansion. – Thomas Andrews Sep 19 '24 at 21:18
  • @Thomas Andrews it will take my tortoise brain a long time to grapple with those complex exponentials. If you are inclined to offer an answer it would be very welcome. If not... thanks anyway! – steveOw Sep 19 '24 at 21:27
  • @Thomas Andrews - hold fire to my last request ...Anne Bauval has pointed out my question is a duplicate and the answer by Christian Blatter to the prior question seems to match what you have been explaining to me (although I havent digested it yet). But many thanks for your help. – steveOw Sep 19 '24 at 21:46
  • @Anne Bauval - many thanks for spotting the prior question and letting me know. It is indeed practically identical. I have made some edits (a note at the top) about how my question is slightly different. But if you feel it should be deleted then that would not be a big issue for me. – steveOw Sep 19 '24 at 22:07

0 Answers0