Evaluate the integral $\int_0^{\pi/2}\frac{\tan x}{\tan(\frac{x}{2})} \, dx$ Evaluate the integral.
$$\int_0^{\frac{\pi}{2}}\frac{\tan{x}}{\tan(\frac{x}{2})}\,dx$$
I tried to solve it with $u = \tan{x/2}$, but i got divergent part of the solution. How can I integrate it, such that, when boundaries are plugged in, the result will be able to be calculated.

Write $$\frac{\tan x}{\tan \frac{x}{2}} = \frac{\sin x}{\cos x} \frac{\cos\frac{x}{2}}{\sin\frac{x}{2}} = \frac{2\sin\frac{x}{2} \cos\frac{x}{2}}{\cos x}\frac{\cos\frac{x}{2}}{\sin\frac{x}{2}} = \frac{2\cos^2\frac{x}{2}}{\cos x} = \frac{1 + \cos x}{\cos x}$$Then your integral reduces to $$\int_0^{\frac{\pi}{2}} (\sec x + 1)\, dx$$
