Definite Trigonometric Integration 
Calculate the integral : $$\ \int_{0}^{\pi}\frac{x}{a-\sin(x)}dx , \quad a>1 $$

I have tried trig substitutions, and replacing $\ x$ with $\ \pi-y $, along with other commonly used "tricks", but none seem to work.
 A: As mentioned in the comments, the substitution $x \to \pi - x$ yields : 
$$\int_0^{\pi}\frac{xdx}{a-\sin x}=\frac{\pi}{2}\int_0^{\pi}\frac{dx}{a-\sin x}$$
I'll go over the calculation of the integral on the RHS.
We have : 
$$ I ={\displaystyle\int}\dfrac{1}{a-\sin\left(x\right)}\,\mathrm{d}x =-{\displaystyle\int}\dfrac{1}{\sin\left(x\right)-a}\,\mathrm{d}x $$
Solving the integral : 
$$I= {\displaystyle\int}\dfrac{1}{\sin\left(x\right)-a}\,\mathrm{d}x $$
Let's prepare our integral for the Weierstrass Substitution : 
$${\displaystyle\int}\dfrac{1}{\frac{2\tan\left(\frac{x}{2}\right)}{\tan^2\left(\frac{x}{2}\right)+1}-a}\,\mathrm{d}x$$
Substitute : 
$$u=\tan\left(\dfrac{x}{2}\right)\to \mathrm{d}x=\dfrac{2}{\sec^2\left(\frac{x}{2}\right)}\,\mathrm{d}u =\dfrac{2}{u^2+1}\,\mathrm{d}u$$
The integral then becomes : 
$$I=-\class{steps-node}{\cssId{steps-node-1}{2}}{\displaystyle\int}\dfrac{1}{au^2-2u+a}\,\mathrm{d}u = -{\displaystyle\int}\dfrac{1}{\left(\sqrt{a}u-\frac{1}{\sqrt{a}}\right)^2+a-\frac{1}{a}}\,\mathrm{d}u$$
Substitute : 
$$v=\dfrac{au-1}{\sqrt{a}\sqrt{a-\frac{1}{a}}} \to \mathrm{d}u=\dfrac{\sqrt{a-\frac{1}{a}}}{\sqrt{a}}\,\mathrm{d}v$$
The integral then becomes : 
$$I=-\class{steps-node}{\cssId{steps-node-2}{\dfrac{1}{\sqrt{a}\sqrt{a-\frac{1}{a}}}}}{\displaystyle\int}\dfrac{1}{v^2+1}\,\mathrm{d}v = -\dfrac{\arctan\left(v\right)}{\sqrt{a}\sqrt{a-\frac{1}{a}}}$$
Substituting back, we get : 
$$I=-\dfrac{\arctan\left(\frac{au-1}{\sqrt{a}\sqrt{a-\frac{1}{a}}}\right)}{\sqrt{a}\sqrt{a-\frac{1}{a}}} = \dots =-\dfrac{2\arctan\left(\frac{a\tan\left(\frac{x}{2}\right)-1}{\sqrt{a}\sqrt{a-\frac{1}{a}}}\right)}{\sqrt{a}\sqrt{a-\frac{1}{a}}} $$
The integral is now solved, as by :
$$-{\displaystyle\int}\dfrac{1}{a-\sin\left(x\right)}\,\mathrm{d}x =\dfrac{2\arctan\left(\frac{a\tan\left(\frac{x}{2}\right)-1}{\sqrt{a}\sqrt{a-\frac{1}{a}}}\right)}{\sqrt{a}\sqrt{a-\frac{1}{a}}}$$
Which by simplifying and rewriting, leads to : 
$$\boxed{{\displaystyle\int}\dfrac{1}{a-\sin\left(x\right)}\,\mathrm{d}x= \dfrac{2\arctan\left(\frac{a\tan\left(\frac{x}{2}\right)-1}{\sqrt{a^2-1}}\right)}{\sqrt{a^2-1}}+C, \quad a>1}$$
Can you now, using this result and the result from the substitution, calculate the given indefinite integral : 
$$\ \int_{0}^{\pi}\frac{x}{a-\sin(x)}dx , \quad a>1$$
