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).  
 A: $$\begin{align}\int_{0}^{1}\int_{0}^{\frac{1}{x}}\frac{x}{1+y^2}\space\text{d}x\text{d}y&=
\int_{0}^{1}\left(\int_{0}^{\frac{1}{x}}\frac{x}{1+y^2}\space\text{d}x\right)\text{d}y\\&=\int_{0}^{1}\left(\frac{1}{1+y^2}\int_{0}^{\frac{1}{x}}x\space\text{d}x\right)\text{d}y\\&=\int_{0}^{1}\left(\frac{\left[x^2\right]_{0}^{\frac{1}{x}}}{2\left(1+y^2\right)}\right)\text{d}y\\&=\int_{0}^{1}\left(\frac{\left(\frac{1}{x}\right)^2-0^2}{2\left(1+y^2\right)}\right)\text{d}y\\&=\int_{0}^{1}\left(\frac{\frac{1}{x^2}}{2\left(1+y^2\right)}\right)\text{d}y\\&=\int_{0}^{1}\frac{1}{2x^2(1+y^2)}\text{d}y\\&=\frac{1}{2x^2}\int_{0}^{1}\frac{1}{1+y^2}\text{d}y\\&=\frac{\left[\arctan(y)\right]_{0}^{1}}{2x^2}\\&=\frac{\arctan(1)-\arctan(0)}{2x^2}\\&=\frac{\frac{\pi}{4}-0}{2x^2}\\&=\frac{\frac{\pi}{4}}{2x^2}\\&=\frac{\pi}{8x^2}\end{align}$$
A: Right way is:
$$\int\limits_0^1x\:dx\int\limits_0^\dfrac1x \dfrac{dy}{1+y^2} = \int\limits_0^1\arctan y\:\Biggl.\Biggr|_0^{\dfrac1x} x\:dx =\int\limits_0^1x\arctan \dfrac1x\:dx = \int\limits_0^1\left(\dfrac{\pi}2-\arctan x\right)x\:dx =$$$$ \left.\dfrac{\pi}2\dfrac{x^2}2\right|_0^1 -\int\limits_0^1\arctan x\: d\dfrac{x^2}2 = \dfrac{\pi}4-\left.\dfrac{x^2}2\arctan x\right|_0^1 +{\dfrac12\int\limits_0^1\dfrac{x^2}{1+x^2}\:dx} =$$$$ \dfrac{\pi}4-\dfrac{\pi}8 + \dfrac12\int\limits_0^1\left(1 - \dfrac1{1+x^2}\right)dx = \dfrac{\pi}8+\left.\dfrac12(x-\arctan x)\right|_0^1=\dfrac12$$
To change order of integral, you build the region of integration in the chart, where you can see that the region of integration is made up of a square and curved trapezoid, so:
$$\int\limits_0^1x\:dx\int\limits_0^\dfrac1x \dfrac1{1+y^2}\:dy = \int\limits_0^1 \dfrac1{1+y^2}\:dy\int\limits_0^1 x\:dx +  \int\limits_1^\infty \dfrac1{1+y^2}\:dy\int\limits_0^\dfrac1y x\:dx = $$$$ \arctan y\:\Biggl.\Biggr|_0^1\cdot\left.\dfrac{x^2}2\right|_0^1 + \int\limits_1^\infty \left.\dfrac{x^2}2\right|_0^\dfrac1y\dfrac1{1+y^2}dy = \dfrac{\pi}8 + \dfrac12\int\limits_1^\infty \dfrac1{1+y^2}\dfrac1{y^2}\:dy = $$$$\dfrac{\pi}8+\dfrac12\int\limits_1^\infty \left(\dfrac1{y^2}-\dfrac1{1+y^2}\right)\:dy = \dfrac{\pi}8+\dfrac12\left(-\dfrac1y-\arctan y\right)\Biggr.\Biggr|_1^\infty = \dfrac12$$
And this way of calculation does not seem more simple.
A: $$\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. 
