The simplest solution uses complex analysis, residue theorem.
$$
\begin{aligned}
f(x) &=
\int_0^\infty\frac{\cos(tx)}{1+t^2}\; dt
\\
&=
\frac 12\int_{-\infty}^\infty\frac{\cos(tx)}{1+t^2}\; dt
\\
&=
\text{Real part of }
\frac 12\int_{-\infty}^\infty\frac{\exp(itx)}{1+t^2}\; dt
\\
&=
\text{Real part of }
\frac 12\lim_{R\to\infty}
\int_{-R}^R\frac{\exp(itx)}{1+t^2}\; dt
\\
&=
\text{Real part of }
\frac 12\lim_{R\to\infty}
\int_\gamma\frac{\exp(itx)}{1+t^2}\; dt
\\
&\qquad\text{where $\gamma$ is the closed contour built from }
\\
&\qquad\text{the segment $[-R,R]$, followed by the upper semicircle
on this diameter,}
\\
&=
\text{Real part of }
\frac 12\cdot 2\pi i\cdot
\text{Residue}_{t=i}\frac{\exp(itx)}{(t+i)(t-i)}
\\
&=
\text{Real part of }
\frac 12\cdot 2\pi i\cdot
\frac{\exp(-x)}{i+i}
\\
&=
\frac\pi 2\exp(-x)\ .
\end{aligned}
$$
To be complete, we have to give an upper bound on the
integral on the upper semicircle with radius $R$, parametrized by
$s\to Re^{is}$. Note thet we integrate a function which is bounded in module by $1/(R^2-1)$, taken at most times the length of the semicircle, $\pi R$. This product converges to zero for $R\to\infty$.
This argument extends easily to similar integrals.
If complex analysis is still considered to be heavy metal, or if
we need an alternative solution supporting the ideas from the post, then here is a way to proceed.
For short, leg $g$ be the rational function $g:\Bbb R\to\Bbb R$,
$$g(t)=\frac 1{t^2+1}\ .$$
Its first derivatives can be easily computed with mathematical software aid, so this is not our point. The derivatives of order $0,1,2,3,\dots$ get a better and better total degree in $t$, for performing derivation "inside the integral", namely $-2,-3,-4,-5,\dots$ so we can write:
$$
\begin{aligned}
f(x)
&=
\int_0^\infty\frac{\cos(tx)}{1+t^2}\; dt
\\
&=
\frac 12\int_{\Bbb R}
\cos(tx)\cdot g(t)\; dt
\\
&=
\frac 12\int_{\Bbb R}
\frac 1x\sin(tx)\cdot g'(t)\; dt
\\
&=
\frac 12\int_{\Bbb R}
-\frac 1{x^2}\cos(tx)\cdot g''(t)\; dt
\\
&=
\frac 12\int_{\Bbb R}
-\frac 1{x^3}\sin(tx)\cdot g'''(t)\; dt
\\
\\
&=\dots
\\
&\qquad\text{ an so on, and if we want we can further improve the polynomial growth at $t=\infty$.}
\\
&\qquad\text{ Then}
\\
\\
f'(x)
&=
\frac{\partial}{\partial x}
\frac 12\int_{\Bbb R}
-\frac 1{x^3}\sin(tx)\cdot g'''(t)\; dt
\\
&=
\frac 12\int_{\Bbb R}
-
\frac{\partial}{\partial x}
\left(\ \frac 1{x^3}\sin(tx)\ \right)\cdot g'''(t)\; dt
\\
&=
\frac 12\int_{\Bbb R}
-
\left(\ \frac {(-3)}x\cdot\frac 1{x^3}\sin(tx)
+\frac 1{x^3}\cos(tx)\cdot t
\ \right)\cdot g'''(t)\; dt
\\
&=
-\frac 3xf(x)
+
\frac 12\int_{\Bbb R}
-
\frac 1{x^3}\cos(tx)\cdot t\cdot g'''(t)\; dt
\\
&=
-\frac 3xf(x)
-
\frac 12\int_{\Bbb R}
\frac 1{x^3}\cos(tx)\cdot \left(\ \frac {8t^3}{(t^2+1)^3}\ \right)'\; dt
\\
&=
-\frac 3xf(x)
+
\frac 12\int_{\Bbb R}
\frac 1{x^2}\sin(tx)\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\\
&
\\
f''(x)
&=
\frac 3{x^2}f(x)
-
\frac 3x f'(x)
\\
&\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac\partial{\partial x}
\left(\ \frac 1{x^2}\sin(tx)\ \right)
\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\\
&=
\frac 3{x^2}f(x)
-
\frac 3x f'(x)
\\
&\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac{(-2)}x
\cdot \frac 1{x^2}\sin(tx)
\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\\
&\qquad\qquad\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\cdot t\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\\
&=
\frac 3{x^2}f(x)
-
\frac 3x \left(\
-\frac 3xf(x)
+
\frac 12\int_{\Bbb R}
\frac 1{x^2}\sin(tx)\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\ \right)
\\
&\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac{(-2)}x
\cdot \frac 1{x^2}\sin(tx)
\cdot \frac {8t^3}{(t^2+1)^3}\; dt
\\
&\qquad\qquad\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\cdot \frac {8t^4}{(t^2+1)^3}\; dt
\\
&=
\frac {12}{x^2}f(x)
-
\frac 12\int_{\Bbb R}
\frac 1{x^3}\sin(tx)\cdot \frac {8(2+3)t^3}{(t^2+1)^3}\; dt
\\
&\qquad\qquad\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\cdot \frac {8t^4}{(t^2+1)^3}\; dt
\\
&=
\frac {12}{x^2}f(x)
+
\frac 12\int_{\Bbb R}
\frac 1{x^3}\sin(tx)\cdot
\left(\ \frac {10(2t^2+1)}{(t^2+1)^2}\ \right)'\; dt
\\
&\qquad\qquad\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\cdot \frac {8t^4}{(t^2+1)^3}\; dt
\\
&=
\frac {12}{x^2}f(x)
+
\frac 12\int_{\Bbb R}
\frac 1{x^2}\cos(tx)\cdot\frac {10(2t^2+1)}{(t^2+1)^2}\; dt
\\
&\qquad\qquad\qquad\qquad
+
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\cdot \frac {8t^4}{(t^2+1)^3}\; dt
\\
&=
\frac 12
\int_{\Bbb R}
\frac 1{x^2}\cos(tx)
\left[\
\frac {12}{t^2+1}
-
\frac {10(2t^2+1)}{(t^2+1)^2}
+
\frac {8t^4}{(t^2+1)^3}
\ \right]\; dt
\\
&=
\frac 12
\int_{\Bbb R}
-\frac 1{x^2}\cos(tx)
\frac {2(3t^2-1)}{(t^2+1)^3}\; dt
\\
&=
\frac 12
\int_{\Bbb R}
-\frac 1{x^2}\cos(tx)\cdot
\frac {2(3t^2-1)}{(t^2+1)^3}\; dt
\\
&=
\frac 12
\int_{\Bbb R}
-\frac 1{x^2}\cos(tx)\cdot g''(t)\; dt
\\
&=f(x)\ .
\end{aligned}
$$
From $f''(x)=f(x)$ we can finally fix the formula for $f$. The value for $f(0)$ is $\pi/2$. For the derivative $f'(0)$ we have to work a little
more... (I was curious to see if it is possible to avoid "higher stuff", and give a proof using the lines inspired by the post.)