Calculating $\int_{-a}^{a} \frac{x\cdot dy}{(x^2+y^2)^{3/2}}$ requires unusual substitution? Can someone help me understand how to solve this integral? The official solution says to substitute $y=x\cdot \tan(u)$ and $dy=x\cdot \sec^2(u)du$, but I don't understand how I should know that myself.
Here is the integral:
$$\int_{-a}^{a} \frac{x\cdot dy}{(x^2+y^2)^{3/2}}$$
A step-through solution would be appreciated. I haven't done integrals in a while so it would be helpful if you can explain any particularly complicated steps.
Thank you!!!

Let $$\displaystyle  I = \int \frac{x}{(x^2+y^2)^{\frac{3}{2}}}dy\;,$$ Here $x$ is Constant.
Here  Denominator is in the form of $(x^2+y^2)$
So we will put $y=x\tan \phi,$ Then $\displaystyle dy = d(x\tan \phi)=x\frac{d}{d\phi}\left[\tan \phi\right]d\phi$
so we get $\displaystyle dy = x\sec^2 \phi d\phi$
So Integral $$\displaystyle I = \int\frac{x^2\cdot \sec^2 \phi}{x^3\sec^3 \phi}d\phi\;,$$ Here we put $(1+\tan^2 \phi) = \sec^2 \phi$$
So we get $$\displaystyle \frac{1}{x}\int \cos \phi d\phi = \frac{\sin \phi}{x}+\mathcal{C}$$
Now above we take $\displaystyle y=x\tan \phi\Rightarrow \tan \phi = \frac{y}{x}$
So Using Right angle $\triangle\;,$ We get $\displaystyle \sin \phi = \frac{y}{\sqrt{x^2+y^2}}$
So Integral $$\displaystyle I = \frac{y}{x\sqrt{x^2+y^2}}+\mathcal{C}$$
So $$\displaystyle \int_{-a}^{a}\frac{y}{(x^2+y^2)^{\frac{3}{2}}} = \left[\frac{y}{x\sqrt{x^2+y^2}}\right]_{-a}^{a} $$
$$\displaystyle = \left[\frac{a}{x\sqrt{x^2+a^2}}\right]-\left[-\frac{a}{x\sqrt{x^2+a^2}}\right] = \left[\frac{2a}{x\sqrt{x^2+a^2}}\right]$$
