evaluate this definited integral using the differentiating under the integral sign Leibniz rule.q

Let's denote our integral as $I(a,r)$, such that we have

$$I(a,r)= \int_0^\infty \frac{e^{-ax}\sin(rx)}{x}\,\mathrm dx.$$

For convergence, I will be assuming that $a\geq0$ and $r\in \mathbb R$.

We note that $I(a,0)=0$.

Now we differentiate $I(a,r)$ w.r.t. $r$. Using the Leibniz rule,

$$\begin{align} \frac{\partial I}{\partial r} &= \int_0^\infty e^{-ax}\cos(rx)\,\mathrm dx\\ \frac{\partial I}{\partial r}&=\frac a{a^2+r^2}\end{align} $$

Now integrating both sides from $0$ to $r$ w.r.t. $r$,

$$I(a,r)-\underbrace{I(a,0)}_{=0} = \int_0^r\frac a{a^2+ r^2}\,\mathrm dr$$

$$\boxed{\boxed{ I(a,r)=\int_0^\infty \frac{e^{-ax}\sin(rx)}{x}\,\mathrm dx = \arctan \Big(\frac ra\Big)}}$$