As a high school student, most of the tricks I'm aware of were already stated by you, or in the comments. However, there's one more trick that I don't think anyone has mentioned: Integrating an inverse function.
$$\int\!f^{-1}(x)\ dx = x\cdot\!f^{-1}(x)\ - F(f^{-1}(x))\ + c$$where $$F(x) = \int\!f(x)\ dx$$
So for instance, if you wish to find $\int\cos^{-1}(x)\ dx,$ you will have $$f(x)= \cos x$$ and $$F(x) = \int\cos x\ dx = \sin x\ (+c)$$
So to find $\int\cos^{-1}(x)\ dx,$ use the formula as the follows:
$$\int\cos^{-1}(x)\ dx = x\cdot\cos^{-1}(x)\ - \sin(\cos^{-1}(x))\ + c$$
$$= x\cdot\cos^{-1}(x)\ - \sqrt {1-x^2}\ + C$$
I personally like this trick as it can be generalized to any inverse function. A simple way to prove it would be using the Chain Rule but it's a really nice formula that avoids working things out from scratch every time.
Hope that helped to add to your list :)
Here is a solution using real analysis. First, denote the two integrals as
\begin{align*}
J & \equiv\int\limits_0^{\pi}\frac {x\left(\sin\frac x2\color{red}-\cos\frac x2\right)}{\sqrt{\sin x}}\,\mathrm dx\\K & \equiv\int\limits_0^{\pi}\frac {x\left(\sin\frac x2\color{red}+\cos\frac x2\right)}{\sqrt{\sin x}}\,\mathrm dx
\end{align*}
And from your post, recall that $K=\pi^2$. Adding the two integrals together removes the $\cos\frac x2$ factor inside the integrand, leaving only
\begin{align*}
J+K & =2\int\limits_0^{\pi}\frac {x\sin\frac x2}{\sqrt{\sin x}}\,\mathrm dx\\ & =\sqrt 2\int\limits_0^{\pi}x\sqrt{\tan\frac x2}\,\mathrm dx\\ & =4\sqrt{2}\int\limits_0^{+\infty}\frac {\sqrt t}{1+t^2}\arctan t\,\mathrm dt
\end{align*}
Where a double angle identity was utilized in the second equation and the half-angle tangent substitution in the third equation. The last integral has been evaluated here before using Complex Analysis, Feynman's Trick, etc. Here is an alternative approach using double integrals. First, enforce the substitution $x=\sqrt t$ so that the integral becomes
$$\int\limits_0^{+\infty}\frac {\sqrt t}{1+t^2}\arctan t\,\mathrm dt=2\int\limits_0^{+\infty}\frac {x^2}{1+x^4}\arctan x^2\,\mathrm dx$$
Next, use the identity
$$\arctan x^2=\int\limits_0^1\frac {x^2}{1+x^4 y^2}\,\mathrm dy$$
Swapping the order of integration and using partial fraction decomposition, then we get
\begin{align*}
2\int\limits_0^{+\infty}\,\int\limits_0^1\frac {x^4}{(1+x^4)(1+x^4y^2)}\,\mathrm dy\,\mathrm dx & =2\int\limits_0^1\frac 1{y^2-1}\int\limits_0^{+\infty}\frac 1{1+x^4}-\frac 1{1+x^4y^2}\,\mathrm dx\,\mathrm dy\\ & =\frac {\pi}{\sqrt 2}\int\limits_0^1\frac 1{y^2-1}\left(1-\frac 1{\sqrt y}\right)\,\mathrm dy\\ & =\frac {\pi^2}{4\sqrt 2}+\frac {\pi\log 4}{4\sqrt 2}
\end{align*}
To recap, we have the equation
$$J+\pi^2=4\sqrt{2}\int\limits_0^{+\infty}\frac {\sqrt t}{1+t^2}\arctan t\,\mathrm dt=\pi^2+\pi\log 4$$
Subtracting a $\pi^2$ from both sides, then
$$\int\limits_0^{\pi}\frac {x\left(\sin\frac x2-\cos\frac x2\right)}{\sqrt{\sin x}}\,\mathrm dx\color{blue}{=\pi\log 4}$$
Best Answer
Using the wonderful idea of xpaul, we have $I=(2n^2+1)\pi J$. For completeness, I shall find the easier integral $$ \begin{aligned} J & =\int_0^{2 \pi} \frac{d x}{\left(\left(a^2(1+\cos x)+b^2(1-\cos x\right)\right)^2} \\ & =\frac{1}{2} \int_0^\pi \frac{d x}{\left(a^2 \cos ^2 x+b^2 \sin ^2 x\right)^2} \quad (\textrm{By half-angle formula})\\ & =\int_0^{\frac{\pi}{2}} \frac{d x}{\left(a^2 \cos ^2 x+b^2 \sin ^2 x\right)^2} \\ & =\int_0^{\frac{\pi}{2}} \frac{\sec ^4 x}{\left(a^2+b^2 \tan ^2 x\right)^2} d x \end{aligned} $$ Putting $\tan x =\frac{a}{b}\tan \theta$, we have $$ \begin{aligned} J & =\int_0^{\frac{\pi}{2}} \frac{1+\frac{a^2}{b^2} \tan ^2 \theta}{a^4 \sec ^4 \theta} \frac{a}{b} \sec ^2 \theta d \theta \\ & =\frac{1}{a^3 b} \int_0^{\frac{\pi}{2}} \cos ^2 \theta d \theta+\frac{1}{a b^3} \int_0^{\frac{\pi}{2}} \sin ^2 \theta d \theta \\ & =\frac{1}{a^3 b} \int_0^{\frac{\pi}{2}} \frac{1+\cos 2 \theta}{2} d \theta+\frac{a}{b^3} \int_0^{\frac{\pi}{2}} \frac{1-\cos 2 \theta}{2} d \theta \\ & =\frac{\pi}{4 a^3 b}+\frac{\pi}{4a b^3} \\ & =\frac{\left(a^2+b^2\right) \pi}{4a^3 b^3} \end{aligned} $$ Putting back yields the answer $$ \boxed{I=\frac{\pi^2\left(2 n^2+1\right)\left(a^2+b^2\right)}{4a^3 b^3}} $$