1

I need to evaluate the following integral $$\int_{0}^{\pi/2} \cos^a (x) \sin (a x) \ dx,\ \ ~\ \ a\geq 0$$

I tried the following :$$I(a):=\int_{0}^{\pi/2} \cos^a (x) \sin (a x) \ dx$$ $$I(a)=\Im\left(\int_{0}^{\pi/2} \left(\frac{e^{ix}+e^{-ix}}{2}\right)^a e^{i a x} \ dx\right) $$ $$I(a)=\Im\left(2^{-a}\int_{0}^{\pi/2} \left(1+e^{-2ix}\right)^a e^{2i a x} \ dx\right) $$ $$I(a)=\Im\left(2^{-a}\int_{0}^{\pi/2} \left(1+e^{-2ix}\right)^a e^{i (2a+2) x} \ \frac{i}{2}d(e^{-2 i x})\right) $$ $u=e^{-2ix}$ ($u$ travels clockwise along the unit circle from $1$ to $-i$ to $-1$ then Cauchy's theorem lets us deform the countour to just under the real axis from $1$ to $0$ to $-1$) $$I(a)=\Im\left(2^{-a-1}\ i \int_{1}^{-1} (1+u)^a u^{-a-1} \ du\right) $$ $$I(a)=\Im\left(2^{-a-1}\ i \int_{1}^{0} (1+u)^a u^{-a-1} \ du\right)+\Im\left(2^{-a-1}\ i \int_{0}^{-1} (1+u)^a u^{-a-1} \ du\right) $$ $$I(a)=J(a)+K(a) $$ where $$J(a)=\Im\left(2^{-a-1}\ i \int_{1}^{0} (1+u)^a u^{-a-1} \ du\right) $$ and $$K(a)=\Im\left(2^{-a-1}\ i \int_{0}^{-1} (1+u)^a u^{-a-1} \ du\right)$$ $$J(a)=-2^{-a-1}\int_{0}^{1} (1+u)^a u^{-a-1} \ du $$ In $K(a)$, substitute $u=-v$ so that $du=-dv$ $$K(a)=\Im\left(-2^{-a-1}\ i \int_{0}^{1} (1-v)^a (-v)^{-a-1} \ dv\right)$$ $$K(a)=\Im\left((-1)^{-a}\ i \ 2^{-a-1} \int_{0}^{1} (1-v)^a v^{-a-1} \ dv\right)$$ Write $-1=e^{-i\pi}$ and $i=e^{i\pi/2}$ $$K(a)=\Im\left(e^{i\pi (a+1/2)} \ 2^{-a-1} \int_{0}^{1} (1-v)^a v^{-a-1} \ dv\right)$$ $$K(a)=\sin(\pi (a+1/2)) \ 2^{-a-1} \int_{0}^{1} (1-v)^a v^{-a-1} \ dv$$ $$K(a)=\cos(\pi a) \ 2^{-a-1} \int_{0}^{1} (1-v)^a v^{-a-1} \ dv$$ So by the definition of Beta function $$K(a)=\cos(\pi a) \ 2^{-a-1} \Gamma(a+1)\Gamma(-a)$$ By reflection formula of Gamma function $$K(a)=-\cos(\pi a) \ 2^{-a-1} \frac{\pi}{\sin \pi a}$$

MathFail
  • 21,128
Max
  • 536
  • 1
    Suppose $a>0$ and not be an integer, your $K(a)$ converges, but your $J(a)$ diverges. Your result is incorrect. – MathFail Jun 06 '23 at 15:09
  • @MathFail Thanks for pointing this out. Can you write an answer which I can accept? – Max Jun 06 '23 at 15:10
  • Yes, I have written an answer, hope it helps. – MathFail Jun 06 '23 at 15:11
  • @metamorphy But in the link the limits of integration are from $0$ to $\pi$, whereas in this question the limites are from $0$ to $\pi/2$ – Max Jun 07 '23 at 07:55
  • The core symmetry is different, in your link, the core part is $\sin^{a} x$, which is the essential part leading to the beta function. In this OP, the core part is $\cos^{a} x$, which leads to the eq.(2) $$I=\frac1{2^{a+1}}\int_0^1\frac{(1+t)^a-(1-t)^a}{t}~dt$$, where both parts diverge and cancel each other. If shift the integrand in your link by $\pi/2$, you will get the same core $\cos^{a} x$, but the integral limit becomes $[-\pi/2, \pi/2]$ and the odd part in $e^{ibx}$ (which is $\sin bx$) vanish and you go back to $\cos^{a} x\cos (bx)$ case, which is still the even symmetry. @metamorphy – MathFail Jun 07 '23 at 08:36
  • @MathFail: Looks like the end* of my answer there is the only visible thing ;)* – metamorphy Jun 07 '23 at 08:40
  • I saw your $F_+$ and $F_-$, their combination will give the result in my eq.(2). Eq.(2) can be further written as $$\text{P.V} \int_{-1}^1 \frac{(1-t)^a}t~dt$$ but there is no fundamental progress. I believe there is no way to further simplify them with complete gamma or beta function. So I stay with the series form :) @metamorphy – MathFail Jun 07 '23 at 08:47

