Integration problem related to physics problem I want to know how to solve this (acytually this is the flux on any non-adjacent side of a cube due to a charge q on the vertice of the cube, side length: l)
$$a=\oint\vec{E}.\vec{dS}=\oint E.dS.cos\theta$$ where $\theta$ is angle between the two vectors
$$a=\int_0^l\int_0^l \frac{kq}{x^2+y^2+l^2}.\frac{l}{\sqrt(x^2+y^2+l^2)}dxdy$$
and now, how to solve it further [answer is $kq\pi/6=q/24\epsilon$ where $k=1/4\pi\epsilon$ which can be obtained by another method (Gauss's Law)]
 A: Start by rescaling the length dimensions by $l$, i.e. let $x=l\,\tilde x$ and $y=l\,\tilde y$. The fact that this transformation simplifies the integral we have to evaluate would be reason enough to go ahead and do this if you were just interested in this integral from a purely mathematical standpoint, but given the physical interpretation of the integral at hand the result of this simplification becomes a very interesting result in its ownright:
$$I(l) = \int_{0}^{l}\int_{0}^{l}\frac{k\,q\,l}{(x^2+y^2+l^2)^{\frac{3}{2}}}\,dxdy\\
= \int_{0}^{1}\int_{0}^{1}\frac{k\,q}{(\tilde x^2+\tilde y^2+1)^{\frac{3}{2}}}\, d\tilde x d\tilde y\\
= I(1).$$
In other words, the size of the cube's side length $l$ doesn't matter at all; the integral will have the same final value no matter what the value of $l$ happens to be, so we might as well set it equal to unity: $l=1$.
Now we evalauate $I=k\,q\int_{0}^{1}\int_{0}^{1}\frac{1}{(x^2+y^2+1)^{\frac{3}{2}}}\, dx dy$. To evaluate the integral $\int_{0}^{1}\frac{1}{(x^2+y^2+1)^{\frac{3}{2}}}\,dy$, use the trigonometric substitution,
$$y=\sqrt{x^2+1}\tan{u}.$$
Then,
$$\int_{0}^{1}\frac{1}{(x^2+y^2+1)^{\frac{3}{2}}}\,dy = \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{x^2+1}}}}\frac{\sqrt{x^2+1}\sec^2{u}}{(x^2+1+(x^2+1)\tan^2{u})^{\frac{3}{2}}}\,du\\
 = \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{x^2+1}}}}\frac{\sqrt{x^2+1}\sec^2{u}}{(x^2+1)^{\frac32}(1+\tan^2{u})^{\frac{3}{2}}}\,du\\
 = \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{x^2+1}}}}\frac{\sec^2{u}}{(x^2+1)\sec^3{u}}\,du\\
 = \frac{1}{x^2+1}\int_{0}^{\tan^{-1}{\frac{1}{\sqrt{x^2+1}}}}\cos{u}\,du\\
 = \frac{1}{x^2+1}\frac{1}{\sqrt{x^2+2}}.$$
Next we need to integrate $\frac{I}{kq} = \int_{0}^{1}\frac{1}{(x^2+1)\sqrt{x^2+2}}\,dx$. Trigonometric substitution again does the trick. Letting $x=\sqrt{2}\tan{u}$,
$$\int_{0}^{1}\frac{1}{(x^2+1)\sqrt{x^2+2}}\,dx = \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{2}}}}\frac{\sqrt{2}\sec^2{u}}{(2\tan^2{u}+1)\sqrt{2\tan^2{u}+2}}\,du\\
= \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{2}}}}\frac{\sec^2{u}}{(2\tan^2{u}+1)\sqrt{\tan^2{u}+1}}\,du\\
= \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{2}}}}\frac{\sec{u}}{2\tan^2{u}+1}\,du\\
= \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{2}}}}\frac{\cos{u}}{2\sin^2{u}+\cos^2{u}}\,du\\
= \int_{0}^{\tan^{-1}{\frac{1}{\sqrt{2}}}}\frac{\cos{u}}{\sin^2{u}+1}\,du\\
= \int_{0}^{1/\sqrt{3}}\frac{dw}{w^2+1}=\tan^{-1}{\frac{1}{\sqrt{3}}} = \frac{\pi}{6},$$
where in the last line we have substituted $w=\sin{u}$. Thus, the final result is:
$$I = \frac{\pi kq}{6}.~~~\blacksquare$$
