Integration of $1/(1+a \csc^2(x))$ 
Integration of  $$\int_{0}^{\frac{(M-1)\pi}{M} }\frac{1}{1+\alpha \csc^2(x)} dx,$$ where $ \alpha $ is a constant. 

I tried taking $\cot(x) = t$, then differentiating it w.r.t $dx$ we get, $-\csc^2(x)dx = dt$. And as we know that, $\csc^2(x)= \cot^2(x) +1$, so tried substituting these values, but did not got any outcome.
 A: We can simplify it as $\displaystyle1-\frac{a}{\sin^2 (x)+a} $. 
Then by using $\displaystyle \sin (x)=\frac {\tan x}{\sec x},\sec^2x=\tan^2x+1$, we have the next term as $\\\displaystyle\frac {a\sec^2 (x)}{(a+1)\tan^2 (x)+a} $. Now let $\tan (x)=t \implies\sec^2 (x)dx=dt $. 
Thus the next part changes to the integral $\displaystyle\int \frac {a}{(a+1)t^2+a}dt$ which has well-known antiderivative. After all the simplification and re-substituting we have the final result as $$ I=x-\frac{1}{\sqrt {a (a+1)}}\arctan(\frac {\sqrt {(a+1)}\tan (x)}{\sqrt {a}})$$ 
I haven't put the limits as it would make the work messy. I hope you can continue from here. 
A: Hint
Considering the problem of the antiderivative, using $$x=\tan ^{-1}\left(u\,\sqrt{\frac{a}{a+1}} \right)\implies dx=\frac{ \sqrt{a(a+1)}}{a u^2+a+1}\,du$$ This makes 
$$\int\frac{dx}{1+a \csc^2(x)}=\sqrt{\frac{a}{a+1}}\int\frac{ u^2}{\left(u^2+1\right) \left(a u^2+a+1\right)}\,du$$ Now, using partial fraction decomposition $$\frac y{(y+1)(ay+a+1)}=\frac A {y+1}+\frac B {ay+a+1}$$ Identify to get  $A=-1$ and $B=1+a$. 
So $$\frac{ u^2}{\left(u^2+1\right) \left(a u^2+a+1\right)}=-\frac 1{u^2+1}+\frac {1+a}{au^2+a+1}$$ which seems much simpler to solve.
Edit
In fact, using $$x=\tan^{-1}(ku)\implies dx=\frac{k}{k^2 u^2+1},du$$  makes 
$$\int\frac{dx}{1+a \csc^2(x)}=\int\frac {k^3 u^2}{u^4 k^4\left(a +1\right)+u^2 k^2\left(2 a +1\right)+a}\,du$$ and $${u^4 k^4\left(a +1\right)+u^2 k^2\left(2 a +1\right)+a}=k^4\left(a +1\right)\left(u^2+\frac 1 {k^2}\right)\left(u^2+\frac{a}{(a+1) k^2}\right)$$ which simplifies setting one of the roots equal to $1$ that is to say using either $k=1$ or $k=\sqrt{\frac{a}{a+1}}$. The case $k=1$ is what Archis Welankar proposed in his answer.
A: $$\int^{ }_{} \frac{1}{1+\alpha \csc^2(x)}dx=\int \frac{\csc^2(x)}{\csc^2(x)+\alpha \csc^4(x)}dx$$ 
and $$\csc^2(x)=\cot^2(x)+1$$
$\int \frac{\cot^2 (x) +1}{\cot^2 (x)+1+\alpha (\cot^2 (x) +1)^2}dx$
$\int \frac{\csc^2x}{\cot^2 (x)+1+\alpha (\cot^2 (x) +1)^2}dx$
Then substitute $t=\cot(x)=> dt = -\csc^2 x \,dx.$
$\int \frac{-dt}{t^2 +1+\alpha (t^2  +1)^2}$
$\int \frac{-dt}{(t^2 +1)(1+\alpha (t^2  +1))}$
$\int (\frac {\alpha}{(\alpha t^2 + \alpha + 1)} -\frac{ 1}{(t^2 + 1)})dt$
$\int  \frac {\alpha}{(\alpha t^2 + \alpha + 1)}dt - \int  \frac{ 1}{(t^2 + 1)}dt$

$ \int  \frac {\alpha}{(\alpha t^2 + \alpha + 1)}dt=\frac{\alpha}{\alpha+1}\int  \frac {1}{1+\frac{\alpha t^2}{\alpha+1}}dt\,\,\,\,\,$
 [substitute $u=t\sqrt{\frac{\alpha}{\alpha+1}}] $ 
$=\frac{\alpha}{\alpha+1}[\sqrt{\frac{\alpha}{\alpha+1}}+\frac{\sqrt{\frac{\alpha}{\alpha+1}}}{a}]\int \frac {1}{u^2+1}du=\frac{\alpha}{\alpha+1}[\sqrt{\frac{\alpha}{\alpha+1}}+\frac{\sqrt{\frac{\alpha}{\alpha+1}}}{a}]\tan^{-1}(t\sqrt{\frac{\alpha}{\alpha+1}})$

$\int  \frac {\alpha}{(\alpha t^2 + \alpha + 1)}dt - \int  \frac{ 1}{(t^2 + 1)}dt=\frac{\alpha}{\alpha+1}[\sqrt{\frac{\alpha}{\alpha+1}}+\frac{\sqrt{\frac{\alpha}{\alpha+1}}}{a}]\tan^{-1}(t\sqrt{\frac{\alpha}{\alpha+1}})-\tan^{-1}t$
$$=(\frac{\sqrt {a}}{\sqrt{\alpha+1}})\tan^{-1}(\cot (x)\sqrt{\frac{\alpha}{\alpha+1}})-\tan^{-1} (\cot x)+C$$
