Calculate the following integral $\int_0^{\pi/2} \frac{\sin^m x\,\mathrm{d}x}{\sin x + \cos x}$, $m=2k-1$

I intend to develop some of N3buchadnezzar's ideas and correct some changes of sign which he has lost. The result will generalize the calculations that user17762 and Arbias Hashani have started.

From the definition of the $\Gamma$ function and a change of variable I get that \begin{equation*} \Gamma(\alpha) = \int_{0}^{\infty}x^{\alpha -1}e^{-x}\, dx = 2 \int_{0}^{\infty}x^{2\alpha -1}e^{-x^{2}}\, dx \end{equation*} where $\alpha>0$.

Let $D$ be a notation for the first quadrant. If I change to polar coordinates I get \begin{gather*} \Gamma(\alpha)\Gamma(\beta) = 4\iint_{D}x^{2\alpha-1}y^{2\beta-1}e^{-x^{2}-y^{2}}\, dxdy =\\ 2\int_{0}^{\pi^/2}\cos^{2\alpha-1}(\theta)\sin^{2\beta-1}(\theta)\, d\theta \cdot 2\int_{0}^{\infty}r^{2a+2\beta-1}e^{-r^{2}}\, dr = \\2\Gamma(\alpha+\beta)\cdot \int_{0}^{\pi^/2}\cos^{2\alpha-1}(\theta)\sin^{2\beta-1}(\theta)\, d\theta. \end{gather*} Consequently \begin{equation*} \int_{0}^{\pi^/2}\cos^{2\alpha-1}(\theta)\sin^{2\beta-1}(\theta)\, d\theta = \dfrac{\Gamma(\alpha)\Gamma(\beta)}{2\Gamma(\alpha+\beta)} = \dfrac{1}{2}B(\alpha,\beta)\quad\text{ if } \alpha>0, \beta >0 \tag{1} \end{equation*} where $B$ is the Beta function. However I will not use it.(cf. N3buchadnezzar.)

Put \begin{equation*} I_k = \int_{0}^{\pi/2}\dfrac{\sin^{2k-1}(x)}{\sin(x) + \cos(x)}\, dx , \quad k\in \mathbb{N}. \end{equation*} By symmetry \begin{equation*} I_k = \dfrac{1}{2}\int_{0}^{\pi/2}\dfrac{\cos^{2k-1}(x) +\sin^{2k-1}(x)}{\cos(x) + \sin(x)}\, dx. \end{equation*} In the formula \begin{equation*} \dfrac{a^{2k-1} + b^{2k-1}}{a+b} =\sum_{j=1}^{k}a^{2k-2j}b^{2j-2} - \sum_{j=1}^{k-1}a^{2k-2j-1}b^{2j-1}. \tag{2} \end{equation*} I have collected all positive terms and all negative terms into two separate sums. (cf. N3buchadnezzar.) According to (1) and (2) I get that \begin{gather*} I_k = \dfrac{1}{2}\sum_{j=1}^{k}\int_{0}^{\pi/2}\cos^{2k-2j}(x)\sin^{2j-2}(x)\, dx - \dfrac{1}{2}\sum_{j=1}^{k-1}\int_{0}^{\pi/2}\cos^{2k-2j-1}(x)\sin^{2j-1}(x)\, dx = \notag\\[2ex] \dfrac{1}{4}\sum_{j=1}^{k}\dfrac{\Gamma(k-j + \frac{1}{2})\Gamma(j-\frac{1}{2})}{\Gamma(k)}-\dfrac{1}{4}\sum_{j=1}^{k-1}\dfrac{\Gamma(k-j)\Gamma(j)}{\Gamma(k)} = \notag\\[2ex] \dfrac{1}{4(k-1)!}\left(\sum_{j=1}^{k}\Gamma(k-j + \frac{1}{2})\Gamma(j-\frac{1}{2}) - \sum_{j=1}^{k-1}(k-j-1)!(j-1)!\right). \tag{3} \end{gather*} But \begin{equation*} \Gamma(n+\dfrac{1}{2}) = \dfrac{(2n-1)!!}{2^{n}}\sqrt{\pi}= \dfrac{(2n)!}{4^{n}n!}\sqrt{\pi}\quad \text{ if } n\in \mathbb{N}. \end{equation*} Thus \begin{equation*} \Gamma(k-j + \frac{1}{2})\Gamma(j-\frac{1}{2}) = \dfrac{(2k-2j)!}{4^{k-j}(k-j)!}\sqrt{\pi}\cdot\dfrac{(2j-2)!}{4^{j-1}(j-1)!}\sqrt{\pi} = \dfrac{(2k-2j)!(2j-2)!}{4^{k-1}(k-j)!(j-1)!}\pi. \end{equation*} Now I can write (3) as \begin{equation*} I_k = \dfrac{\pi}{4^{k}(k-1)!}\sum_{j=1}^{k}\dfrac{(2k-2j)!(2j-2)!}{(k-j)!(j-1)!} - \dfrac{1}{4(k-1)!}\sum_{j=1}^{k-1}(k-j-1)!(j-1)!. \end{equation*}

