Is there another way to solve this integral? My way to solve this integral. I wonder is there another way to solve it as it's very long for me. 
$$\int_{0}^{\pi}\frac{1-\sin (x)}{\sin (x)+1}dx$$
Let $$u=\tan (\frac{x}{2})$$
$$du=\frac{1}{2}\sec ^2(\frac{x}{2})dx $$
By Weierstrass Substitution
$$\sin (x)=\frac{2u}{u^2+1}$$
$$\cos (x)=\frac{1-u^2}{u^2+1}$$
$$dx=\frac{2du}{u^2+1}$$
$$=\int_{0}^{\infty }\frac{2(1-\frac{2u}{u^2+1})}{(u^2+1)(\frac{2u}{u^2+1}+1)}du$$
$$=\int_{0}^{\infty }\frac{2(u-1)^2}{u^4+2u^3+2u^2+2u+1}du $$
$$=2\int_{0}^{\infty }\frac{(u-1)^2}{u^4+2u^3+2u^2+2u+1}du  $$
$$=2\int_{0}^{\infty }\frac{(u-1)^2}{(u+1)^2(u^2+1)}du $$
$$=2\int_{0}^{\infty }(\frac{2}{(u+1)^2}-\frac{1}{u^2+1})du $$
$$=-2\int_{0}^{\infty  }\frac{1}{u^2+1}du+4\int_{0}^{\infty}\frac{1}{(u+1)^2}du $$
$$\lim_{b\rightarrow \infty }\left | (-2\tan^{-1}(u)) \right |_{0}^{b}+4\int_{0}^{\infty}\frac{1}{(u+1)^2}du$$
$$=(\lim_{b\rightarrow \infty}-2\tan^{-1}(b))+4\int_{0}^{\infty}\frac{1}{(u+1)^2}du$$
$$=-\pi+4\int_{0}^{\infty}\frac{1}{(u+1)^2}du$$
Let $$s=u+1$$
$$ds=du$$
$$=-\pi+4\int_{1}^{\infty}\frac{1}{s^2}ds$$
$$=-\pi+\lim_{b\rightarrow \infty}\left | (-\frac{4}{s}) \right |_{1}^{b}$$
$$=-\pi+(\lim_{b\rightarrow \infty} -\frac{4}{b}) +4$$
$$=4-\pi$$
$$\approx 0.85841$$

The question asked "is there another way", so here's another one. Start by removing the trig from the numerator:
$$ \int_0^{\pi} \frac{1-\sin{x}}{1+\sin{x}} \, \mathrm{d}x = 
\int_0^{\pi} \frac{2 - (1 +\sin{x})}{1+\sin{x}} \, \mathrm{d}x = 
\int_0^{\pi} \left( \frac{2}{1+\sin{x}} - 1  \right) \, \mathrm{d}x = 
-\pi + \int_0^{\pi} \frac{2 \, \mathrm{d}x}{1+\sin{x}} $$
There are many ways to solve this but I would like to demonstrate the substitution $u = 1 + \sin x$. It would be much more convenient if the limits ran from $0$ to $\frac{\pi}{2}$, so that $x = \sin^{-1} (u-1)$ is a continuous, monotonic function from $[1,2]$ to $[0,\frac{\pi}{2}]$, and also because $\cos x$ and $\sin x$ are both positive for $0 \leq x \leq \frac{\pi}{2}$. The latter property is often useful so we can write $\cos x=\sqrt{1-\sin^2 x}$ and $\sin x=\sqrt{1-\cos^2 x}$. Fortunately symmetry considerations allow a change of limits:
$$\int_0^{\pi} \frac{2 \, \mathrm{d}x}{1+\sin{x}} =
\int_0^{\pi/2} \frac{4 \, \mathrm{d}x}{1+\sin{x}}$$
We have $\frac{\mathrm{d}u}{\mathrm{d}x} = \cos x = \sqrt{1-\sin^2 x} =  \sqrt{1-(u-1)^2} = \sqrt{2u - u^2}$ so the integral becomes:
$$\int_0^{\pi/2} \frac{4 \, \mathrm{d}x}{1+\sin{x}} =
\int_1^2 \frac{4 \, \mathrm{d}u}{u \sqrt{2u - u^2}} =
\int_1^2 \frac{4 \, \mathrm{d}u}{u \sqrt{-u(u-2)}}$$
This might look fearsome but is actually very amenable to the third Euler substitution, since we have a factorised quadratic expression inside the square root. The computation is very similar to this answer. In general the substitution is $\sqrt{au^2 + bu + c} = \sqrt{a(u-\alpha)(u-\beta)} = (u-\alpha)t$ which gives $u = \frac{a\beta-\alpha t^2}{a-t^2}$; in our case we can take $a=-1$, $b=2$, $c=0$, $\alpha=0$, and $\beta=2$ with $\sqrt{-u(u-2)} = ut$.
Since $u=\frac{(-1)(2)-0t^2}{-1-t^2}=2(t^2+1)^{-1}$ we obtain $\frac{\mathrm{d}u}{\mathrm{d}t} = -4t(t^2+1)^{-2}$ and to change the limits we set $t=\frac{\sqrt{-u(u-2)}}{u} = \sqrt{\frac{2-u}{u}}$. The remaining integral becomes:
$$\int_1^2 \frac{4 \, \mathrm{d}u}{u \sqrt{-u(u-2)}} = 
\int_1^0 \frac{4 (-4t)(t^2+1)^{-2} \, \mathrm{d}t}{u^2 t} =
\int_0^1 \frac{4 (4t)(t^2+1)^{-2} \, \mathrm{d}t}{4(t^2+1)^{-2} t} =
\int_0^1 4 \, \mathrm{d}t =
4$$
This was not the most straightforward way to find the result $4 - \pi$, but I just wanted to draw out the similarity between this integral and one the original poster had asked about before (the main differences being the trig in the numerator - which is easily removed - and the limits).
