# Trig Integral With A Discontinuous Phase Shift

I've been having some trouble trying to evaluate $\int_0^\pi (\frac{\pi}{2}-x)\tan x\cdot\frac{dx}{x}$

Standard Integration by Parts failed, because if one splits the integral, the integrand ends up being $\frac{\pi}{2x}\tan x - \tan x$. But because the integral has bounds from 0 to pi, one cannot integrate over pi/2 due to convergence issues. Thus, I am not sure how to go about this integral from here. Any help would be appreciated.

• Did you plot the function $(\frac{\pi}{2}-x)\frac{\tan x}{x}$ for $0 \leq x \leq \pi$ ? – Claude Leibovici Aug 23 '16 at 10:12
• Yes, but why would that help? – Why Do You Care Aug 23 '16 at 10:21