Solve $$ \int_0^\pi \frac {x} {1+\sin x} dx $$ using $\sin x = \frac {2\tan(x/2)} {1+\tan^2(x/2)}$ and the substitution $t = \tan(x/2)$. I tried doing this but I got to a point where my integral limits were $0$ to $\infty $. This happened when I substituted for $\tan(x/2)$ Is there a way of doing this using this substitution only? And also why does this happen?
UPDATE: What I did - $$ I = \int_0^\pi \frac {\pi-x} {1+\sin x} dx = \int_0^\pi \frac {\pi} {1+ \sin x} dx - I$$ Using $\sin x = \frac {2\tan(x/2)} {1+\tan^2(x/2)}$ $$ $$ $$ 2I = \int_0^\pi \frac {\pi} {1+\sin x} dx = \pi\int_0^\pi \frac {\sec^2(x/2)} {1+ \tan^2(x/2)+2 \tan(x/2)} dx$$ Now if there were no limits, this could've been solved easily by $t = \tan x$. But I can't do that because if I did, the limits would become $0$ to $\infty$. A way to solve this would be multiplying and dividing by $1+ \sin x$ but I don't want to do that. I want to use $t=\tan x$