Solving A Definite Integral:The Feynman way $ \displaystyle \int_0^\infty \dfrac{\cos xdx}{1+x^2} $                           
How to calculate the above using differentiation under the integral sign??
 A: Introduce the function $$L(s) = \int_{0}^{\infty}\frac{\cos(x)}{1+x^{2}}\,e^{-sx}\, dx$$ for $s\geq 0$
You can indeed show that it is well-defined and legitimate to differentiate under the integral sign (at least for $s>0$). By doing so you will get $$L''(s)= \int_{0}^{\infty}\frac{x^{2}\cos(x)}{1+x^{2}}\,e^{-sx}dx= \int_{0}^{\infty}\cos(x)\,e^{-sx}dx-L(s)$$
Hence you might want to solve the IVP $$\left\{L''(s)+L(s) = \frac{s}{1+s^{2}} \, \,, \,\lim_{s \rightarrow \infty}L(s)=0 \, \,, \, \, \lim_{s\rightarrow \infty}L'(s)=0\right\}$$
Honestly I think this route is far more complicated than using residues, since we are forced to work with a global problem for the purpose of obtaining information at a local point $s=0$  i.e seeking a solution to an ODE for  $s\geq 0$ only to find $L(0)$
A: Another way is to note that, if we put $$I\left(a\right)=\int_{0}^{\infty}\frac{\sin\left(ax\right)}{x\left(1+x^{2}\right)}dx,\,a>0$$ we have $$I'\left(a\right)=\int_{0}^{\infty}\frac{\cos\left(ax\right)}{1+x^{2}}dx
 $$ and now follow this answer to find $$I\left(a\right)=\frac{\pi}{2}\left(1-e^{-a}\right)$$ and so $$\lim_{a\rightarrow1}I'\left(a\right)=\frac{\pi }{2e}.$$
