How to solve this double integral involving trig substitution (using tangent function)? This is a question I came across and I cannot find the answer.  

By using a substitution involving the tangent function, show that $$\int_0^1\int_0^1\frac{x^2-y^2}{(x^2+y^2)^2}\,dy\,dx=\frac{\pi}{4}$$

My attempt
I use trig substitution, by saying
$$\tan(\theta)=\frac{y}{x}$$ which means 
$$x\sec^2(\theta)\,d\theta=dy$$
Also, it should be noted that because of this 
$$x\sec(\theta)=\sqrt{x^2+y^2}$$
$$x^4\sec^4(\theta)=(x^2+y^2)^2
$$
Thus, when I substitute this information into the integral, I get
$$\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{x^2-(x^2\tan^2(\theta))}{x^4\sec^4(\theta)}{x\sec^2(\theta)} \, d\theta \,dx$$
Then, this simplifies to
$$\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{x^2(1-\tan^2(\theta))}{x^4\sec^4(\theta)}{x\sec^2(\theta)}\,d\theta \,dx$$
$$\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{x^2\sec^2(\theta)}{x^4\sec^4(\theta)}{x\sec^2(\theta)}\,d\theta \,dx=\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})}{\frac{1}{x}}\,d\theta \,dx$$ which leads to
$$\int_0^1 \left[\frac \theta x \right]_0^{\arctan\left(\frac{1}{x}\right)} \,dx = \int_0^1 \frac{\arctan\left(\frac{1}{x}\right)}{x}                   \, dx_{(3)} $$
At this point I am stuck.  How do I evaluate this integral.  Am I on the right path?  Wolfram Alpha gives an answer other than $\frac{\pi}{4}$ for (3), so I am not sure where I am wrong.
 A: Let us start considering $$I=\int\frac{x^2-y^2}{(x^2+y^2)^2}dy$$ Defining $$y=x\tan(\theta)\implies dy=x \sec ^2(\theta )\implies I=\int \frac{\cos (2 \theta )}{x}\,d\theta=\frac{\sin (2 \theta )}{2 x}$$ Back to $x$ $$I=\frac{y}{x^2+y^2}$$ So, $$\int_0^1\frac{x^2-y^2}{(x^2+y^2)^2}dy=\frac 1 {1+x^2}$$ So, you are left with $$\int_0^1\frac {dx} {1+x^2}$$ Repeat the same change of variable.
A: Starting with your work...
$$\begin{align}
\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{x^2(1-\tan^2(\theta))}{x^4\sec^4(\theta)}{x\sec^2(\theta)}\,d\theta \,dx
=&\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{(1-\tan^2(\theta))}{x\sec^2(\theta)}\,d\theta \,dx
\\\\
=&\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{(\cos^2\theta-\sin^2\theta)}{x}\,d\theta \,dx 
\\\\
=&\int_0^1\int_{\theta=0}^{\arctan(\frac{1}{x})} \frac{\cos2\theta}{x}\,d\theta \,dx
\\\\
=&\frac12\int_0^1 \frac{\sin2\theta}{x}\bigg|_0^{\arctan(1/x)} \,dx 
\\\\
= &\int_0^1 \frac{\sin\theta\cos\theta}{x}\bigg|_0^{\arctan(1/x)} \,dx
\\\\
=&\int_0^1 \frac{x}{x(1+x^2)} \,dx = \arctan(1)=\pi/4
\end{align}$$
