<s>[INST] Beta function with different integral limits The beta function is
$$B(x,y) = 2\int_{0}^{\frac{\pi}{2}} \cos^{2x-1}\theta \sin^{2y-1}\theta d\theta$$
for positive values of $x$ and $y$.
How can this integral be used to evaluate other limits of integration?
For example,
$$ \int_{0}^{\pi} \sqrt{\sin\theta} \, d\theta$$
 [/INST] Consider:
\begin{align}
\int_{0}^{\pi} \sqrt{\sin\theta} \, d\theta &= \int_{0}^{\pi/2} \sqrt{\sin\theta} \, d\theta + \int_{\pi/2}^{\pi} \sqrt{\sin\theta} \, d\theta \\
&= \int_{0}^{\pi/2} \sqrt{\sin\theta} \, d\theta + \int_{0}^{\pi/2} \sqrt{\sin(\theta + \pi/2)} \, d\theta \\
&= \int_{0}^{\pi/2} \sqrt{\sin\theta} \, d\theta + \int_{0}^{\pi/2} \sqrt{\cos\theta} \, d\theta \\
&= \frac{1}{2} \, \left( B\left(\frac{3}{4}, \frac{1}{2} \right) + B\left( \frac{1}{2} , \frac{3}{4}\right) \right) \\
&= B\left(\frac{3}{4}, \frac{1}{2} \right) = \frac{4\pi}{s},
\end{align}
where $s$ is the lemniscate constant.
</s>