2 Answers2

6

$$I=\int_{0}^{\pi/2} \cos^a (x) \sin (a x) \ dx=\Im\int_{0}^{\pi/2} \cos^a (x) e^{ia x}~dx,\ \ \ \ a\geq 0$$

Let $z=e^{ix}$, and $I=\Im K$, where

$$K=\int_{0}^{\pi/2} \cos^a (x) e^{ia x}~dx=\frac1{2^a i}\int_{C_1}\left(\frac{1+z^2}{z}\right)^a\cdot\frac{z^a}{z}~dz$$

Define $$f(z)=\left(\frac{1+z^2}{z}\right)^a\cdot z^a$$

We use the following contour:

enter image description here

take the branch cut as shown in the figure.

$$\arg(z-i)\in (-\pi,\pi],~~~\arg(z)\in (-\pi,\pi],~~~\arg(z+i)\in (-\pi,\pi]$$

therefore,

$$\begin{align}\arg f&=a\left[\arg(z+i)+\arg(z-i)-\arg(z)\right]+a\arg(z)=a\left[\arg(z+i)+\arg(z-i)\right]\end{align}$$

we have

$$\frac1{2^a i}\int_{C_1}\frac{f(z)}z~dz+\frac1{2^a i}\int_{C_2}\frac{f(z)}z~dz+\cdots+\frac1{2^a i}\int_{C_5}\frac{f(z)}z~dz=0$$

The integral vanishes on $C_2$. On $C_4$, we have

$$\frac1{2^a i}\int_{C_4}\frac{f(z)}z~dz=\frac1{2^a i}\cdot \frac{-2\pi i}4 Res(z=0)=-\frac{\pi}{2^{a+1}}$$ On $C_3$, we have $\arg f=0+0=0$, $z=r e^{i\frac\pi2}$

$$\frac1{2^a i}\int_{C_3}\frac{f(z)}z~dz=\frac1{2^a i}\int_1^0\frac{(1-r^2)^a}{r}~dr=\frac i{2^a}\int_0^1\frac{(1-r^2)^a}{r}~dr$$

enter image description here On $C_5$, we have $\arg f=\beta+(-\beta)=0$, $z=r e^{i\cdot0}$

$$\frac1{2^a i}\int_{C_5}\frac{f(z)}z~dz=\frac1{2^a i}\int_0^1\frac{(1+r^2)^a}{r}~dr=-\frac i{2^a}\int_0^1\frac{(1+r^2)^a}{r}~dr$$

Therefore,

$$K+0+\frac i{2^a}\int_0^1\frac{(1-r^2)^a}{r}~dr-\frac{\pi}{2^{a+1}}-\frac i{2^a}\int_0^1\frac{(1+r^2)^a}{r}~dr=0\tag{1}$$ and

$$I=\Im K=\frac1{2^a}\int_0^1\frac{(1+r^2)^a}{r}~dr-\frac1{2^a}\int_0^1\frac{(1-r^2)^a}{r}~dr$$

Let $t=r^2$

$$I=\frac1{2^{a+1}}\int_0^1\frac{(1+t)^a-(1-t)^a}{t}~dt\tag{2}$$

Use binomial series expansion, $$I=\frac1{2^{a+1}}\int_0^1\frac1t\left(\sum_{k=0}^\infty\binom ak t^k-\sum_{k=0}^\infty \binom ak (-1)^kt^k\right)~dt$$

Even terms cancel out, we get

