Please refer to : How to prove that $\int_{0}^{\infty}\sin{x}\arctan{\frac{1}{x}}\,\mathrm dx=\frac{\pi }{2} \big(\frac{e-1}e\big)$
The answer by @Venus.
What is the procedure in converting that single integral, dividing it into parts, and making it a double integral?
And also, how Venus took $\sin(x)$ and brought it inside the first integral, and interchanging the integrals?
What is the criterion?
I am very interested in this.
Any links advice or comment is very helpful.
Thanks!