How should I solve this definite Integral I need to solve the integral 
$\displaystyle \int _{-1}^{3} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx$.
I  thought I could use the identity $\arctan(x) + \operatorname{arccot}(x) = \dfrac{\pi}{2}$ to simplify the integral, But that gives the answer as $2\pi$ while the actual answer is given as:
$\pi$; 
can anyone tell me how should I solve this definite integral?
Thank you.

$\forall x\in\mathbb{R}^*,\,\arctan(x)+\arctan\left(\frac{1}{x}\right)=\mathrm{sgn}(x)\frac{\pi}{2}$, split the integral into two integrals :
$$ \int _{-1}^{3} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx=\int _{-1}^{0} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx+\int _{0}^{3} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx $$
We then have $$\int _{0}^{3} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx=\frac{3\pi}{2}$$ and $$\int _{-1}^{0} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx=-\frac{\pi}{2}$$ so that $$ \int _{-1}^{3} \left[\arctan \left(\dfrac{x}{x^2+1}\right) + \arctan \left(\dfrac{x^2 + 1}{x}\right)\right]dx=\pi $$