$$\begin{align}I&=\frac1{2^{a+1}}\int_0^1 \frac1t\cdot2\sum_{m=0}^\infty\binom{a}{2m+1} t^{2m+1}~dt=\frac1{2^{a}}\sum_{m=0}^\infty\binom{a}{2m+1}\int_0^1 t^{2m}~dt\end{align}$$

therefore,

$$\boxed{\int_{0}^{\pi/2} \cos^a (x) \sin (a x) \ dx=\frac1{2^{a}}\sum_{m=0}^\infty\frac1{2m+1}\binom{a}{2m+1}}$$

Numerically verified by Wolfram as below,

enter image description here


Byproduct

For eq.(1), if we take real part,

$$\Re K=\frac{\pi}{2^{a+1}}$$

we get the byproduct

$$\boxed{\int_{0}^{\pi/2} \cos^a (x) \cos (a x) \ dx=\frac{\pi}{2^{a+1}}}$$

MathFail
  • 21,128
  • Thanks a lot. $+1$. Can you please simplify the sum a bit. – Max Jun 06 '23 at 15:11
  • I use Wolfram to take the sum, but it only gives hypergeometric functions, so I suspect it can be further simplified, since $a$ is not an integer. Wolfram gives $$\sum_{m=0}^\infty\frac1{2m+1}\binom{a}{2m+1}=a\cdot\text{HypergeometricPFQ}\left[{\frac12, \frac{1-a}2, 1 -\frac a2}, {\frac32, \frac32}, 1\right]$$ – MathFail Jun 06 '23 at 15:12
  • Thanks a lot. I was expecting some simpler function like Gamma for instance see https://math.stackexchange.com/questions/456899/integrating-int-0-pi-2-cosax-cosbx-dx – Max Jun 06 '23 at 15:21
  • 1
    Note that they are very different, because the post you linked is an even function, but your OP is odd function. This is the intrinsic difference. For odd function, we can't use symmetry to mirror it to the symmetric intervals, hence usually odd functions are harder and the result is more nasty than even functions. An good comparison is $$\int_0^\infty \frac{\cos x}{1+x^2}dx~\text{vs}~\int_0^\infty \frac{\sin x}{1+x^2}dx$$ – MathFail Jun 06 '23 at 15:25
  • Ok thanks. But still see if you could simplify the sum. I will wait for your edit. – Max Jun 06 '23 at 15:29
  • I add the byproduct for the even function as you linked. For this OP, you can express the integral as incomplete beta function, but I think the summation form is better than incomplete beta function. – MathFail Jun 06 '23 at 16:03
  • Ok thank you a lot – Max Jun 06 '23 at 16:28
  • What made you choose all the arguments to be in the interval $(-\pi, \pi]$? If the two branch cuts lie on the imaginary axis where one goes upward and one goes downward, shouldn't $-\pi/2 < \text{arg}(z+i) \leq 3\pi/2$ and $-3\pi/2 \leq \text{arg}(z-i) < \pi/2$? – Accelerator Jun 07 '23 at 09:23
  • The choice of argument angle is arbitrary, I did this way since I want the combined argument angle for function $f$ on $C_3$ and $C_5$ to be zero. @Accelerator – MathFail Jun 07 '23 at 09:28
  • @MathFail I wonder if we can get the hypergeometric representation directly from the integral itself and using the Euler integral formula for the hypergeometrics after the transformation $\cos(x)=t$. I tried this myself but didn't make much progress. – K.defaoite Jun 07 '23 at 14:12
  • It would be really helpful if you would write the summands in terms of Gamma function. – Max Jun 07 '23 at 17:23
  • It is NOT every integral finally goes to gamma function. Why do you think this integral will give gamma function? @Max – MathFail Jun 07 '23 at 17:42
  • @Mathfail I am telling the SUMMAND not the sum. Sorry to confuse you. – Max Jun 07 '23 at 17:49
  • @Max The result can be written as $$\frac1{a+1}\sum_{m=0}^\infty \frac{1}{(2m+1)B(2m+2,a-2m)}$$ Do you mean this? where $B$ is beta function. – MathFail Jun 07 '23 at 18:09
  • Thanks. But I think you missed $2^{-a}$? – Max Jun 07 '23 at 18:18
  • 3
    @Max Dude... don't you think it's rude to keep asking the answerer to rewrite their answer? If the final answer can be written as a Gamma function, then awesome, but you never seemed to ask for that in your original post. – Accelerator Jun 07 '23 at 18:21
  • 1
    Yes, I mean the summand part. You put that extra factor $2^{-a}$ for the complete result. @Max – MathFail Jun 07 '23 at 18:28
  • One last question. Is the Beta function well defined here? Because in$B(2m+2,a-2m)$ for $a\geq 0$ and $m\geq1$, $a-2m$ can be negative? – Max Jun 07 '23 at 18:44
  • You need to learn analytical continuation to answer this. – MathFail Jun 07 '23 at 20:04
  • 1
    Your question doesn't hold at all. In your own work of your OP, you applied beta function, gamma function, and Euler's reflection formula, especially you used the $\Gamma(-a)$. Note that here the component is negative inside the Gamma function. If you never know how is the function well defined there, why can you apply those formulas in your own work? I agree with "Accelerator" that you should stop to keep asking these inconsistent questions. You can take any textbook for complex analysis and learn these basic concepts. @Max –  Jun 08 '23 at 08:19
