The value of double integral $\int _0^1\int _0^{\frac{1}{x}}\frac{x}{1+y^2}\:dx\,dy$? Given double integral is :
$$\int _0^1\int _0^{\frac{1}{x}}\frac{x}{1+y^2}\:dx\,dy$$

My attempt : 
We can't solve since variable $x$ can't remove by limits, but if we change order of integration, then 
$$\int _0^1\int _0^{\frac{1}{x}}\frac{x}{1+y^2}\:dy\,dx$$
$$\implies\int _0^1\int _0^{\frac{1}{x}}\frac{x}{1+y^2}\:dy\,dx = \frac{1}{2}$$


Can you explain in formal way, please?



Edit : This question was from competitive exam GATE. The link is given below on comments by Alex M. and Martin Sleziak(Thanks).  

$$\int _{ 0 }^{ 1 }{ \int _{ 0 }^{ \frac { 1 }{ x }  }{ \frac { x }{ 1+{ y }^{ 2 } } dxdy }  } \\ =\int _{ 0 }^{ \frac { 1 }{ x }  }{ \int _{ 0 }^{ 1 }{ \frac { x }{ 1+{ y }^{ 2 } } dydx }  } \\ =\int _{ 0 }^{ \frac { 1 }{ x }  }{ x\left( arctan1 \right) dx } \\ =\frac { \pi  }{ { 8x }^{ 2 } } $$
Now Mithlesh your method of approach is wrong as the limits of a multivariable integral are associated with the appropriate variable itself. You can not change the limits pertaining to a variable. 