Remark. Calculations by user17762 indicate that an even $m$ will give the integral \begin{equation*} \int_{0}^{\pi/2}\dfrac{\sin^{m}x}{\sin x + \cos x}\, dx \end{equation*} another character than an odd $m$.

With $m=2k$ I can split the integral into two integrals. The first one of them is easily calculated e.g. via $ t = \tan\dfrac{x}{2}$. The second integral is a little more intricate. \begin{gather*} \int_{0}^{\pi/2}\dfrac{\sin^{2k}x}{\sin x + \cos x}\, dx = 2^{-k}\int_{0}^{\pi/2}\dfrac{1}{\cos x + \sin x}\, dx + \int_{0}^{\pi/2}\dfrac{\sin^{2k}x - 2^{-k}}{\cos x + \sin x}\, dx=\\[2ex] 2^{-k}\sqrt{2}\ln(\sqrt{2}+1) + 2^{-k}k!\sum_{j=1}^{\lfloor{k/2}\rfloor}\sum_{l=0}^{2j-1}\dfrac{(-2)^{l}}{j\cdot(2l+1)\cdot l!(k-2j)!(2j-l-1)!}. \end{gather*} To verify the double sum I have to do some calculations. At first I rewrite the numerator in the integrand. \begin{equation*} \sin^{2k}x - 2^{-k} = 2^{-k}(1-\cos 2x)^{k}-2^{-k} = 2^{-k}\sum_{j=1}^{k}\binom{k}{j}(-1)^{j}\cos^{j}(2x). \end{equation*} Since $\cos 2x = \cos^{2}x - \sin^{2}x$ the integrand can be rewritten as \begin{equation*} \dfrac{\sin^{2k}x - 2^{-k}}{\cos x + \sin x} = 2^{-k}\sum_{j=1}^{k}\binom{k}{j}(-1)^{j}\cos^{j-1}(2x)(\cos x - \sin x). \end{equation*} The change of variable $x = \dfrac{\pi}{2}-t$ proves that \begin{equation*} \int_{0}^{\pi/2}\cos^{j-1}(2x)(\cos x - \sin x)\, dx = 0 \end{equation*} if $j$ is odd and also that \begin{equation*} \int_{0}^{\pi/2}\cos^{j-1}(2x)\cos x\, dx = -\int_{0}^{\pi/2}\cos^{j-1}(2x)\sin x\, dx. \end{equation*} if $j$ is even. Consequently \begin{equation*} \int_{0}^{\pi/2}\dfrac{\sin^{2k}x - 2^{-k}}{\cos x + \sin x}\, dx = 2^{1-k}\sum_{j=1}^{\lfloor{k/2}\rfloor}\binom{k}{2j}\int_{0}^{\pi/2}\cos^{2j-1}(2x)\cos x\, dx.\tag {4} \end{equation*} Futhermore \begin{equation*} \cos^{2j-1}(2x)\cos x = (1-2\sin^{2}x)^{2j-1}\cos x = \sum_{l=0}^{2j-1}\binom{2j-1}{l}(-2)^{l}\sin^{2l}(x)\cos x. \end{equation*} Thus \begin{equation*} \int_{0}^{\pi/2}\cos^{2j-1}(2x)\cos x\, dx = \sum_{l=0}^{2j-1}\binom{2j-1}{l}(-2)^{l}\dfrac{1}{2l+1}.\tag{5} \end{equation*} Since \begin{equation*} \binom{k}{2j}\binom{2j-1}{l}\dfrac{1}{2l+1} = \dfrac{k!}{2j\cdot(2l+1)\cdot l!(k-2j)!(2j-l-1)!} \end{equation*} I can combine (4) and (5) to \begin{equation*} \int_{0}^{\pi/2}\dfrac{\sin^{2k}x - 2^{-k}}{\cos x + \sin x}\, dx = 2^{-k}k!\sum_{j=1}^{\lfloor{k/2}\rfloor}\sum_{l=0}^{2j-1}\dfrac{(-2)^{l}}{j\cdot(2l+1)\cdot l!(k-2j)!(2j-l-1)!}. \end{equation*}