0

$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{{\displaystyle #1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\on}[1]{\operatorname{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\sr}[2]{\,\,\,\stackrel{{#1}}{{#2}}\,\,\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} & \color{#44f}{\left.\int_{0}^{\pi/2}\cos^{a}\pars{x}\sin\pars{ax} \,\dd x\right\vert_{a\ >\ 0}} = \Im\int_{0}^{\pi/2}\cos^{a}\pars{x}\expo{\ic ax}\dd x \\[5mm] = & \ \left.\Im\int_{x\ =\ 0}^{x\ =\ \pi/2}\pars{z + 1/z \over 2}^{a}z^{a}\, {\dd z \over \ic z}\right\vert_{z\ \equiv\ \exp\pars{\ic x}} \\[5mm] = & \ \left.-\,{1 \over 2^{a}}\,\Re\int_{x\ =\ 0}^{x\ =\ \pi/2} {\pars{1 + z^{2}}^{a} \over z} \dd z\right\vert_{z\ \equiv\ \exp\pars{\ic x}} \end{align} I'll "close" the integration along a quarter circle in the complex plane first quadrant $\pars{~\mbox{with an indent around}\ \ds{z = 0}~}$. Namely, \begin{align} & \color{#44f}{\left.\int_{0}^{\pi/2}\cos^{a}\pars{x}\sin\pars{ax} \,\dd x\right\vert_{a\ >\ 0}} \\[5mm] \sr{{\rm as}\ \epsilon\ \to\ 0^{+}}{\sim} & \ {1 \over 2^{a}}\,\Re\int_{1}^{\epsilon} {\pars{1 - y^{2}}^{a} \over \ic y}\ic\dd y + {1 \over 2^{a}}\int_{\epsilon}^{1} {\pars{1 + x^{2}}^{a} \over x}\dd x \\[5mm] \sr{{\rm as}\ \epsilon\ \to\ 0^{+}}{\LARGE\to} & \ {1 \over 2^{a}}\int_{0}^{1} {\pars{1 + x^{2}}^{a} - \pars{1 - x^{2}}^{a} \over x}\dd x \\[5mm] \sr{x^{2}\ \mapsto\ x}{=} & \ {1 \over 2^{a + 1}}\int_{0}^{1} {\pars{1 + x}^{a} - \pars{1 - x}^{a} \over x}\dd x \\[5mm] = & \ \bbx{\color{#44f}{{1 \over 2^{a}}\sum_{n = 0}^{\infty} {a \choose 2n + 1}{1 \over 2n + 1}}} \\ & \end{align}

Felix Marin
  • 89,464
  • How do you choose the branch cut? $(1+z^2)^a$ may give extra phase factor for different choices of branches. –  Jun 07 '23 at 22:03
  • @GGplay The principal branch-cut, as usual. – Felix Marin Jun 08 '23 at 02:59
  • Thank you for the answer. How do we define $a \choose 2n + 1$ where $a\geq 0$ is a real number. – Max Jun 08 '23 at 03:21
  • There are three branch points, how do you choose the cut for each of them? You haven't drawn the cut line yet, how can you say you choose the principle branch? @FelixMarin –  Jun 08 '23 at 08:11
  • In your own work of your OP, you applied beta function, gamma function, and Euler's reflection formula, especially you used the $\Gamma(-a)$ and $\Gamma(1-a)$, where $a$ is real positive number. If you don't know how are they defined, why can you applied them in your own work? Since they are all related to the binomial coefficients. @Max –  Jun 08 '23 at 08:28