You'll need a numerical integration method to solve this integral.
You can solve it thanks to integration by parts with u=x and v(x)=primitive of 1/(1+(cos(x))^2)
A primitive of 1/(1+(cos(x)^2)) is v(x)=(1/sqrt(2))*arctan(tan(x)/sqrt(2))
u'=1. So you should have to integrate u'*v=v, wich is very difficult (involving special functions).
But, you don't need to do it explicitly. Since the function v(x) is periodic, one can see that its definite integal from x=0 to x=pi is equal to 0.
So, only x*v(x) is remaining. But there is a discontinuity at x=pi/2. Since v' is even then x*v is also even, the definite integral is :
2*(x*v(x) at x=pi/2) = 2*(pi/2)*(1/sqrt(2))*arctan(tan(pi/2)/sqrt(2)) = 2*(pi/2)*(1/sqrt(2)*(pi/2) = pi²/(2*sqrt(2))