I want to calculate the following improper integral, so I do: $$ \int_0^{{\pi}/{2}} \cos^{2/3} x \sin^{-2/3} x\,dx = \int_0^{{\pi}/{2}} \frac{\cos x \cos^ {2/3} x}{\cos x \sin^{2/3}x}\,dx = \int_0^{{\pi}/{2}}\frac{3\cos^{2/3} x\,d(\sin^{1/3} x)}{\cos x} =$$ $$\int_0^1\frac{3\,dt}{\sqrt{1-t^2}} = 3\arcsin t |_0^1 = \frac{3\pi}{2} $$
However, when I evalute it numerically in MatLab, it shows the answer about $\pi$. It seems that there is a problem at discontinuity point $x = 0$, but I don't understand why, because I could use limits and get the same result.
The following method of calculation is conceivably the most elementary, though it has the disadvantage of being a good bit longer than more advanced methods (e.g., via the beta function).
Substituting first $t=\cot{(x)}$ followed by $u=t^{\frac13}$, and then expanding by partial fractions, yields:
$$\begin{align} \int_{0}^{\frac{\pi}{2}}\cot^{\frac23}{(x)}\,\mathrm{d}x &=\int_{0}^{\infty}\frac{t^{\frac23}}{t^2+1}\,\mathrm{d}t\\ &=\int_{0}^{\infty}\frac{3u^4}{u^6+1}\,\mathrm{d}u\\ &=\int_{0}^{\infty}\left(\frac{1}{u^2+1}+\frac{2u^2-1}{u^4-u^2+1}\right)\,\mathrm{d}u\\ &=\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}+\int_{0}^{\infty}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u.\\ \end{align}$$
The second integral in the last line above may be reduced from an integral over $[0,\infty)$ to an integral over $[0,1]$ as follows:
$$\begin{align} \int_{0}^{\infty}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u &=\int_{0}^{1}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u+\int_{1}^{\infty}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u\\ &=\int_{0}^{1}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u+\int_{0}^{1}\frac{2-w^2}{w^4-w^2+1}\,\mathrm{d}w;~\left(\text{from }u\rightarrow\frac{1}{w}\right)\\ &=\int_{0}^{1}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u+\int_{0}^{1}\frac{2-u^2}{u^4-u^2+1}\,\mathrm{d}u\\ &=\int_{0}^{1}\frac{u^2+1}{u^4-u^2+1}\,\mathrm{d}u.\\ \end{align}$$
We can show via substitution that $\int_{0}^{1}\frac{u^2+1}{u^4-u^2+1}\,\mathrm{d}u=\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}$. To demonstrate this, we can start from the integral $\int_{0}^{\infty}\frac{\mathrm{d}x}{x^2+1}$ and substitute $\frac{u}{1-u^2}$:
$$\begin{align} \int_{0}^{\infty}\frac{\mathrm{d}x}{x^2+1} &=\int_{0}^{1}\frac{1}{\left(\frac{u}{1-u^2}\right)^2+1}\cdot\frac{u^2+1}{\left(1-u^2\right)^2}\,\mathrm{d}u\\ &=\int_{0}^{1}\frac{u^2+1}{u^2+\left(1-u^2\right)^2}\,\mathrm{d}u\\ &=\int_{0}^{1}\frac{u^2+1}{u^4-u^2+1}\,\mathrm{d}u.\\ \end{align}$$
Putting this all together, we get:
$$\begin{align} \int_{0}^{\frac{\pi}{2}}\cot^{\frac23}{(x)}\,\mathrm{d}x &=\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}+\int_{0}^{\infty}\frac{2u^2-1}{u^4-u^2+1}\,\mathrm{d}u\\ &=\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}+\int_{0}^{1}\frac{u^2+1}{u^4-u^2+1}\,\mathrm{d}u\\ &=\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}+\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}\\ &=2\int_{0}^{\infty}\frac{\mathrm{d}u}{u^2+1}\\ &=2\cdot\frac{\pi}{2}=\pi. \end{align}$$