Use king theorem of definite integral
$\int _{a}^{b}f(x)dx=\int _{a}^{b}f(a+b-x)dx$
$y=\int _{0}^{\pi }\frac{\left( \pi -x \right)\tan \left( \pi -x \right)}{\sec \left( \pi -x \right)\cos ec\left( \pi -x \right)}dx$
$y=\int _{0}^{\pi }\frac{-\left( \pi -x \right)\tan x}{-\sec x\cos ecx}dx$
$y=\int _{0}^{\pi }\frac{\pi \tan x-x\tan x}{\sec x\cos ecx}dx…….(2)$
Adding equation (1) and (2)
$2y=\int _{0}^{\pi }\frac{x\tan x}{\sec x\cos ecx}dx+\int _{0}^{\pi }\frac{\pi \tan x-x\tan x}{\sec x\cos ecx}dx$
$2y=\int _{0}^{\pi }\frac{\pi \tan x}{\sec x\cos ecx}dx$
$y=\frac{\pi }{2}\int _{0}^{\pi }\frac{\frac{\sin x}{\cos x}}{\frac{1}{\cos x}\times \frac{1}{\sin x}}dx$
$y=\frac{\pi }{2}\int _{0}^{\pi }\frac{1-\cos 2x}{2}dx$
$y=\frac{\pi }{2}\left( \frac{x}{2}-\frac{\sin 2x}{4} \right)_{0}^{\pi }$
$y=\frac{\pi }{2}\left( \frac{\pi }{2}-\frac{\sin 2\pi }{4} \right)=\frac{{{\pi }^{2}}}{4}$